diff options
author | vasraz <vasyl.razinkov@est.tech> | 2022-11-15 19:31:40 +0000 |
---|---|---|
committer | Andr� Schmid <andre.schmid@est.tech> | 2022-11-17 17:11:02 +0000 |
commit | 525c89bec6979bbd827d9683a970896b42e56097 (patch) | |
tree | 1898200a65ae9bea4f556990dd183f2b5e04e99f /catalog-ui | |
parent | c991c07fbb15e73e4149cde734a7e6786cb71b93 (diff) |
Fix wrong Model during import VSP
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: I0cea47f26f5fe3e38b54c94e05dec8649ad58159
Issue-ID: SDC-4268
Diffstat (limited to 'catalog-ui')
-rw-r--r-- | catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts | 11 |
1 files changed, 7 insertions, 4 deletions
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) + }); }); } }; |