From 7193e96b30ccaa4ed06c80a4861c91d341e0d910 Mon Sep 17 00:00:00 2001 From: franciscovila Date: Thu, 23 Feb 2023 10:46:25 +0000 Subject: Setting Tosca Function on top of unsaved value causes problems Issue-ID: SDC-4405 Signed-off-by: franciscovila Change-Id: I688fafa39338900f6248213c27975ced113f5ee9 --- .../dynamic-property/dynamic-property.component.html | 6 +++--- .../dynamic-property/dynamic-property.component.ts | 9 ++++++++- .../properties-assignment.page.component.ts | 10 ++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) (limited to 'catalog-ui') 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(() => { -- cgit 1.2.3-korg