From a68a19fcb0b1c9f7d0a91338e08b1854c99cf1c7 Mon Sep 17 00:00:00 2001 From: ShaabanEltanany Date: Sun, 21 Jun 2020 21:48:49 +0200 Subject: solving continuous saving Issue-ID: CCSDK-2336 Signed-off-by: ShaabanEltanany Change-Id: I7e488950a77a19b7b1b4ac2e4c9044698b9ff757 --- .../configuration-dashboard.component.html | 6 +++--- .../configuration-dashboard.component.ts | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html index ebfad93c3..bf6bf1251 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.html @@ -22,8 +22,8 @@
- - + + Save @@ -62,7 +62,7 @@
{{viewedPackage.artifactName}} - v1.0.2 + v{{viewedPackage.artifactVersion}}
Last modified {{ viewedPackage.createdDate | date:'short' }} By diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts index 4a92943e3..e1e33a39a 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts @@ -14,6 +14,7 @@ import {PackageCreationBuilder} from '../package-creation/creationModes/PackageC import {saveAs} from 'file-saver'; import {DesignerStore} from '../designer/designer.store'; import {DesignerService} from '../designer/designer.service'; +import {ToastrService} from 'ngx-toastr'; @Component({ selector: 'app-configuration-dashboard', @@ -42,7 +43,9 @@ export class ConfigurationDashboardComponent implements OnInit { private packageCreationUtils: PackageCreationUtils, private router: Router, private designerStore: DesignerStore, - private designerService: DesignerService) { + private designerService: DesignerService, + private toastService: ToastrService + ) { } ngOnInit() { @@ -164,8 +167,17 @@ export class ConfigurationDashboardComponent implements OnInit { this.create(); this.zipFile.generateAsync({type: 'blob'}) .then(blob => { - this.packageCreationStore.saveBluePrint(blob); - this.router.navigate(['/packages']); + this.packageCreationStore.saveBluePrint(blob).subscribe( + bluePrintDetailModels => { + if (bluePrintDetailModels) { + const id = bluePrintDetailModels.toString().split('id')[1].split(':')[1].split('"')[1]; + this.toastService.info('package updated successfully '); + this.router.navigate(['/packages/package/' + id]); + } + }, error => { + this.toastService.error('error happened when editing ' + error.message); + console.log('Error -' + error.message); + }); }); } -- cgit 1.2.3-korg