From 7e08a2976d34066412af14fe633eecde3ce19fc7 Mon Sep 17 00:00:00 2001 From: imamSidero Date: Mon, 5 Dec 2022 14:13:39 +0000 Subject: Provide tosca function to List entries Providing the capability to add tosca function as the List entries Issue-ID: SDC-4288 Signed-off-by: Imam hussain Change-Id: Ib2e11945f76b7004dbf8807274ee6333b9d9aa05 --- .../dynamic-property/dynamic-property.component.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.ts') diff --git a/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.ts b/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.ts index 57b991bf70..edcbd43e27 100644 --- a/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.ts +++ b/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.ts @@ -171,7 +171,6 @@ export class DynamicPropertyComponent { this.expandChildById(newProps[0].propertiesName); this.updateMapKeyValueOnMainParent(newProps); - this.emitter.emit(); } } @@ -219,23 +218,22 @@ export class DynamicPropertyComponent { if (!itemParent) { return; } - + const oldKey = item.getActualMapKey(); + if (this.property.subPropertyToscaFunctions !== null) { + let tempSubToscaFunction: SubPropertyToscaFunction[] = []; + this.property.subPropertyToscaFunctions.forEach((item : SubPropertyToscaFunction, index) => { + if(item.subPropertyPath[0] != oldKey){ + tempSubToscaFunction.push(item); + } + }); + this.property.subPropertyToscaFunctions = tempSubToscaFunction; + } if (item.derivedDataType == DerivedPropertyType.MAP && !item.mapInlist) { - const oldKey = item.getActualMapKey(); delete itemParent.valueObj[oldKey]; if (itemParent instanceof PropertyFEModel) { delete itemParent.valueObjValidation[oldKey]; itemParent.valueObjIsValid = itemParent.calculateValueObjIsValid(); } - if (this.property.subPropertyToscaFunctions !== null) { - let tempSubToscaFunction: SubPropertyToscaFunction[] = []; - this.property.subPropertyToscaFunctions.forEach((item : SubPropertyToscaFunction, index) => { - if(item.subPropertyPath[0] != oldKey){ - tempSubToscaFunction.push(item); - } - }); - this.property.subPropertyToscaFunctions = tempSubToscaFunction; - } this.property.childPropMapKeyUpdated(item, null); // remove map key } else { const itemIndex: number = this.property.flattenedChildren.filter(prop => prop.parentName == item.parentName).map(prop => prop.propertiesName).indexOf(item.propertiesName); -- cgit 1.2.3-korg