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 | |
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
-rw-r--r-- | catalog-model/src/main/java/org/openecomp/sdc/be/model/Component.java | 1 | ||||
-rw-r--r-- | catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/Component.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/Component.java index 3252d79281..0e9c44a382 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/Component.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/Component.java @@ -90,7 +90,6 @@ public abstract class Component implements PropertiesOwner { private Map<String, InterfaceDefinition> interfaces; private List<DataTypeDefinition> dataTypes; private SubstitutionFilterDataDefinition substitutionFilter; - private String model; protected Component(ComponentMetadataDefinition componentMetadataDefinition) { this.componentMetadataDefinition = componentMetadataDefinition; 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) + }); }); } }; |