aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui
diff options
context:
space:
mode:
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>2021-09-20 13:04:29 +0100
committerMichael Morris <michael.morris@est.tech>2021-10-05 13:32:20 +0000
commit32312ca12dc40f724d248104c16df5e46a4bc5cc (patch)
treebfaa735ec1c6e9ffa1bdfdaabaddd5f56e11391f /catalog-ui
parentaae70f4bfb7126a6fc562604bf48fcd01d6d7af8 (diff)
Fix child model being shown in UI
Issue-ID: SDC-3734 Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech> Change-Id: Iadbbf93dc2a84a14df6b73a191d4c6d3e657f4d1
Diffstat (limited to 'catalog-ui')
-rw-r--r--catalog-ui/src/app/models/model.ts6
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts12
2 files changed, 16 insertions, 2 deletions
diff --git a/catalog-ui/src/app/models/model.ts b/catalog-ui/src/app/models/model.ts
index a5e6021284..0f7cab598a 100644
--- a/catalog-ui/src/app/models/model.ts
+++ b/catalog-ui/src/app/models/model.ts
@@ -19,10 +19,14 @@
export class Model {
name: string;
+ derivedFrom: string;
+ modelType: string;
constructor(param?: any) {
if (param) {
- this.name = param;
+ this.name = param.name;
+ this.derivedFrom = param.derivedFrom;
+ this.modelType = param.modelType;
}
}
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 1bcf266c55..6c28fae508 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
@@ -489,7 +489,17 @@ export class GeneralViewModel {
if (!this.$scope.isCreateMode() && this.$scope.isVspImport()){
this.modelService.getModels().subscribe((modelsFound: Model[]) => {
- modelsFound.sort().forEach(model => {this.$scope.models.push(model.name)});
+ modelsFound.sort().forEach(model => {
+ if (this.$scope.component.model != undefined) {
+ if (model.modelType == "NORMATIVE_EXTENSION") {
+ this.$scope.component.model = model.derivedFrom;
+ this.$scope.models.push(model.derivedFrom)
+ } else {
+ this.$scope.component.model = model.name;
+ this.$scope.models.push(model.name)
+ }
+ }
+ });
});
} else {
this.modelService.getModelsOfType("normative").subscribe((modelsFound: Model[]) => {