From 9a3d7a41e02a0e291afe24f849e29230df751751 Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Tue, 31 Jan 2017 13:12:53 -0500 Subject: [PATCH] RIFT-15495: Boolean dropdowns for composer Signed-off-by: Laurence Maultsby --- .../EditDescriptorModelProperties.js | 26 +++++++++++++++++++ .../model/DescriptorModelMetaProperty.js | 3 +++ 2 files changed, 29 insertions(+) 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