summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/services
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/ng2/services')
-rw-r--r--catalog-ui/src/app/ng2/services/component-services/component.service.ts18
-rw-r--r--catalog-ui/src/app/ng2/services/workflow.service.ts23
2 files changed, 16 insertions, 25 deletions
diff --git a/catalog-ui/src/app/ng2/services/component-services/component.service.ts b/catalog-ui/src/app/ng2/services/component-services/component.service.ts
index 3546ebd374..26b0291156 100644
--- a/catalog-ui/src/app/ng2/services/component-services/component.service.ts
+++ b/catalog-ui/src/app/ng2/services/component-services/component.service.ts
@@ -128,9 +128,7 @@ export class ComponentServiceNg2 {
getInterfaceOperation(component:Component, operation:OperationModel):Observable<OperationModel> {
return this.http.get(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations/' + operation.uniqueId)
- .map((res:Response) => {
- return res.json();
- });
+ .map((res:Response) => res.json());
}
createInterfaceOperation(component:Component, operation:OperationModel):Observable<CreateOperationResponse> {
@@ -140,9 +138,7 @@ export class ComponentServiceNg2 {
}
};
return this.http.post(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
- .map((res:Response) => {
- return res.json();
- });
+ .map((res:Response) => res.json());
}
updateInterfaceOperation(component:Component, operation:OperationModel):Observable<CreateOperationResponse> {
@@ -152,16 +148,12 @@ export class ComponentServiceNg2 {
}
};
return this.http.put(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
- .map((res:Response) => {
- return res.json();
- });
+ .map((res:Response) => res.json());
}
deleteInterfaceOperation(component:Component, operation:OperationModel):Observable<OperationModel> {
return this.http.delete(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations/' + operation.uniqueId)
- .map((res:Response) => {
- return res.json();
- });
+ .map((res:Response) => res.json());
}
getCapabilitiesAndRequirements(componentType: string, componentId:string):Observable<ComponentGenericResponse> {
@@ -189,7 +181,6 @@ export class ComponentServiceNg2 {
deleteInput(component:Component, input:InputBEModel):Observable<InputBEModel> {
-
return this.http.delete(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/delete/' + input.uniqueId + '/input')
.map((res:Response) => {
return new InputBEModel(res.json());
@@ -197,7 +188,6 @@ export class ComponentServiceNg2 {
}
updateComponentInputs(component:Component, inputs:InputBEModel[]):Observable<InputBEModel[]> {
-
return this.http.post(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/update/inputs', inputs)
.map((res:Response) => {
return res.json().map((input) => new InputBEModel(input));
diff --git a/catalog-ui/src/app/ng2/services/workflow.service.ts b/catalog-ui/src/app/ng2/services/workflow.service.ts
index ae06a39713..24ba882a96 100644
--- a/catalog-ui/src/app/ng2/services/workflow.service.ts
+++ b/catalog-ui/src/app/ng2/services/workflow.service.ts
@@ -3,6 +3,7 @@ import { Response } from "@angular/http";
import { Observable } from "rxjs/Observable";
import { HttpService } from "./http.service";
import { SdcConfigToken, ISdcConfig } from "../config/sdc-config.config";
+import { Component } from "app/models";
@Injectable()
export class WorkflowServiceNg2 {
@@ -12,11 +13,21 @@ export class WorkflowServiceNg2 {
VERSION_STATE_CERTIFIED = 'CERTIFIED';
- constructor(private http: HttpService, @Inject(SdcConfigToken) sdcConfig:ISdcConfig) {
+ constructor(private http: HttpService, @Inject(SdcConfigToken) sdcConfig: ISdcConfig) {
this.baseUrl = sdcConfig.api.workflow_root;
this.catalogBaseUrl = sdcConfig.api.POST_workflow_artifact;
}
+ public associateWorkflowArtifact(component: Component, operationId: string, workflowId: string, workflowVersionId: string, artifactUuid: string): Observable<any> {
+ return this.http.post(this.baseUrl + '/workflows/' + workflowId + '/versions/' + workflowVersionId + '/artifact-deliveries', {
+ endpoint: this.catalogBaseUrl + '/' + component.getTypeUrl() + component.uuid + '/interfaces/' + operationId + '/artifacts/' + artifactUuid,
+ method: 'POST'
+ })
+ .map((res:Response) => {
+ return res.json();
+ });
+ }
+
public getWorkflows(filterCertified: boolean = true): Observable<any> {
return this.http.get(this.baseUrl + '/workflows' + (filterCertified ? '?versionState=' + this.VERSION_STATE_CERTIFIED : ''))
.map((res:Response) => {
@@ -38,14 +49,4 @@ export class WorkflowServiceNg2 {
});
}
- public associateWorkflowArtifact(resourceUuid, operationId, workflowId, workflowVersionId, artifactUuid): Observable<any> {
- return this.http.post(this.baseUrl + '/workflows/' + workflowId + '/versions/' + workflowVersionId + '/artifact-deliveries', {
- endpoint: this.catalogBaseUrl + '/resources/' + resourceUuid + '/interfaces/' + operationId + '/artifacts/' + artifactUuid,
- method: 'POST'
- })
- .map((res:Response) => {
- return res.json();
- });
- }
-
}