From 974764bdb65a7313c546b65c67d49df1de4ea1e1 Mon Sep 17 00:00:00 2001 From: shikha0203 Date: Fri, 14 Apr 2023 12:53:16 +0100 Subject: [PATCH] sort data type drop down lists in add property Issue-ID: SDC-4474 Signed-off-by: shikha0203 Change-Id: Iaf6c197b7a80bdf1d133858c3f814e7297a832bc --- .../component-property-form/property-form-view-model.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 dc9c82d8aa..4b41e7ab25 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 @@ -291,6 +291,7 @@ export class PropertyFormViewModel { hasGetFunctionValue: property.isToscaFunction(), isGetFunctionValid: true, }; + this.$scope.editPropertyModel.types.sort((a,b) => a.localeCompare(b)); this.$scope.isPropertyValueOwner = this.isPropertyValueOwner; this.$scope.propertyOwnerType = this.propertyOwnerType; this.$scope.modelNameFilter = this.workspaceService.metadata.model; @@ -317,11 +318,10 @@ export class PropertyFormViewModel { this.DataTypesService.fetchDataTypesByModel(this.workspaceService.metadata.model).then(response => { this.$scope.dataTypes = response.data as DataTypesMap; - - this.$scope.nonPrimitiveTypes = _.filter(Object.keys(this.$scope.dataTypes), (type:string)=> { - return this.$scope.editPropertyModel.types.indexOf(type) == -1; - }); - this.$scope.isLoading = false; + this.$scope.nonPrimitiveTypes = _.filter(Object.keys(this.$scope.dataTypes), (type: string) => { + return this.$scope.editPropertyModel.types.indexOf(type) == -1 ; + }).sort((a, b) => a.localeCompare(b)); + this.$scope.isLoading = false; }); //scope methods -- 2.16.6