RED-5976: Disabled download button for invalid downloads.
This commit is contained in:
parent
af51e73959
commit
d969de27ad
@ -49,7 +49,7 @@
|
||||
<div class="dialog-actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[disabled]="form.invalid"
|
||||
[disabled]="form.invalid || invalidDownload"
|
||||
[label]="'download-dialog.actions.save' | translate"
|
||||
[submit]="true"
|
||||
[type]="iconButtonTypes.primary"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { Dossier, DownloadFileType, IReportTemplate } from '@red/domain';
|
||||
import { Dossier, DownloadFileType, DownloadFileTypes, IReportTemplate } from '@red/domain';
|
||||
import { downloadTypesForDownloadTranslations } from '@translations/download-types-translations';
|
||||
import { ReportTemplateService } from '@services/report-template.service';
|
||||
import { AbstractControl, FormBuilder } from '@angular/forms';
|
||||
@ -72,6 +72,13 @@ export class DownloadDialogComponent {
|
||||
this._dialogRef.close();
|
||||
}
|
||||
|
||||
get invalidDownload() {
|
||||
return (
|
||||
this.form.controls.downloadFileTypes.value.every(type => type === DownloadFileTypes.REDACTED) &&
|
||||
this.data.hasUnapprovedDocuments
|
||||
);
|
||||
}
|
||||
|
||||
private _hasReportTemplateOrDownloadType(control: AbstractControl) {
|
||||
const atLeastAReportSelected = control.get('reportTemplateIds')?.value.length > 0;
|
||||
const atLeastATypeSelected = control.get('downloadFileTypes')?.value.length > 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user