X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Fcomponents%2FEditDescriptorModelProperties.js;h=b3d8afb2bd5003cee44d154dec373365c625fa9f;hp=4ee4345b7ebc2ba652e15cf4b6e144e2d0dcaf64;hb=7f333680f9c58eed089b17e206528f2e21e2e017;hpb=2d500b28cb1de263137d562547e492c67971e273 diff --git a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js index 4ee4345b7..b3d8afb2b 100644 --- a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js +++ b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js @@ -180,13 +180,14 @@ 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); const onFocus = onFocusPropertyFormInputElement.bind(container, property, path, value); const placeholder = changeCase.title(property.name); const className = ClassNames(property.name + '-input', {'-is-guid': isGuid}); - const fieldValue = value ? (value.constructor.name != "Object") ? value : '' : undefined; + const fieldValue = value ? (value.constructor.name != "Object") ? value : '' : (isNaN(value) ? undefined : value); if (isEnumeration) { const enumeration = Property.getEnumeration(property, value); const options = enumeration.map((d, i) => { @@ -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