diff options
Diffstat (limited to 'catalog-ui/src/app/ng2/services')
-rw-r--r-- | catalog-ui/src/app/ng2/services/data-type.service.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/catalog-ui/src/app/ng2/services/data-type.service.ts b/catalog-ui/src/app/ng2/services/data-type.service.ts index d4af634cec..6eead12134 100644 --- a/catalog-ui/src/app/ng2/services/data-type.service.ts +++ b/catalog-ui/src/app/ng2/services/data-type.service.ts @@ -140,16 +140,24 @@ export class DataTypeService { return null; } - public getDerivedDataTypeProperties(dataTypeObj: DataTypeModel, propertiesArray: Array<DerivedFEProperty>, parentName: string) { + public getDerivedDataTypeProperties(dataTypeObj: DataTypeModel, propertiesArray: Array<DerivedFEProperty>, parentName: string, toscaPath?: string[]) { //push all child properties to array + const parentToscaPath = toscaPath != null ? toscaPath.toString() : null; if (!dataTypeObj) return; if (dataTypeObj.properties) { dataTypeObj.properties.forEach((derivedProperty) => { + derivedProperty.parentToscaPath = parentToscaPath != null ? parentToscaPath.split(',') : []; + let innerToscaPath = null; if (dataTypeObj.name !== PROPERTY_DATA.OPENECOMP_ROOT || derivedProperty.name !== PROPERTY_DATA.SUPPLEMENTAL_DATA) {//The requirement is to not display the property supplemental_data - propertiesArray.push(new DerivedFEProperty(derivedProperty, parentName)); + const childProperty : DerivedFEProperty = new DerivedFEProperty(derivedProperty, parentName); + innerToscaPath = childProperty.toscaPath; + propertiesArray.push(childProperty); } + let derivedDataTypeObj: DataTypeModel = this.getDataTypeByTypeName(derivedProperty.type); - this.getDerivedDataTypeProperties(derivedDataTypeObj, propertiesArray, parentName + "#" + derivedProperty.name); + if (dataTypeObj && dataTypeObj.properties) { + this.getDerivedDataTypeProperties(derivedDataTypeObj, propertiesArray, parentName + "#" + derivedProperty.name, innerToscaPath); + } }); } //recurse parent (derivedFrom), in case one of parents contains properties |