diff options
Diffstat (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping')
2 files changed, 13 insertions, 2 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.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html index de97a4679..6dc120728 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-creation/templ-mapp-creation.component.html @@ -146,7 +146,8 @@ <span>({{resourceDictionaryRes.length}} attributes in total)</span> </div> </div> - <table datatable [dtOptions]="initDtOptions" [dtTrigger]="dtTrigger" class="row-border hover"> + <table datatable id="init-table" [dtOptions]="initDtOptions" [dtTrigger]="dtTrigger" + class="row-border hover"> <thead> <tr> <th></th> @@ -230,7 +231,8 @@ <button [disabled]="selectedProps.size <=0" type="button" class="btn" (click)="removeProps()" tooltip="Remove" placement="bottom"><i class="icon-delete-sm"></i></button> </div> --> - <table datatable [dtOptions]="dtOptions" [dtTrigger]="resTableDtTrigger" class="row-border hover"> + <table datatable id="res-table" [dtOptions]="dtOptions" [dtTrigger]="resTableDtTrigger" + class="row-border hover"> <thead> <tr> <!-- <th></th> --> diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts index 3a05bcfc5..591553cea 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/package-creation/template-mapping/templ-mapp-listing/templ-mapp-listing.component.ts @@ -174,6 +174,7 @@ export class TemplMappListingComponent implements OnInit, OnDestroy { initDelete(file) { console.log(file); const templateKey = 'Templates/' + file + '-template'; + const mappingKey = 'Templates/' + file + '-mapping.json'; // tslint:disable-next-line: forin for (const templateType in TemplateType) { const fileName = templateKey + '.' + TemplateType[templateType]; @@ -182,11 +183,19 @@ export class TemplMappListingComponent implements OnInit, OnDestroy { break; } } + if (this.fileToDelete.length <= 0) { + // tslint:disable-next-line: forin + if (this.packageCreationStore.state.mapping.files.has(mappingKey)) { + this.fileToDelete = mappingKey; + } + + } } condifrmDelete() { const fullName = this.fileToDelete.split('/')[1]; + console.log(this.fileToDelete + ' -- ' + fullName); const file = fullName.substr(0, fullName.lastIndexOf('-')); const ext = fullName.substr(fullName.lastIndexOf('.') + 1); this.templateAndMappingMap.delete(file); |