From dc16c9e10b9f7f403761fe5f767cf48c2f39d73b Mon Sep 17 00:00:00 2001 From: ShaabanEltanany Date: Mon, 7 Sep 2020 12:00:44 +0200 Subject: adding manual enrichment Issue-ID: CCSDK-2542 Signed-off-by: ShaabanEltanany Change-Id: I14eac56b1541a54b7b3e6d3e2c4e34dc667f0c8c --- .../packages/package-creation/package-creation.service.ts | 11 +++++++++++ .../packages/package-creation/package-creation.store.ts | 4 ++++ 2 files changed, 15 insertions(+) (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts index 952fea3ca..e7ccbb39a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.service.ts @@ -45,6 +45,10 @@ export class PackageCreationService { return this.api.post(BlueprintURLs.enrich, body, {responseType: 'text'}); } + private deployBluePrint(body: any | null, options?: any): Observable { + return this.api.post(BlueprintURLs.deploy, body, {responseType: 'text'}); + } + async checkBluePrintNameAndVersion(name: string, version: string): Promise { return await this.packagesListService.checkBluePrintIfItExists(name, version) .then(bluePrintModelsResult => bluePrintModelsResult != null && bluePrintModelsResult.length > 0); @@ -64,6 +68,11 @@ export class PackageCreationService { return this.enrichBlueprint(formData); } + deploy(blob) { + const formData = this.getFormData(blob); + return this.deployBluePrint(formData); + } + private getFormData(blob) { const formData = new FormData(); formData.append('file', blob); @@ -73,4 +82,6 @@ export class PackageCreationService { getTemplateAndMapping(variables: string[]): Observable { return this.api.post(ResourceDictionaryURLs.searchResourceDictionaryByNames, variables); } + + } diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts index f64e361d4..b60831238 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/package-creation.store.ts @@ -106,6 +106,10 @@ export class PackageCreationStore extends Store { return this.packageCreationService.enrichPackage(blob); } + deployBluePrint(blob): Observable { + return this.packageCreationService.deploy(blob); + } + addTemplate(filePath: string, fileContent: string) { this.setState({ ...this.state, -- cgit 1.2.3-korg