X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Fcomponents%2FEditDescriptorModelProperties.js;h=2a5da2191323c17c03296b13dc0995c13f95e8ef;hb=e1d37ae51d33ae742d4b872b31a09bcbc1feaf2c;hp=d04dddfb5a3cff9504a1604fe4ca757c84c60ffe;hpb=3ea4a6fecbcd4265ad9da9c06720e9d879bfbf57;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 d04dddfb5..2a5da2191 100644 --- a/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js +++ b/skyquake/plugins/composer/src/src/components/EditDescriptorModelProperties.js @@ -46,6 +46,8 @@ import imgRemove from '../../../node_modules/open-iconic/svg/trash.svg' import '../styles/EditDescriptorModelProperties.scss' + + function getDescriptorMetaBasicForType(type) { const basicPropertiesFilter = d => _.includes(DESCRIPTOR_MODEL_FIELDS[type], d.name); return DescriptorModelMetaFactory.getModelMetaForType(type, basicPropertiesFilter) || {properties: []}; @@ -70,16 +72,7 @@ function getTitle(model = {}) { return model.id; } } - -export default function EditDescriptorModelProperties(props) { - - const container = props.container; - - if (!(DescriptorModelFactory.isContainer(container))) { - return - } - - function startEditing() { +function startEditing() { DeletionManager.removeEventListeners(); } @@ -178,8 +171,8 @@ export default function EditDescriptorModelProperties(props) { let catalogs = cds.getTransientCatalogs(); const name = path.join('.'); + const isEditable = true; const isGuid = Property.isGuid(property); - const isEditable = isGuid; const onChange = onFormFieldValueChanged.bind(container); const isEnumeration = Property.isEnumeration(property); const isLeafRef = Property.isLeafRef(property); @@ -262,7 +255,7 @@ export default function EditDescriptorModelProperties(props) { }); } - function buildChoice(container, property, path, value, key) { + function buildChoice(container, property, path, value, key, props={}) { function onFormFieldValueChanged(event) { if (DescriptorModelFactory.isContainer(this)) { @@ -516,15 +509,15 @@ export default function EditDescriptorModelProperties(props) { if (isMissingDescriptorMeta) { field = No Descriptor Meta for {property.name}; } else if (property.type === 'choice') { - field = buildChoice(container, property, valuePath, value, key.join(':')); + field = buildChoice(container, property, valuePath, value, key.join(':'), props); } else if (isSimpleListView) { - field = buildSimpleListItem(container, property, valuePath, value, key, index); + field = buildSimpleListItem(container, property, valuePath, value, key, index, props); } else if (isLeafList) { - field = buildLeafListItem(container, property, valuePath, value, key, index); + field = buildLeafListItem(container, property, valuePath, value, key, index, props); } else if (hasProperties) { - field = buildElement(container, property, valuePath, value, key.join(':')) + field = buildElement(container, property, valuePath, value, key.join(':'), props) } else { - field = buildField(container, property, valuePath, value, key.join(':')); + field = buildField(container, property, valuePath, value, key.join(':'), props); } function onClickLeaf(property, path, value, event) { @@ -594,8 +587,17 @@ export default function EditDescriptorModelProperties(props) { ); } +export default function EditDescriptorModelProperties(props, type) { + + const container = props.container; + + if (!(DescriptorModelFactory.isContainer(container))) { + return + } + + - const containerType = container.uiState['qualified-type'] || container.uiState.type; + const containerType = (_.isEmpty(type) ? false : type)|| container.uiState['qualified-type'] || container.uiState.type; const basicProperties = getDescriptorMetaBasicForType(containerType).properties; function buildBasicGroup() { @@ -633,7 +635,7 @@ export default function EditDescriptorModelProperties(props) { {properties.map(property => { const path = [property.name]; const value = container.model[property.name]; - return build(container, property, path, value, {toggle: true, width: props.width}); + return build(container, property, path, value, _.assign({toggle: true, width: props.width}, props)); })}
We need this so when the user closes the panel it won't shift away and scare the bj out of them!
@@ -665,3 +667,6 @@ export default function EditDescriptorModelProperties(props) { ); } +export {build} +// export buildElement; +// export buildChoice;