From 86a37526357337a9143c1f5e27c0976e68b15d1d Mon Sep 17 00:00:00 2001 From: Arielk Date: Sun, 13 Jan 2019 18:31:13 +0200 Subject: Interface operation screen enhancements Change-Id: I2b510a4bf27ddf5730ed044cf77aebd955ad5862 Issue-ID: SDC-2044 Signed-off-by: Arielk --- catalog-ui/src/app/ng2/services/workflow.service.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'catalog-ui/src/app/ng2/services/workflow.service.ts') diff --git a/catalog-ui/src/app/ng2/services/workflow.service.ts b/catalog-ui/src/app/ng2/services/workflow.service.ts index 1fc5c7843b..36d56d6fa7 100644 --- a/catalog-ui/src/app/ng2/services/workflow.service.ts +++ b/catalog-ui/src/app/ng2/services/workflow.service.ts @@ -3,7 +3,17 @@ 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"; +import { Component, CreateOperationResponse } from "app/models"; + +interface WorkflowOutputParameter { + name: string, + type: string, + mandatory: boolean +} + +interface WorkflowInputParameter extends WorkflowOutputParameter { + property: string; +} @Injectable() export class WorkflowServiceNg2 { @@ -20,9 +30,9 @@ export class WorkflowServiceNg2 { this.catalogBaseUrl = sdcConfig.api.POST_workflow_artifact; } - public associateWorkflowArtifact(component: Component, operationId: string, workflowId: string, workflowVersionId: string, artifactUuid: string): Observable { - return this.http.post(this.baseUrl + '/workflows/' + workflowId + '/versions/' + workflowVersionId + '/artifact-deliveries', { - endpoint: this.catalogBaseUrl + '/' + component.getTypeUrl() + component.uuid + '/interfaces/' + operationId + '/artifacts/' + artifactUuid, + public associateWorkflowArtifact(component: Component, operation: CreateOperationResponse): Observable { + return this.http.post(this.baseUrl + '/workflows/' + operation.workflowId + '/versions/' + operation.workflowVersionId + '/artifact-deliveries', { + endpoint: this.catalogBaseUrl + '/' + component.getTypeUrl() + component.uuid + '/interfaces/' + operation.interfaceId + '/operations/' + operation.uniqueId + '/artifacts/' + operation.artifactUUID, method: 'POST' }) .map((res:Response) => { @@ -40,7 +50,7 @@ export class WorkflowServiceNg2 { public getWorkflowVersions(workflowId: string, filterCertified: boolean = true): Observable { return this.http.get(this.baseUrl + '/workflows/' + workflowId + '/versions' + (filterCertified ? '?state=' + this.VERSION_STATE_CERTIFIED : '')) .map((res:Response) => { - return res.json().items; + return _.map(res.json().items, version => version); }); } -- cgit 1.2.3-korg