X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Flibraries%2Fmodel%2FDescriptorModelMetaProperty.js;h=968bc24e9a2534e33b2c36211efb234ed59a1f36;hp=2955e550372eafd12ca2816019cd75fbd9d519ff;hb=refs%2Fchanges%2F79%2F5479%2F2;hpb=075200b023e659111da2ffd47129c88314140dd1 diff --git a/skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaProperty.js b/skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaProperty.js index 2955e5503..968bc24e9 100644 --- a/skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaProperty.js +++ b/skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaProperty.js @@ -21,8 +21,6 @@ * This class provides utility methods for interrogating an instance of model uiState object. */ -'use strict'; - import _includes from 'lodash/includes' import _isArray from 'lodash/isArray' import guid from './../guid' @@ -36,6 +34,9 @@ export default { isBoolean(property = {}) { return (typeof(property['data-type']) == 'string') && (property['data-type'].toLowerCase() == 'boolean') }, + isLeafEmpty(property = {}) { + return (typeof(property['data-type']) == 'string') && (property['data-type'].toLowerCase() == 'empty') + }, isLeaf(property = {}) { return /leaf|choice/.test(property.type); }, @@ -77,8 +78,8 @@ export default { return /string|int/.test(property['data-type']) || Property.isEnumeration(property) || Property.isGuid(property); }, defaultValue(property = {}) { - if (property.defaultValue) { - return property.defaultValue; + if (property['default-value']) { + return property['default-value']; } if (this.isObject(property)) { return {}; @@ -199,6 +200,9 @@ export default { if (property.type === 'leaf') { return defaultValue(property); } + if (property.type === 'leaf_list' ) { + return ""; + } if (/list/.test(property.type)) { property.type = 'container'; }