From 47b3a6177aae2261254b260a2d06358ec83c8d63 Mon Sep 17 00:00:00 2001 From: imamSidero Date: Thu, 7 Jul 2022 21:40:03 +0530 Subject: Fix for list of map type on SELF property Adding the multi value types to the schema type in property-creator component Issue-ID: SDC-4085 Change-Id: I9e6319caa85a99b6be90762698f66435f85811a3 Signed-off-by: Imam Hussain --- .../property-creator/property-creator.component.html | 1 + .../property-creator/property-creator.component.ts | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.html b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.html index df2136beec..52b8d99970 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.html +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.html @@ -19,6 +19,7 @@
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts index 57c9f97387..ba7533a977 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/property-creator/property-creator.component.ts @@ -41,6 +41,17 @@ export class PropertyCreatorComponent { return [PROPERTY_TYPES.LIST, PROPERTY_TYPES.MAP].indexOf(this.propertyModel.type) > -1; } + onTypeChange(): void { + this.propertyModel.schema.property.type=''; + const typeList = this.typesProperties; + if(this.propertyModel.type === PROPERTY_TYPES.MAP){ + this.typesSchemaProperties = typeList.filter(dropdownObject => (dropdownObject.label != 'list' && dropdownObject.label != 'map')); + } + if(this.propertyModel.type === PROPERTY_TYPES.LIST){ + this.typesSchemaProperties = typeList.filter(dropdownObject => dropdownObject.label != 'list'); + } + } + onSchemaTypeChange(): void { if (this.propertyModel.type === PROPERTY_TYPES.MAP) { this.propertyModel.value = JSON.stringify({'': null}); @@ -63,9 +74,7 @@ export class PropertyCreatorComponent { this.typesProperties = _.map(PROPERTY_DATA.TYPES, (type: string) => new DropdownValue(type, type) ); - const typesSimpleProperties = _.map(PROPERTY_DATA.SIMPLE_TYPES, - (type: string) => new DropdownValue(type, type) - ); + const typesSimpleProperties = this.typesProperties.filter(dropdownObject => dropdownObject.label != 'list'); const nonPrimitiveTypesValues = _.map(nonPrimitiveTypes, (type: string) => new DropdownValue(type, type.replace('org.openecomp.datatypes.heat.', '')) -- cgit 1.2.3-korg