Fix unable to delete default value for a complex property 11/130211/2
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>
Tue, 9 Aug 2022 18:16:12 +0000 (19:16 +0100)
committerMichael Morris <michael.morris@est.tech>
Thu, 11 Aug 2022 16:35:22 +0000 (16:35 +0000)
Issue-ID: SDC-4127
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Change-Id: Id63294cf01b0576fbb4d3d34ab11952b3579c24f

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

index 7681004..857c62c 100644 (file)
@@ -86,11 +86,6 @@ export class TypeListDirective implements ng.IDirective {
         //reset valueObjRef when schema type is changed
         scope.$watchCollection('schemaProperty.type', (newData:any):void => {
             scope.isSchemaTypeDataType = this.DataTypesService.isDataTypeForSchemaType(scope.schemaProperty);
-            //insert 1 empty item dt by default
-            if (scope.isSchemaTypeDataType && (!scope.valueObjRef || !scope.valueObjRef.length)) {
-                scope.valueObjRef = scope.valueObjRef || [];
-                scope.valueObjRef.push({});
-            }
         });
 
         //when user brows between properties in "edit property form"
index fbd9408..17e8209 100644 (file)
@@ -425,7 +425,7 @@ export class PropertyFormViewModel {
 
         this.$scope.onSchemaTypeChange = ():void => {
             if (this.$scope.editPropertyModel.property.type == PROPERTY_TYPES.MAP) {
-                this.$scope.myValue = {'': null};
+                this.$scope.myValue = {};
             } else if (this.$scope.editPropertyModel.property.type == PROPERTY_TYPES.LIST) {
                 this.$scope.myValue = [];
             }