diff options
author | stasys10 <stasys.jurgaitis@est.tech> | 2021-11-29 19:52:58 +0000 |
---|---|---|
committer | Andr� Schmid <andre.schmid@est.tech> | 2022-01-27 16:59:25 +0000 |
commit | 9bd18657d2048d3396d15a394b4493b283c47e4d (patch) | |
tree | e4bd0deef57d238fab57621a1b9382d9cbb5c031 /catalog-ui/src/app | |
parent | c2fa1b7e8d43a236219d1f6ad2831de1af296cb4 (diff) |
Add a display name for the category
Issue-ID: SDC-3858
Change-Id: Ic818b3b4bc4f4e91c9da0cdacb40549a3f071c68
Signed-off-by: stasys10 <stasys.jurgaitis@est.tech>
Diffstat (limited to 'catalog-ui/src/app')
3 files changed, 6 insertions, 1 deletions
diff --git a/catalog-ui/src/app/models/category.ts b/catalog-ui/src/app/models/category.ts index 502020a57b..a6445cafdd 100644 --- a/catalog-ui/src/app/models/category.ts +++ b/catalog-ui/src/app/models/category.ts @@ -25,6 +25,7 @@ export interface ICategoryBase { //server properties name:string; + displayName:string; normalizedName:string; uniqueId:string; models:Array<string>; diff --git a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts index a707e563af..043f4dd859 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts +++ b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts @@ -767,6 +767,10 @@ export class GeneralViewModel { } }; + this.$scope.getCategoryDisplayNameOrName = (mainCategory: any): string => { + return mainCategory.displayName ? mainCategory.displayName : mainCategory.name ; + } + this.$scope.onBaseTypeChange = (): void => { if (!this.$scope.component.derivedFromGenericType) { this.$scope.component.derivedFromGenericVersion = undefined; diff --git a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html index bb0cceb173..1fb8d5f10f 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html +++ b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html @@ -119,7 +119,7 @@ <option ng-if="component.isService()" data-ng-repeat="mainCategory in categories | orderBy:['name']" data-ng-selected="component.selectedCategory===mainCategory.name" value="{{mainCategory.name}}" - data-tests-id="{{mainCategory.name}}">{{mainCategory.name}}</option> + data-tests-id="{{mainCategory.name}}">{{getCategoryDisplayNameOrName(mainCategory)}}</option> </select> <div class="input-error" data-ng-show="validateField(editForm.category)"> |