From 7973d4563e4c50fa15e573dcc447180154b70aca Mon Sep 17 00:00:00 2001 From: Bastian Wagner Date: Thu, 12 Mar 2026 15:17:59 +0100 Subject: [PATCH] ui --- .../create-handover-pdf-dialog.component.html | 4 ++-- .../create-handover-pdf-dialog.component.ts | 3 +++ client/src/app/shared/api.service.ts | 8 +++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/client/src/app/modules/keys/components/create-handover-pdf-dialog/create-handover-pdf-dialog.component.html b/client/src/app/modules/keys/components/create-handover-pdf-dialog/create-handover-pdf-dialog.component.html index 5f1fc43..dbe72eb 100644 --- a/client/src/app/modules/keys/components/create-handover-pdf-dialog/create-handover-pdf-dialog.component.html +++ b/client/src/app/modules/keys/components/create-handover-pdf-dialog/create-handover-pdf-dialog.component.html @@ -45,8 +45,8 @@ - - + diff --git a/client/src/app/modules/keys/components/create-handover-pdf-dialog/create-handover-pdf-dialog.component.ts b/client/src/app/modules/keys/components/create-handover-pdf-dialog/create-handover-pdf-dialog.component.ts index 2dfb6da..20799a0 100644 --- a/client/src/app/modules/keys/components/create-handover-pdf-dialog/create-handover-pdf-dialog.component.ts +++ b/client/src/app/modules/keys/components/create-handover-pdf-dialog/create-handover-pdf-dialog.component.ts @@ -20,6 +20,8 @@ export class CreateHandoverPdfDialogComponent { readonly dialogRef = inject(MatDialogRef); readonly data = inject(MAT_DIALOG_DATA); + public isLoading = false; + handoverPDFForm = new FormGroup({ handoverDate: new FormControl(new Date(), Validators.required), place: new FormControl(null, Validators.required), @@ -52,6 +54,7 @@ export class CreateHandoverPdfDialogComponent { } async createPdf() { + this.isLoading = true; const dto: IKeyHandoverPDF = { ...this.handoverPDFForm.value as any, quantity: 1, diff --git a/client/src/app/shared/api.service.ts b/client/src/app/shared/api.service.ts index e0231bb..250e533 100644 --- a/client/src/app/shared/api.service.ts +++ b/client/src/app/shared/api.service.ts @@ -463,7 +463,13 @@ export class ApiService { this.http.post('/api/key/pdf', data, { responseType: 'blob', - }).subscribe((blob) => { + }).pipe( + this.toast.observe({ + loading: `Erstelle Übergabedokument`, + success: `Übergabedokument wurde erfolgreich erstellt und wird gespeichert.`, + error: 'Es ist ein Fehler aufgetreten' + })) + .subscribe((blob) => { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url;