aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui')
-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();
+ }
}