From 525c89bec6979bbd827d9683a970896b42e56097 Mon Sep 17 00:00:00 2001 From: vasraz Date: Tue, 15 Nov 2022 19:31:40 +0000 Subject: Fix wrong Model during import VSP Signed-off-by: Vasyl Razinkov Change-Id: I0cea47f26f5fe3e38b54c94e05dec8649ad58159 Issue-ID: SDC-4268 --- .../view-models/workspace/tabs/general/general-view-model.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'catalog-ui/src') 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 2d029cd332..a1acfc73fa 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 @@ -536,15 +536,16 @@ export class GeneralViewModel { return; } - if (!this.$scope.isCreateMode() && this.$scope.isVspImport()){ + if (!this.$scope.isCreateMode() && this.$scope.isVspImport()) { this.modelService.getModels().subscribe((modelsFound: Model[]) => { modelsFound.sort().forEach(model => { if (this.$scope.component.model != undefined) { if (model.modelType == "NORMATIVE_EXTENSION") { - this.$scope.component.model = model.derivedFrom; + if (this.$scope.component.model === model.name) { + 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) } } @@ -552,7 +553,9 @@ export class GeneralViewModel { }); } else { this.modelService.getModelsOfType("normative").subscribe((modelsFound: Model[]) => { - modelsFound.sort().forEach(model => {this.$scope.models.push(model.name)}); + modelsFound.sort().forEach(model => { + this.$scope.models.push(model.name) + }); }); } }; -- cgit 1.2.3-korg