From 34f2113acd7f8f75de1e3184d0a5e0449ceba301 Mon Sep 17 00:00:00 2001 From: vasraz Date: Thu, 24 Aug 2023 11:29:34 +0100 Subject: Fix 'Unable to add metadata on inputs'-bug Signed-off-by: Vasyl Razinkov Change-Id: I7414366c20b5c7d61acaaebc8bfa83768d4452e0 Issue-ID: SDC-4603 --- .../logic/inputs-table/inputs-table.component.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.ts') diff --git a/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.ts b/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.ts index c2a872fe9b..d5a49f8732 100644 --- a/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.ts +++ b/catalog-ui/src/app/ng2/components/logic/inputs-table/inputs-table.component.ts @@ -185,7 +185,23 @@ export class InputsTableComponent { modelProperty.constraints = tempProperty.constraints; }); } - this.modalsHandler.newOpenEditPropertyModal(modelProperty, [],true, 'component', modelProperty.resourceInstanceUniqueId, this.parentComponent, inputProperty); + this.modalsHandler.newOpenEditPropertyModal(modelProperty, [],true, 'component', modelProperty.resourceInstanceUniqueId, this.parentComponent, inputProperty).then(result => { + let newInputs : Array = []; + this.inputs.forEach(input => { + if (input.uniqueId != inputProperty.uniqueId) { + newInputs.push(input); + } else { + let newMetadataEntries : Array = []; + for (let key of Object.keys(inputProperty.metadata)){ + newMetadataEntries.push(new MetadataEntry(key, inputProperty.metadata[key])); + } + inputProperty.metadataEntries = []; + inputProperty.metadataEntries = newMetadataEntries; + newInputs.push(inputProperty); + } + }); + this.inputs = newInputs; + }); } private createPropertyModel(inputproperty: InputFEModel){ -- cgit 1.2.3-korg