Fix issue on list and map property entries in composition view 06/133606/3
authorimamSidero <imam.hussain@est.tech>
Thu, 9 Mar 2023 16:47:20 +0000 (16:47 +0000)
committerMichael Morris <michael.morris@est.tech>
Mon, 13 Mar 2023 09:33:57 +0000 (09:33 +0000)
List and map entries are rendered correctly on composition view

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

catalog-ui/src/app/directives/property-types/type-list/type-list-directive.html
catalog-ui/src/app/directives/property-types/type-list/type-list-directive.ts
catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html
catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts
catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts
catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html

index e92e8b1..1455f27 100644 (file)
@@ -28,7 +28,7 @@
         <div data-ng-if="!isSchemaTypeDataType">
             <div class="i-sdc-form-item list-new-item" data-ng-class="{error:(parentFormObj['listNewItem'+fieldsPrefixName].$dirty && parentFormObj['listNewItem'+fieldsPrefixName].$invalid)}"
                 ng-if="schemaProperty.type !== 'map'">
-                <form class="temp-form">
+                <form class="temp-form" data-ng-if="isService">
                     <input type="radio" name="hasToscaFunction-{{fieldsPrefixName}}-{{$index}}" data-ng-checked="{{showToscaFunction[$index] == false}}" data-ng-click="onEnableTosca(false,$index)"/> 
                     Value
                     <input type="radio" name="hasToscaFunction-{{fieldsPrefixName}}-{{$index}}" data-ng-checked="{{showToscaFunction[$index]}}" data-ng-click="onEnableTosca(true,$index)" /> 
index 23add53..0d54fc4 100644 (file)
@@ -46,6 +46,7 @@ export interface ITypeListScope extends ng.IScope {
     showToscaFunction: Array<boolean>;
     constraints:string[];
     types:DataTypesMap;
+    isService:boolean;
 
     getValidationPattern(type:string):RegExp;
     validateIntRange(value:string):boolean;
@@ -83,7 +84,8 @@ export class TypeListDirective implements ng.IDirective {
         defaultValue: '@',//this list default value
         maxLength: '=',
         constraints: '=',
-        types: '='
+        types: '=',
+        isService: '='
     };
 
     restrict = 'E';
index a2b7424..f53f5cf 100644 (file)
@@ -41,7 +41,7 @@
         </div>
         <div data-ng-if="!isSchemaTypeDataType" class="i-sdc-form-item map-item-field" data-ng-class="{error:(parentFormObj['mapValue'+fieldsPrefixName+$index].$dirty && parentFormObj['mapValue'+fieldsPrefixName+$index].$invalid)}">
             <label class="i-sdc-form-label required">Value</label>
-            <form class="temp-form">
+            <form class="temp-form" data-ng-if="isService">
                 <input type="radio" name="hasToscaFunction-{{fieldsPrefixName}}-{{$index}}" data-ng-checked="{{showToscaFunction[$index] == false}}" data-ng-click="onEnableTosca(false,$index)"/>
                 Value
                 <input type="radio" name="hasToscaFunction-{{fieldsPrefixName}}-{{$index}}" data-ng-checked="{{showToscaFunction[$index]}}" data-ng-click="onEnableTosca(true,$index)" ng-disabled="mapKeys[$index] == '' || mapKeys[$index] == null"/>
index 456c66a..f8fa6dd 100644 (file)
@@ -48,6 +48,7 @@ export interface ITypeMapScope extends ng.IScope {
     showAddBtn: boolean;
     showToscaFunction: boolean[];
     types: DataTypesMap;
+    isService: boolean;
 
     getValidationPattern(type: string): RegExp;
     validateIntRange(value: string): boolean;
@@ -75,7 +76,8 @@ export class TypeMapDirective implements ng.IDirective {
         constraints: '=',
         showAddBtn: '=?',
         parentProperty: '=',
-        types: '='
+        types: '=',
+        isService: '='
     };
 
     restrict = 'E';
index 52e8c00..61a58c5 100644 (file)
@@ -188,7 +188,7 @@ export class PropertyFormViewModel {
 
     private initForNotSimpleType = ():void => {
         const property = this.$scope.editPropertyModel.property;
-        this.$scope.isTypeDataType = this.isDataTypeForPropertyType(this.$scope.editPropertyModel.property);
+        this.$scope.isTypeDataType = this.DataTypesService.isDataTypeForPropertyType(this.$scope.editPropertyModel.property);
         if (property.isToscaFunction()) {
             this.initValueForGetFunction();
             return;
@@ -305,6 +305,7 @@ export class PropertyFormViewModel {
             }
         }
         this.initResource();
+        this.initForNotSimpleType();
         this.initComponentInstanceMap();
 
         this.$scope.validateJson = (json:string):boolean => {
@@ -320,7 +321,6 @@ export class PropertyFormViewModel {
             this.$scope.nonPrimitiveTypes = _.filter(Object.keys(this.$scope.dataTypes), (type:string)=> {
                 return this.$scope.editPropertyModel.types.indexOf(type) == -1;
             });
-            this.initForNotSimpleType();
             this.$scope.isLoading = false;
         });
 
index 2840e86..b717d7a 100644 (file)
                                           default-value="{{getDefaultValue()}}"
                                           max-length="maxLength"
                                           types="dataTypes"
+                                          is-service="!componentMetadata.isVfc"
                                           constraints="editPropertyModel.property.constraints && editPropertyModel.property.constraints[0].validValues">
                                 </type-map>
                             </div>
                                            default-value="{{getDefaultValue()}}"
                                            max-length="maxLength"
                                            types="dataTypes"
+                                           is-service="!componentMetadata.isVfc"
                                            constraints="editPropertyModel.property.constraints && editPropertyModel.property.constraints[0].validValues"></type-list>
                             </div>