summaryrefslogtreecommitdiffstats
path: root/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts
diff options
context:
space:
mode:
authorEzhilarasi <ezhrajam@in.ibm.com>2019-07-29 20:07:04 +0530
committerEzhilarasi <ezhrajam@in.ibm.com>2019-07-29 20:07:15 +0530
commit5ede965c0c3dd365be4efde0699d5ec976a614c3 (patch)
treeb8a48141bce079926c85c9195839db69d4446f75 /cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts
parent14588a767139e4a66303252739ce80ee9e81ea99 (diff)
Blueprint client backend integration fix
Blueprint backend data integration fix Change-Id: If0e0b2c30bf07f06fc728ff26c509f265c5ee303 Issue-ID: CCSDK-1275 Signed-off-by: Ezhilarasi <ezhrajam@in.ibm.com>
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts')
-rw-r--r--cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts23
1 files changed, 13 insertions, 10 deletions
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts
index ec2524422..025fc95d4 100644
--- a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts
+++ b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.service.ts
@@ -25,19 +25,18 @@ import { HttpClient } from '@angular/common/http';
import { Observable, observable } from 'rxjs';
import { ApiService } from '../../../../common/core/services/api.service';
import { saveAs } from 'file-saver';
+import { BlueprintURLs } from '../../../../common/constants/app-constants';
@Injectable()
export class EditorService {
- // blueprintUrl = '../../constants/blueprint.json';
-
constructor(private _http: HttpClient, private api: ApiService) {
}
- enrich(uri: string, body: FormData): Observable<any> {
- return this.api.post(uri, body, { responseType: 'blob' });
+ enrich(body: FormData): Observable<any> {
+ return this.api.post(BlueprintURLs.enrich, body, { responseType: 'blob' });
}
- downloadCBA(uri: string): string {
- this.api.get(uri, { responseType: 'blob' })
+ downloadCBA(artifactDetails: string): string {
+ this.api.get(BlueprintURLs.download+artifactDetails, { responseType: 'blob' })
.subscribe(response => {
let blob = new Blob([response], { 'type': "application/octet-stream" });
saveAs(blob, "CBA.zip");
@@ -46,13 +45,17 @@ export class EditorService {
return "Download Success";
}
- post(uri: string, body: any | null, options?: any): Observable<any> {
+ saveBlueprint(body: any | null, options?: any): Observable<any> {
+
+ return this.api.post(BlueprintURLs.save, body, options);
+ }
+ publishBlueprint(body: any | null, options?: any): Observable<any> {
- return this.api.post(uri, body, options);
+ return this.api.post(BlueprintURLs.publish, body, options);
}
- deployPost(uri: string, body: any | null, options?: any): Observable<any> {
+ deployPost(body: any | null, options?: any): Observable<any> {
- return this.api.post(uri, body, { responseType: 'text' });
+ return this.api.post(BlueprintURLs.deploy, body, { responseType: 'text' });
}
} \ No newline at end of file