From 5ede965c0c3dd365be4efde0699d5ec976a614c3 Mon Sep 17 00:00:00 2001 From: Ezhilarasi Date: Mon, 29 Jul 2019 20:07:04 +0530 Subject: Blueprint client backend integration fix Blueprint backend data integration fix Change-Id: If0e0b2c30bf07f06fc728ff26c509f265c5ee303 Issue-ID: CCSDK-1275 Signed-off-by: Ezhilarasi --- .../modify-template/editor/editor.component.ts | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts') diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts index 0a3a8d2ef..7b2eaeb17 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts +++ b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts @@ -35,7 +35,7 @@ import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; import { IBlueprintState } from 'src/app/common/core/store/models/blueprintState.model'; import { LoadBlueprintSuccess, SetBlueprintState } from '../../../../common/core/store/actions/blueprint.action' -import { ApiService } from 'src/app/common/core/services/api.service'; + import { IMetaData } from 'src/app/common/core/store/models/metadata.model'; import { EditorService } from './editor.service'; import { SortPipe } from '../../../../common/shared/pipes/sort.pipe'; @@ -130,7 +130,7 @@ export class EditorComponent implements OnInit { artifactName: any; artifactVersion: any; - constructor(private store: Store, private apiservice: EditorService, + constructor(private store: Store, private editorService: EditorService, private alertService: NotificationHandlerService, private loader: LoaderService ) { @@ -244,7 +244,8 @@ export class EditorComponent implements OnInit { .then(blob => { const formData = new FormData(); formData.append("file", blob); - this.apiservice.enrich("/enrich-blueprint/", formData) + // this.editorService.enrich("/enrich-blueprint/", formData) + this.editorService.enrich(formData) .subscribe( (response) => { this.zipFile.files = {}; @@ -271,7 +272,8 @@ export class EditorComponent implements OnInit { .then(blob => { const formData = new FormData(); formData.append("file", blob); - this.apiservice.post("/create-blueprint/", formData) + // this.editorService.saveBlueprint("/create-blueprint/", formData) + this.editorService.saveBlueprint(formData) .subscribe( data => { this.alertService.success('Success:' + JSON.stringify(data)); @@ -289,7 +291,8 @@ export class EditorComponent implements OnInit { .then(blob => { const formData = new FormData(); formData.append("file", blob); - this.apiservice.deployPost("/deploy-blueprint/", formData) + // this.editorService.deployPost("/deploy-blueprint/", formData) + this.editorService.deployPost(formData) .subscribe(data => { this.alertService.success('Saved Successfully:' + JSON.stringify(data)); }, error=>{ @@ -305,7 +308,8 @@ export class EditorComponent implements OnInit { .then(blob => { const formData = new FormData(); formData.append("file", blob); - this.apiservice.post("/publish/", formData) + // this.editorService.post("/publish/", formData) + this.editorService.publishBlueprint(formData) .subscribe(data => { this.alertService.success('Published:' + JSON.stringify(data)) }, error=>{ @@ -326,7 +330,8 @@ export class EditorComponent implements OnInit { download() { console.log(this.artifactName); - status = this.apiservice.downloadCBA("/download-blueprint/" + this.artifactName + "/" + this.artifactVersion); + // status = this.editorService.downloadCBA("/download-blueprint/" + this.artifactName + "/" + this.artifactVersion); + status = this.editorService.downloadCBA("/"+this.artifactName + "/" + this.artifactVersion); window.alert(status); // .subscribe(response => { // console.log(response); @@ -338,14 +343,8 @@ export class EditorComponent implements OnInit { // console.log(error); // } // ); - - // this.create(); - // var zipFilename = "baseconfiguration.zip"; - // this.zipFile.generateAsync({ type: "blob" }) - // .then(blob => { - // saveAs(blob, zipFilename); - // }); } + setEditorMode() { switch (this.fileExtension) { case "xml": -- cgit 1.2.3-korg