aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
diff options
context:
space:
mode:
authorAhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>2020-06-22 18:07:52 +0200
committerAhmedEldeeb50 <ahmed.eldeeb.ext@orange.com>2020-06-22 18:07:52 +0200
commit366fe0541cd76e93276d20e84db315c591c3cae7 (patch)
treed34a90ed0a3b6aa22a9f843b3f9367e0b36e024f /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
parent214c8dfe0e56aff0fe0c2a3a5d7f76f2a4972710 (diff)
add delete button in template&mapping view
Issue-ID: CCSDK-2448 Signed-off-by: AhmedEldeeb50 <ahmed.eldeeb.ext@orange.com> Change-Id: I73691bc19ca4cf330896fe1cf327e3867ab4e1b4
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts')
-rw-r--r--cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
index 334b3f484..f6bae0600 100644
--- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
+++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
@@ -47,6 +47,7 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
currentTemplate: any;
currentMapping: any;
edit = false;
+ fileToDelete: any = {};
constructor(
private packageCreationStore: PackageCreationStore,
@@ -63,6 +64,7 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
console.log('Oninit');
console.log(templateInfo);
this.templateInfo = templateInfo;
+ this.fileToDelete = templateInfo.fileName;
this.fileName = templateInfo.fileName.split('/')[1];
if (this.fileName) {
this.fileName = this.fileName.split('-')[0];
@@ -177,6 +179,22 @@ export class TemplMappCreationComponent implements OnInit, OnDestroy {
this.uploadedFiles.splice(index, 1);
}
+ initDelete(file) {
+ }
+ confirmDelete() {
+ // Delete from templates
+ this.sharedService.deleteFromList(this.fileName);
+ this.packageCreationStore.state.templates.files.delete(this.fileToDelete);
+ // Delete from Mapping
+ this.packageCreationStore.state.mapping.files.delete(this.fileToDelete);
+ if (
+ this.packageCreationStore.state.templates.files.size > 0 ||
+ this.packageCreationStore.state.mapping.files.size > 0
+ ) {
+ this.closeCreationForm();
+ }
+
+ }
uploadFile() {
this.dependancies.clear();
this.dependanciesSource.clear();