summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/services
diff options
context:
space:
mode:
authorimamSidero <imam.hussain@est.tech>2023-03-23 11:25:23 +0000
committerImam hussain <imam.hussain@est.tech>2023-04-03 11:13:18 +0000
commit7565f810f9fa50c8140843b2f81e8fb428815154 (patch)
tree5ff3ef43bd7434db7c0bd462db295a2726052c61 /catalog-ui/src/app/ng2/services
parent3dff1c221e58de6a81cf6bbdfb84fdf97665e484 (diff)
Provide tosca function capability to all nested levels
Tosca function capability is provided to all nested levels of list, map and custom types Issue-ID: SDC-4445 Signed-off-by: Imam hussain <imam.hussain@est.tech> Change-Id: I29907bdac83d3cadf90aa0a2ed538002132b4789
Diffstat (limited to 'catalog-ui/src/app/ng2/services')
-rw-r--r--catalog-ui/src/app/ng2/services/data-type.service.ts14
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