summaryrefslogtreecommitdiffstats
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:
authorKAPIL SINGAL <ks220y@att.com>2020-06-22 18:14:26 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-22 18:14:26 +0000
commitee2c950e05901c92fd45a24898b7e8bb2418bc77 (patch)
tree637217328844c78a56781136dd87f97f542370cb /cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.ts
parent201684fa7d04804d5d833d0876c6eb79f44232e1 (diff)
parent366fe0541cd76e93276d20e84db315c591c3cae7 (diff)
Merge "add delete button in template&mapping view"
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();