Fix changing property in node filter issue 10/132110/2
authorJvD_Ericsson <jeff.van.dam@est.tech>
Mon, 7 Nov 2022 12:32:05 +0000 (12:32 +0000)
committerVasyl Razinkov <vasyl.razinkov@est.tech>
Wed, 23 Nov 2022 10:42:39 +0000 (10:42 +0000)
Changing from a non collection property to a collection property
casused the "Add value to list" button to not appear

Issue-ID: SDC-4253
Change-Id: I74df0b706c1b7bd7edd57bd05c3043e8c2dd2d1d
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.ts

index 8c8d1e2..6b018c1 100644 (file)
@@ -73,11 +73,9 @@ export class DynamicPropertyComponent {
         this.propPath = (this.property instanceof PropertyFEModel) ? this.property.name : this.property.propertiesName;
         this.nestedLevel = (this.property.propertiesName.match(/#/g) || []).length;
         this.rootProperty = (this.rootProperty) ? this.rootProperty : <PropertyFEModel>this.property;
-        this.propertyTestsId = this.getPropertyTestsId(); 
-        
+        this.propertyTestsId = this.getPropertyTestsId();
+
         this.initConsraintsValues();
-        
-        
     }
 
     initConsraintsValues(){
@@ -110,6 +108,12 @@ export class DynamicPropertyComponent {
         }
     }
 
+    ngOnChanges() {
+        this.propType = this.property.derivedDataType;
+        this.propPath = (this.property instanceof PropertyFEModel) ? this.property.name : this.property.propertiesName;
+        this.propertyTestsId = this.getPropertyTestsId(); 
+    }
+
 
     onClickPropertyRow = (property, event) => {
         // Because DynamicPropertyComponent is recrusive second time the event is fire event.stopPropagation = undefined