Bug fix for tosca function map values in property assignment page 52/133252/3
authorimamSidero <imam.hussain@est.tech>
Tue, 14 Feb 2023 14:10:25 +0000 (14:10 +0000)
committerMichael Morris <michael.morris@est.tech>
Thu, 16 Feb 2023 12:49:24 +0000 (12:49 +0000)
Disabled add/edit/delete operations of property when overall checkbox is checked and fixed for integer key values

Issue-ID: SDC-4392
Signed-off-by: Imam hussain <imam.hussain@est.tech>
Change-Id: I3d299195ecc6215b1b99eb159391cdb79f59cb86

catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.html

index d87549f..142969a 100644 (file)
@@ -1986,7 +1986,8 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
                     property.setValue(property.getToscaFunction().getValue());
                 }
                 if (CollectionUtils.isNotEmpty(property.getSubPropertyToscaFunctions())) {
-                    if (StringUtils.isNumeric(property.getSubPropertyToscaFunctions().iterator().next().getSubPropertyPath().get(0))) {
+                    ToscaPropertyType type = ToscaPropertyType.isValidType(property.getType());
+                    if (type.equals(ToscaPropertyType.LIST)) {
                         final JSONArray jsonArray = property.getValue() == null ? new JSONArray() : new JSONArray(property.getValue());
                         property.getSubPropertyToscaFunctions().stream().forEach(subToscaFunction -> {
                             addE(jsonArray, subToscaFunction.getSubPropertyPath(), subToscaFunction.getToscaFunction().getValue());
index e199864..959ed36 100644 (file)
@@ -68,8 +68,8 @@
     </ng-container>
     <!-- ICONS: add, delete, and expand -->
     <ng-container *ngIf="(!property.isDeclared && !property.isToscaFunction()) || (property.isToscaFunction() && property.isChildOfListOrMap)">
-            <a *ngIf="(propType == derivedPropertyTypes.LIST) && (!property.isChildOfListOrMap || property.mapInlist)" class="property-icon add-item" (click)="createNewChildProperty();" [ngClass]="{'disabled':readonly || preventInsertItem(property)}" [attr.data-tests-id]="'add-to-list-' + propertyTestsId">Add value to list</a>
-            <a *ngIf="(propType == derivedPropertyTypes.MAP) && (!property.isChildOfListOrMap || property.mapInlist)" class="property-icon add-item" (click)="createNewChildProperty();" [ngClass]="{'disabled':readonly || preventInsertItem(property)}" [attr.data-tests-id]="'add-to-list-' + propertyTestsId">Add value to map</a>
+            <a *ngIf="(propType == derivedPropertyTypes.LIST) && (!property.isChildOfListOrMap || property.mapInlist)" class="property-icon add-item" (click)="createNewChildProperty();" [class.disabled]="property.isSelected" [ngClass]="{'disabled':readonly || preventInsertItem(property)}" [attr.data-tests-id]="'add-to-list-' + propertyTestsId">Add value to list</a>
+            <a *ngIf="(propType == derivedPropertyTypes.MAP) && (!property.isChildOfListOrMap || property.mapInlist)" class="property-icon add-item" (click)="createNewChildProperty();" [class.disabled]="property.isSelected" [ngClass]="{'disabled':readonly || preventInsertItem(property)}" [attr.data-tests-id]="'add-to-list-' + propertyTestsId">Add value to map</a>
             <span *ngIf="property.isChildOfListOrMap" (click)="deleteItem.emit(property);" class="property-icon sprite-new delete-item-icon" [ngClass]="{'disabled':readonly}" [attr.data-tests-id]="'delete-from-list-' + propertyTestsId"></span>
             <span *ngIf="!isPropertyFEModel && (propType == derivedPropertyTypes.COMPLEX || ((propType == derivedPropertyTypes.LIST || propType == derivedPropertyTypes.MAP) && hasChildren))" (click)="expandChildById(propPath)" class="property-icon sprite-new round-expand-icon" [class.open]="expandedChildId.indexOf(propPath) == 0" [attr.data-tests-id]="'expand-' + propertyTestsId" ></span>
     </ng-container>