diff options
author | 2019-04-21 16:07:44 +0300 | |
---|---|---|
committer | 2019-04-22 12:07:46 +0000 | |
commit | c21ba95e56f70ba9fbe0daa3ac4b413424b323eb (patch) | |
tree | 5158a77b0cc7d42c0c3f91ddf64473995494db6c /catalog-ui/src/app/ng2/services/component-services/component.service.ts | |
parent | caa3ce9b5538a7ff2e72ae4f1afe3e903ae09c8a (diff) |
bug fixes to operation screen and External workflowartifact completion
Change-Id: I9d71385d6e29e1736a24f9d84581e465187e9f26
Issue-ID: SDC-2249
Signed-off-by: Arielk <Ariel.Kenan@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/services/component-services/component.service.ts')
-rw-r--r-- | catalog-ui/src/app/ng2/services/component-services/component.service.ts | 24 |
1 files changed, 23 insertions, 1 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 fd746516b7..e0884d714f 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 @@ -23,7 +23,7 @@ import {Injectable, Inject} from '@angular/core'; import {Observable} from 'rxjs/Observable'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/toPromise'; -import {Response, URLSearchParams} from '@angular/http'; +import {Response, URLSearchParams, Headers} from '@angular/http'; import { Component, ComponentInstance, InputBEModel, InstancePropertiesAPIMap, FilterPropertiesAssignmentData, PropertyBEModel, OperationModel, BEOperationModel, Capability, Requirement, PolicyInstance} from "app/models"; import {COMPONENT_FIELDS, CommonUtils, SERVICE_FIELDS} from "app/utils"; @@ -207,6 +207,28 @@ export class ComponentServiceNg2 { }); } + uploadInterfaceOperationArtifact(component:Component, response:OperationModel, UIOperation:OperationModel) { + const payload = { + artifactType: "WORKFLOW", + artifactName: UIOperation.artifactFile.name, + description: "Workflow Artifact Description", + payloadData: UIOperation.artifactData + }; + + const headers = new Headers(); + JSON.stringify(payload); + const payloadString = JSON.stringify(payload, null, ' '); + const md5Result = md5(payloadString).toLowerCase(); + headers.append('Content-MD5', btoa(md5Result)); + + return this.http.post(this.baseUrl + component.getTypeUrl() + component.uuid + '/interfaces/' + response.interfaceId + '/operations/' + response.uniqueId + '/artifacts/' + response.implementation.artifactUUID, + payload, + {headers} + ).map((res: Response) => { + return res.json(); + }); + } + getCapabilitiesAndRequirements(componentType: string, componentId:string):Observable<ComponentGenericResponse> { return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_REQUIREMENTS, COMPONENT_FIELDS.COMPONENT_CAPABILITIES]); } |