X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Fcomponents%2FEditDescriptorModelProperties.js;h=4dc4b28f59925dc82d3b3f2a0ae3d4fcb391c80a;hp=20c84dac58559a518cdff195ca658afc029d6f5a;hb=3313f43da5ff25569f4d4115240bad1b457a05b9;hpb=c65d33acee808925bf2a7e01c2ee17b939fbd24d diff --git a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js index 20c84dac5..4dc4b28f5 100644 --- a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js +++ b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js @@ -287,16 +287,16 @@ export default function EditDescriptorModelProperties(props) { } utils.assignPathValue(stateObject, [selected].join('.'), _.cloneDeep(choiceObject)); - if(this.model.uiState.choice.hasOwnProperty(name)) { - delete this.model[selected]; - utils.removePathValue(this.model, [name, selected].join('.'), isTopCase); - } else { - // remove the current choice value from the model - utils.removePathValue(this.model, [name, selected].join('.'), isTopCase); + if(selected) { + if(this.model.uiState.choice.hasOwnProperty(name)) { + delete this.model[selected]; + utils.removePathValue(this.model, [name, selected].join('.'), isTopCase); + } else { + // remove the current choice value from the model + utils.removePathValue(this.model, [name, selected].join('.'), isTopCase); + } } - - // get any state for the new selected choice const newChoiceObject = utils.resolvePath(stateObject, [value].join('.')) || {}; @@ -333,7 +333,7 @@ export default function EditDescriptorModelProperties(props) { return {optionName: d.name}; }); - const options = [{optionName: ''}].concat(cases).map((d, i) => { + const options = [{optionName: '', optionValue: false}].concat(cases).map((d, i) => { return (