summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2021-08-20 15:40:35 +0100
committerAndr� Schmid <andre.schmid@est.tech>2021-08-27 10:33:32 +0000
commita5e32b3d20bc078482cb08645c38ffb685c0f145 (patch)
tree133fe88578f3a3c3db3ec73315b65f45caba625a /catalog-ui/src
parent4701612ba26c4b8c7c7e9fbfa38f582a4b74669f (diff)
Support querying of model by type
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-3678 Change-Id: I5fd19eefe475113df501901628b2ee8669004399
Diffstat (limited to 'catalog-ui/src')
-rw-r--r--catalog-ui/src/app/ng2/pages/composition/palette/services/palette.service.ts3
-rw-r--r--catalog-ui/src/app/ng2/services/model.service.ts4
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts12
3 files changed, 16 insertions, 3 deletions
diff --git a/catalog-ui/src/app/ng2/pages/composition/palette/services/palette.service.ts b/catalog-ui/src/app/ng2/pages/composition/palette/services/palette.service.ts
index ed61dce192..d5528c5197 100644
--- a/catalog-ui/src/app/ng2/pages/composition/palette/services/palette.service.ts
+++ b/catalog-ui/src/app/ng2/pages/composition/palette/services/palette.service.ts
@@ -32,6 +32,9 @@ export class CompositionPaletteService {
let model = this.workspaceService.metadata.model
if (model) {
params = params.append('componentModel', model);
+ if (this.workspaceService.getMetadataType() === 'SERVICE'){
+ params = params.append('includeNormativeExtensionModels', 'true');
+ }
}
const loadInstances = this.http.get(this.facadeUrl, {params});
const loadGroups = this.http.get(this.baseUrl + 'groupTypes', {params});
diff --git a/catalog-ui/src/app/ng2/services/model.service.ts b/catalog-ui/src/app/ng2/services/model.service.ts
index 10ad4142de..83e16b12c7 100644
--- a/catalog-ui/src/app/ng2/services/model.service.ts
+++ b/catalog-ui/src/app/ng2/services/model.service.ts
@@ -35,4 +35,8 @@ export class ModelService {
return this.http.get<Model[]>(this.baseUrl + "/v1/catalog/model");
}
+ getModelsOfType(type: string):Observable<Model[]> {
+ return this.http.get<Model[]>(this.baseUrl + "/v1/catalog/model?modelType=" + type);
+ }
+
}
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 c319b806c0..dd1fa464bf 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
@@ -485,9 +485,15 @@ export class GeneralViewModel {
return;
}
- this.modelService.getModels().subscribe((modelsFound: Model[]) => {
- modelsFound.forEach(model => {this.$scope.models.push({id: model.name, name: model.name})});
- });
+ if (!this.$scope.isCreateMode() && this.$scope.isVspImport()){
+ this.modelService.getModels().subscribe((modelsFound: Model[]) => {
+ modelsFound.forEach(model => {this.$scope.models.push({id: model.name, name: model.name})});
+ });
+ } else {
+ this.modelService.getModelsOfType("normative").subscribe((modelsFound: Model[]) => {
+ modelsFound.forEach(model => {this.$scope.models.push({id: model.name, name: model.name})});
+ });
+ }
this.$scope.models.sort(function (model1, model2) {
if (model1.id > model2.id) {