summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src
diff options
context:
space:
mode:
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>2021-07-14 14:21:47 +0100
committerMichael Morris <michael.morris@est.tech>2021-07-21 14:13:29 +0000
commit0514ec6635a08cdbaac5d664c3a4f13bcb0cbf51 (patch)
tree8ece729ff236e5011b705c3c79536eb482a44a7c /catalog-ui/src
parenta3da4a7625f75f719a0ef1ffe1c2bef87828d2f3 (diff)
Consider component model when retrieving relationship types
Issue-ID: SDC-3640 Signed-off-by: MichaelMorris <michael.morris@est.tech> Change-Id: Ic06a9085b8aa2f44b8d33d7de12eadf691106131 Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Diffstat (limited to 'catalog-ui/src')
-rw-r--r--catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts2
-rw-r--r--catalog-ui/src/app/ng2/services/tosca-types.service.ts46
2 files changed, 24 insertions, 24 deletions
diff --git a/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts b/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts
index 470aac75a6..f9b98c6b96 100644
--- a/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts
+++ b/catalog-ui/src/app/ng2/pages/workspace/req-and-capabilities/req-and-capabilities.service.ts
@@ -52,7 +52,7 @@ export class ReqAndCapabilitiesService {
if (initInputsFor === 'INPUTS_FOR_REQUIREMENTS') {
if (!this.requirementsListUpdated){
this.relationshipTypesList = [];
- let relationshipTypesResult = await this.toscaTypesServiceNg2.fetchRelationshipTypes();
+ let relationshipTypesResult = await this.toscaTypesServiceNg2.fetchRelationshipTypes(this.workspaceService.metadata.model);
Object.keys(relationshipTypesResult).forEach(key => {this.relationshipTypesList.push(relationshipTypesResult[key])});
this.requirementsListUpdated = true;
}
diff --git a/catalog-ui/src/app/ng2/services/tosca-types.service.ts b/catalog-ui/src/app/ng2/services/tosca-types.service.ts
index 83b833b1ab..2fc2e7a089 100644
--- a/catalog-ui/src/app/ng2/services/tosca-types.service.ts
+++ b/catalog-ui/src/app/ng2/services/tosca-types.service.ts
@@ -14,18 +14,18 @@
* permissions and limitations under the License.
*/
-import { HttpClient } from '@angular/common/http';
-import { Inject, Injectable } from '@angular/core';
-import { Response } from '@angular/http';
+import {HttpClient} from '@angular/common/http';
+import {Inject, Injectable} from '@angular/core';
+import {Response} from '@angular/http';
import {
- CapabilityTypeModel,
- CapabilityTypesMap,
- IComponentsArray,
- NodeTypesMap,
- RelationshipTypesMap
+ CapabilityTypeModel,
+ CapabilityTypesMap,
+ IComponentsArray,
+ NodeTypesMap,
+ RelationshipTypesMap
} from 'app/models';
-import { Observable } from 'rxjs/Observable';
-import { ISdcConfig, SdcConfigToken } from '../config/sdc-config.config';
+import {Observable} from 'rxjs/Observable';
+import {ISdcConfig, SdcConfigToken} from '../config/sdc-config.config';
import 'rxjs/add/operator/toPromise';
declare var angular: angular.IAngularStatic;
@@ -33,22 +33,22 @@ declare var angular: angular.IAngularStatic;
@Injectable()
export class ToscaTypesServiceNg2 {
- protected baseUrl;
+ protected baseUrl;
- constructor(protected http: HttpClient, @Inject(SdcConfigToken) sdcConfig: ISdcConfig) {
- this.baseUrl = sdcConfig.api.root + sdcConfig.api.component_api_root;
- }
+ constructor(protected http: HttpClient, @Inject(SdcConfigToken) sdcConfig: ISdcConfig) {
+ this.baseUrl = sdcConfig.api.root + sdcConfig.api.component_api_root;
+ }
- async fetchRelationshipTypes(): Promise<RelationshipTypesMap> {
- return this.http.get<RelationshipTypesMap>(this.baseUrl + 'relationshipTypes').toPromise();
- }
+ async fetchRelationshipTypes(modelName: string): Promise<RelationshipTypesMap> {
+ return this.http.get<RelationshipTypesMap>(this.baseUrl + 'relationshipTypes', {params: {model: modelName}}).toPromise();
+ }
- async fetchNodeTypes(): Promise<NodeTypesMap> {
- return this.http.get<NodeTypesMap>(this.baseUrl + 'nodeTypes').toPromise();
- }
+ async fetchNodeTypes(): Promise<NodeTypesMap> {
+ return this.http.get<NodeTypesMap>(this.baseUrl + 'nodeTypes').toPromise();
+ }
- async fetchCapabilityTypes(): Promise<CapabilityTypesMap>{
- return this.http.get<CapabilityTypesMap>(this.baseUrl + 'capabilityTypes').toPromise();
- }
+ async fetchCapabilityTypes(): Promise<CapabilityTypesMap> {
+ return this.http.get<CapabilityTypesMap>(this.baseUrl + 'capabilityTypes').toPromise();
+ }
}