From 7952ce203e89fad3103b0ec17a41d240004c92e9 Mon Sep 17 00:00:00 2001 From: KrupaNagabhushan Date: Tue, 9 Aug 2022 19:16:12 +0100 Subject: [PATCH] Fix unable to delete default value for a complex property Issue-ID: SDC-4127 Signed-off-by: KrupaNagabhushan Change-Id: Id63294cf01b0576fbb4d3d34ab11952b3579c24f --- .../app/directives/property-types/type-list/type-list-directive.ts | 5 ----- .../component-property-form/property-form-view-model.ts | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.ts b/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.ts index 76810040e6..857c62cc92 100644 --- a/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.ts +++ b/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.ts @@ -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" diff --git a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts index fbd9408ea8..17e82099ab 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts +++ b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts @@ -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 = []; } -- 2.16.6