feat: add comprehensive loading feedback (#18)

This commit is contained in:
nessar committed 2026-08-17 14:18:15 +02:00
1 parent 45de0cebcc
commit ec3319494b
47 files changed
+1753 -406

No files matched your search

@@ -1,4 +1,4 @@
<article class="tenant-card">
<article class="tenant-card" [attr.aria-busy]="deleting() || uploading()">
<div class="tenant-identity">
<span class="tenant-avatar"
>{{ tenant().firstName.charAt(0) }}{{ tenant().lastName.charAt(0) }}</span
@@ -31,11 +31,20 @@
mat-button
type="button"
class="attachment-row"
[attr.aria-busy]="downloadingAttachmentIds().has(attachment.id)"
[disabled]="deleting() || downloadingAttachmentIds().has(attachment.id)"
[attr.aria-label]="'Télécharger la pièce jointe ' + attachment.fileName"
(click)="attachmentDownloadRequested.emit({ tenantId: tenant().id!, attachment })"
>
<span aria-hidden="true">↧</span>{{ attachment.fileName }}
@if (downloadingAttachmentIds().has(attachment.id)) {
<mat-spinner diameter="16" aria-hidden="true" /> Téléchargement…
} @else {
<span aria-hidden="true">↧</span>{{ attachment.fileName }}
}
</button>
@if (attachmentDownloadErrors()[attachment.id]) {
<p class="attachment-error" role="alert">{{ attachmentDownloadErrors()[attachment.id] }}</p>
}
}
@if (tenant().id) {
@if (uploadError() || attachmentError()) {
@@ -44,24 +53,44 @@
<label class="upload-action"
><input
type="file"
[disabled]="uploading() || deleting()"
[attr.aria-label]="
'Ajouter une pièce jointe pour ' + tenant().firstName + ' ' + tenant().lastName
"
(change)="selectFile($event)"
/>+ Ajouter une pièce jointe <small>· 250 Mo maximum</small></label
>
@if (uploading()) {
<div class="upload-progress" role="status" aria-live="polite">
<span>Envoi{{ uploadProgress() === null ? '…' : ' : ' + uploadProgress() + ' %' }}</span>
<mat-progress-bar
[mode]="uploadProgress() === null ? 'indeterminate' : 'determinate'"
[value]="uploadProgress() ?? 0"
/>
</div>
}
}
</div>
<div class="card-actions">
<button mat-button type="button" (click)="editRequested.emit(tenant())">Modifier</button>
@if (deleteError()) {
<p class="attachment-error" role="alert">{{ deleteError() }}</p>
}
<div class="card-actions" aria-live="polite">
<button mat-button type="button" [disabled]="deleting()" (click)="editRequested.emit(tenant())">
Modifier
</button>
@if (tenant().id) {
<button
mat-button
type="button"
class="danger-action"
[disabled]="deleting()"
(click)="deleteRequested.emit(tenant().id!)"
>
Supprimer
@if (deleting()) {
<mat-spinner diameter="16" aria-hidden="true" /> Suppression…
} @else {
Supprimer
}
</button>
}
</div>