From: franciscovila Date: Thu, 23 Feb 2023 10:46:25 +0000 (+0000) Subject: Setting Tosca Function on top of unsaved value causes problems X-Git-Tag: 1.12.3~8 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=sdc.git;a=commitdiff_plain;h=7193e96b30ccaa4ed06c80a4861c91d341e0d910 Setting Tosca Function on top of unsaved value causes problems Issue-ID: SDC-4405 Signed-off-by: franciscovila Change-Id: I688fafa39338900f6248213c27975ced113f5ee9 --- diff --git a/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.html b/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.html index 8e7e3a1282..956bb05356 100644 --- a/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.html +++ b/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.html @@ -21,11 +21,11 @@
- +
{{property.name}}
- +
{{property.name}}
@@ -44,7 +44,7 @@
- + { this.property.updateValueObj(event.value, event.isValid); + if (this.property.hasValueObjChanged()) { + this.checkboxDisabled = true; + } + if (event.value === '' || event.value === null || event.value === undefined) { + this.checkboxDisabled = false; + } this.emitter.emit(); }; diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts index f1404d37f9..ada12ad2e2 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts @@ -364,6 +364,8 @@ export class PropertiesAssignmentComponent { //clear selected property from the navigation this.selectedFlatProperty = new SimpleFlatProperty(); this.propertiesNavigationData = []; + this.checkedToscaCount = 0; + this.enableToscaFunction = false; }; /** @@ -626,6 +628,13 @@ export class PropertiesAssignmentComponent { } } if (this.selectedInstanceData instanceof ComponentInstance) { + var toRemove = this.changedData.filter(obj => { + return obj.name == checkedInstanceProperty.name && obj.type == checkedInstanceProperty.type && obj.value == null; + }); + const index: number = this.changedData.indexOf(toRemove[0]); + if (index !== -1) { + this.changedData.splice(index, 1); + } this.updateInstanceProperty(checkedInstanceProperty); } else if (this.selectedInstanceData instanceof GroupInstance) { this.updateGroupInstanceProperty(checkedInstanceProperty); @@ -689,6 +698,7 @@ export class PropertiesAssignmentComponent { this.loadingProperties = true; this.enableToscaFunction = false; this.checkedToscaCount = 0; + this.componentInstanceServiceNg2.updateInstanceProperties(this.component.componentType, this.component.uniqueId, this.selectedInstanceData.uniqueId, [instanceProperty]) .subscribe(() => {