summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
diff options
context:
space:
mode:
authorAhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>2020-06-28 15:29:33 +0200
committerAhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>2020-06-28 15:29:33 +0200
commit34862b8ae117126e055f3cb71b464e448d2c5827 (patch)
tree7caf9ca723f5f2b634891aa206199dd0f7b2078d /cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts
parent83221b2423060db32826065938edeebb5680b30f (diff)
Add package deletion button
Issue-ID: CCSDK-2483 Signed-off-by: AhmedEldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: I7e1c0f80eb9e6073a1eb472bd6f042e8545c5ab7
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/configuration-dashboard/configuration-dashboard.component.ts21
1 files changed, 16 insertions, 5 deletions
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 0ff8d952f..0e1d4cd11 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
@@ -36,6 +36,7 @@ export class ConfigurationDashboardComponent implements OnInit {
zipFile: JSZip = new JSZip();
filesData: any = [];
folder: FolderNodeElement = new FolderNodeElement();
+ id: any;
currentBlob = new Blob();
@@ -46,15 +47,14 @@ export class ConfigurationDashboardComponent implements OnInit {
private packageCreationUtils: PackageCreationUtils,
private router: Router,
private designerStore: DesignerStore,
- private designerService: DesignerService,
private toastService: ToastrService
) {
}
ngOnInit() {
this.elementRef.nativeElement.focus();
- const id = this.route.snapshot.paramMap.get('id');
- this.configurationDashboardService.getPagedPackages(id).subscribe(
+ this.id = this.route.snapshot.paramMap.get('id');
+ this.configurationDashboardService.getPagedPackages(this.id).subscribe(
(bluePrintDetailModels) => {
if (bluePrintDetailModels) {
this.viewedPackage = bluePrintDetailModels[0];
@@ -62,8 +62,11 @@ export class ConfigurationDashboardComponent implements OnInit {
this.packageCreationStore.clear();
}
});
- }
+ if (this.route.snapshot.paramMap.has('id')) {
+ console.log('The id is equal to ' + this.route.snapshot.paramMap.get('id'));
+ }
+ }
private downloadCBAPackage(bluePrintDetailModels: BluePrintDetailModel) {
this.configurationDashboardService.downloadResource(
@@ -185,7 +188,15 @@ export class ConfigurationDashboardComponent implements OnInit {
});
}
-
+ deletePackage() {
+ this.configurationDashboardService.deletePackage(this.id).subscribe(res => {
+ console.log('Deleted');
+ console.log(res);
+ this.router.navigate(['/packages']);
+ }, err => {
+ console.log(err);
+ });
+ }
create() {
this.zipFile = new JSZip();
FilesContent.getMapOfFilesNamesAndContent().forEach((value, key) => {