Merge branch 'RED-10509' into 'master'

RED-10509: disabled stopPropagation on documine .

See merge request redactmanager/red-ui!723
This commit is contained in:
Dan Percic 2024-11-25 10:47:12 +01:00
commit 8d60e8d864
3 changed files with 9 additions and 1 deletions

View File

@ -13,6 +13,7 @@
[dossier]="dossier()"
[files]="entitiesService.all$ | async"
[iqserDisableStopPropagation]="shouldDisableStopPropagation()"
[stopMenuImmediatePropagation]="shouldDisableStopPropagation()"
dossierDownload
></redaction-file-download-btn>

View File

@ -1,6 +1,6 @@
@if (dropdownButton()) {
<iqser-circle-button
(click)="$event.stopImmediatePropagation()"
(click)="stopImmediatePropagation($event)"
[matMenuTriggerFor]="downloadMenu"
[tooltipClass]="tooltipClass()"
[tooltipPosition]="tooltipPosition()"

View File

@ -28,6 +28,7 @@ export class FileDownloadBtnComponent implements OnChanges {
readonly singleFileDownload = input(false, { transform: booleanAttribute });
readonly dossierDownload = input(false, { transform: booleanAttribute });
readonly dropdownButton = computed(() => this.isDocumine && (this.dossierDownload() || this.singleFileDownload()));
readonly stopMenuImmediatePropagation = input(false);
tooltip: string;
canDownloadFiles: boolean;
invalidDownload = false;
@ -96,4 +97,10 @@ export class FileDownloadBtnComponent implements OnChanges {
const fileToDownload = !this.dossierDownload() ? this.files()[0] : null;
return firstValueFrom(this._componentLogService.exportXML(this.dossier().dossierTemplateId, this.dossier().id, fileToDownload));
}
stopImmediatePropagation($event: MouseEvent) {
if (!this.stopMenuImmediatePropagation()) {
$event.stopImmediatePropagation();
}
}
}