From: Laurence Maultsby Date: Wed, 16 Nov 2016 16:16:25 +0000 (-0500) Subject: RIFT-15077: VDU Volume choice fix (top level array of containers with choices) X-Git-Tag: v1.1.0~45 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=commitdiff_plain;h=3313f43da5ff25569f4d4115240bad1b457a05b9 RIFT-15077: VDU Volume choice fix (top level array of containers with choices) Signed-off-by: Laurence Maultsby --- 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 (