RIFT-15245: Vnfd-id edit in VNF composer behaves strangely
[osm/UI.git] / skyquake / plugins / composer / src / src / components / EditDescriptorModelProperties.js
index 7965e25..d04dddf 100644 (file)
@@ -47,12 +47,12 @@ import imgRemove from '../../../node_modules/open-iconic/svg/trash.svg'
 import '../styles/EditDescriptorModelProperties.scss'
 
 function getDescriptorMetaBasicForType(type) {
-       const basicPropertiesFilter = d => _.contains(DESCRIPTOR_MODEL_FIELDS[type], d.name);
+       const basicPropertiesFilter = d => _.includes(DESCRIPTOR_MODEL_FIELDS[type], d.name);
        return DescriptorModelMetaFactory.getModelMetaForType(type, basicPropertiesFilter) || {properties: []};
 }
 
 function getDescriptorMetaAdvancedForType(type) {
-       const advPropertiesFilter = d => !_.contains(DESCRIPTOR_MODEL_FIELDS[type], d.name);
+       const advPropertiesFilter = d => !_.includes(DESCRIPTOR_MODEL_FIELDS[type], d.name);
        return DescriptorModelMetaFactory.getModelMetaForType(type, advPropertiesFilter) || {properties: []};
 }
 
@@ -178,8 +178,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);
@@ -205,7 +205,7 @@ export default function EditDescriptorModelProperties(props) {
                }
 
                if (isLeafRef) {
-                       let fullFieldKey = fieldKey;
+                       let fullFieldKey = _.isArray(fieldKey) ? fieldKey.join(':') : fieldKey;
                        let containerRef = container;
                        while (containerRef.parent) {
                                fullFieldKey = containerRef.parent.key + ':' + fullFieldKey;