From: Laurence Maultsby Date: Tue, 31 Jan 2017 18:12:53 +0000 (-0500) Subject: RIFT-15495: Boolean dropdowns for composer X-Git-Tag: v1.1.0~6 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F1055%2F1;p=osm%2FUI.git RIFT-15495: Boolean dropdowns for composer 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 4ee4345b7..a69f3bba2 100644 --- a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js +++ b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js @@ -180,6 +180,7 @@ export default function EditDescriptorModelProperties(props) { const name = path.join('.'); const isEditable = true; const isGuid = Property.isGuid(property); + const isBoolean = Property.isBoolean(property); const onChange = onFormFieldValueChanged.bind(container); const isEnumeration = Property.isEnumeration(property); const isLeafRef = Property.isLeafRef(property); @@ -224,6 +225,31 @@ export default function EditDescriptorModelProperties(props) { return ; } + if (isBoolean) { + let fullFieldKey = _.isArray(fieldKey) ? fieldKey.join(':') : fieldKey; + let containerRef = container; + while (containerRef.parent) { + fullFieldKey = containerRef.parent.key + ':' + fullFieldKey; + containerRef = containerRef.parent; + } + + const options = [ + , + + ] + + // if (!isValueSet) { + const noValueDisplayText = changeCase.title(property.name); + options.unshift(); + // } + let val = value; + if(typeof(val) == 'number') { + val = value ? "TRUE" : "FALSE" + } + const isValueSet = (val != '' && val) + return ; + } + if (property['preserve-line-breaks']) { return