From: KIRAN KASHALKAR Date: Fri, 18 Nov 2016 19:31:49 +0000 (+0100) Subject: Merge "RIFT-15032: launchpad UI - Viewport - icons for nsr" X-Git-Tag: v1.1.0~44 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=commitdiff_plain;h=8b97db143299720e1da99a1366a6c7b7f2ad782d;hp=f07c8447b59c6fb520dca8e83c514f55116c8d5e Merge "RIFT-15032: launchpad UI - Viewport - icons for nsr" --- 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 (