added templates list in dialog
This commit is contained in:
parent
a9994cec8a
commit
1dd11dbe97
@ -18,6 +18,10 @@
|
||||
{{ checkbox.label }}
|
||||
</mat-checkbox>
|
||||
</ng-container>
|
||||
|
||||
<ul class="templates-container flex">
|
||||
<li *ngFor="let template of data.templates" class="small-label">{{ template.fileName }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="dialog-actions">
|
||||
|
||||
@ -15,3 +15,13 @@ mat-checkbox {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.templates-container {
|
||||
padding: 0 45px;
|
||||
margin-top: 0;
|
||||
flex-direction: column;
|
||||
|
||||
li {
|
||||
margin: 5px 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { DossierAttributeConfig, FileAttributeConfig } from '@red/domain';
|
||||
import { DossierAttributeConfig, FileAttributeConfig, IReportTemplate } from '@red/domain';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
@ -13,7 +13,7 @@ interface CheckBox {
|
||||
|
||||
interface DialogData {
|
||||
attribute: FileAttributeConfig | DossierAttributeConfig;
|
||||
count: number;
|
||||
templates: IReportTemplate[];
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -35,10 +35,12 @@ export class ConfirmDeleteAttributeDialogComponent {
|
||||
|
||||
get checkBoxConfig(): CheckBox[] {
|
||||
const checkBoxes = isFileAttributeConfig(this.data.attribute) ? this._fileAttributeCheckboxes : this._dossierAttributeCheckboxes;
|
||||
if (this.data.count !== 0) {
|
||||
if (this.data.templates.length !== 0) {
|
||||
checkBoxes.push({
|
||||
value: false,
|
||||
label: this._translateService.instant('confirm-delete-file-attribute.impacted-report', { count: this.data.count }),
|
||||
label: this._translateService.instant('confirm-delete-file-attribute.impacted-report', {
|
||||
count: this.data.templates.length,
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ export class DossierAttributesListingScreenComponent extends ListingComponent<Do
|
||||
this._reportTemplateService.getTemplatesByPlaceholder(dossierTemplateId, dossierAttribute.placeholder),
|
||||
);
|
||||
|
||||
this._dialogService.openDialog('deleteAttribute', $event, { attribute: dossierAttribute, count: resp.length }, async () => {
|
||||
this._dialogService.openDialog('deleteAttribute', $event, { attribute: dossierAttribute, templates: resp }, async () => {
|
||||
this._loadingService.start();
|
||||
const ids = dossierAttribute ? [dossierAttribute.id] : this.listingService.selected.map(item => item.id);
|
||||
await firstValueFrom(this._dossierAttributesService.delete(ids));
|
||||
|
||||
@ -96,7 +96,7 @@ export class FileAttributesListingScreenComponent extends ListingComponent<FileA
|
||||
this._reportTemplateService.getTemplatesByPlaceholder(dossierTemplateId, fileAttribute.placeholder),
|
||||
);
|
||||
|
||||
this._dialogService.openDialog('deleteAttribute', $event, { attribute: fileAttribute, count: resp.length }, async () => {
|
||||
this._dialogService.openDialog('deleteAttribute', $event, { attribute: fileAttribute, templates: resp }, async () => {
|
||||
this._loadingService.start();
|
||||
if (fileAttribute) {
|
||||
await firstValueFrom(this._fileAttributesService.deleteFileAttributes([fileAttribute.id], dossierTemplateId));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user