From: shikha0203 Date: Fri, 14 Apr 2023 11:53:16 +0000 (+0100) Subject: sort data type drop down lists in add property X-Git-Tag: 1.13.0~45 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=974764bdb65a7313c546b65c67d49df1de4ea1e1;hp=b6c9ed78e512e2d96f1725ca3748a5f02b31e7df;p=sdc.git sort data type drop down lists in add property Issue-ID: SDC-4474 Signed-off-by: shikha0203 Change-Id: Iaf6c197b7a80bdf1d133858c3f814e7297a832bc --- 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