X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Fcomponents%2FEditDescriptorModelProperties.js;h=651c40d7b11fb4132cab9ab0b82418ad9dbfd975;hb=15999cf835be1475fd72fddcfb34831f4173eb92;hp=0e1746dda78f4af8ecf757e55d0cbe8b8b35e0f0;hpb=5e54a0def21e6755ad35922acc558b5eaee4e71a;p=osm%2FUI.git diff --git a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js index 0e1746dda..651c40d7b 100644 --- a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js +++ b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js @@ -324,7 +324,7 @@ export default function EditDescriptorModelProperties(props) { // We stick in a string when the user actually sets it to simplify things // but the correct thing happens when we serialize to user data let isEmptyLeafPresent = (value === EMPTY_LEAF_PRESENT || value === null); - let present = isEmptyLeafPresent ? EMPTY_LEAF_PRESENT : ""; + let present = isEmptyLeafPresent ? EMPTY_LEAF_PRESENT : [null]; const options = [ , @@ -531,14 +531,14 @@ export default function EditDescriptorModelProperties(props) { if(fieldProperties) { //Check each case statement in model and see if it is present in container model. cases.map(function(c){ - if(fieldProperties.hasOwnProperty(c.optionValue.split('.')[1])) { + if(c.optionValue && fieldProperties.hasOwnProperty(c.optionValue.split('.')[1])) { utils.assignPathValue(container.model, ['uiState.choice', pathToChoice, 'selected'].join('.'), c.optionValue); } }); selectedOptionValue = utils.resolvePath(container.model, ['uiState.choice', pathToChoice, 'selected'].join('.')); } else { property.properties.map(function(p) { - let pname = p.properties[0].name; + let pname = p.properties[0] && p.properties[0].name; if(container.model.hasOwnProperty(pname)) { utils.assignPathValue(container.model, ['uiState.choice', pathToChoice, 'selected'].join('.'), [p.name, pname].join('.')); } @@ -747,7 +747,7 @@ export default function EditDescriptorModelProperties(props) { value = utils.resolvePath(container.model, ['uiState.choice'].concat(path, 'selected').join('.')); if(!value) { property.properties.map(function(p) { - let pname = p.properties[0].name; + let pname = p.properties[0] && p.properties[0].name; if(container.model.hasOwnProperty(pname)) { value = container.model[pname]; }