diff options
author | siddharth0905 <siddharth.singh4@amdocs.com> | 2018-11-22 13:37:31 +0530 |
---|---|---|
committer | siddharth0905 <siddharth.singh4@amdocs.com> | 2018-11-23 12:48:21 +0530 |
commit | b734ea21ac7be393c59cf9976f0e5ddeaf27d568 (patch) | |
tree | dde5d205c378ac748bcecdf7f17f5a41567156fe /catalog-ui/src/app/ng2/services | |
parent | abbd5cf62a0bdd6a22b9bea0cf589e42da0be229 (diff) |
Service Workflow changes
Service workflow change with few bug fixes
Change-Id: Ice2376565bf46fb8d86fb6062654ec54bb2daa43
Issue-ID: SDC-1937
Signed-off-by: siddharth0905 <siddharth.singh4@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/services')
-rw-r--r-- | catalog-ui/src/app/ng2/services/component-services/component.service.ts | 18 | ||||
-rw-r--r-- | catalog-ui/src/app/ng2/services/workflow.service.ts | 23 |
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(); - }); - } - } |