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=6fe1112c36a2bda8795a97eaabb791f333acc434;hp=89d1fe9dca8eced78ad9eb8561e16d9eb14f61f1;hb=6620bca06b9874e68e8bc11ce28b7a6eeda5cc03;hpb=4e7b00465d087292dc6127bc892a5fa3a64365b6 diff --git a/skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaProperty.js b/skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaProperty.js index 89d1fe9dc..6fe1112c3 100644 --- a/skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaProperty.js +++ b/skyquake/plugins/composer/src/src/libraries/model/DescriptorModelMetaProperty.js @@ -32,6 +32,9 @@ import DescriptorTemplateFactory from './DescriptorTemplateFactory' import utils from '../utils' export default { + isBoolean(property = {}) { + return (typeof(property['data-type']) == 'string') && (property['data-type'].toLowerCase() == 'boolean') + }, isLeaf(property = {}) { return /leaf|choice/.test(property.type); }, @@ -136,6 +139,31 @@ export default { return leafRefObjects; }, + + getConfigParamRef(property = {}, path, value, fullFieldKey, transientCatalogs, container, vnfdId) { + // const leafRefPath = property['data-type']['leafref']['path']; + const leafRefPath = "/vnfd:vnfd-catalog/vnfd:vnfd[vnfd:id = " + vnfdId + "]/vnfd:config-parameter/vnfd:config-parameter-source/vnfd:name" + const transientCatalogHash = {}; + + transientCatalogs.map((catalog) => { + transientCatalogHash[catalog.type + '-catalog'] = {}; + transientCatalogHash[catalog.type + '-catalog'][catalog.type] = catalog['descriptors']; + }); + + let leafRefPathValues = utils.resolveLeafRefPath(transientCatalogHash, leafRefPath, fullFieldKey, path, container); + + let leafRefObjects = []; + + leafRefPathValues && leafRefPathValues.map((leafRefPathValue) => { + leafRefObjects.push({ + name: leafRefPathValue, + value: leafRefPathValue, + isSelected: String(leafRefPathValue) === String(value) + }); + }); + + return leafRefObjects; + }, isGuid(property = {}) { const type = property['data-type']; if (typeof type === 'object' && type.leafref && type.leafref.path) {