feat(usability): explain deleted bookings and linked transfer undo (U10)

This commit is contained in:
2026-11-02 19:26:23 +01:00
parent 2d36ab0b88
commit 1686f5769c
11 changed files with 146 additions and 14 deletions
@@ -3,6 +3,10 @@
<td data-label="Datum">@Entry.Date.ToString("dd.MM.yyyy")</td>
<td data-label="Beschreibung" class="entry-description">
@Entry.Title
@if (Entry.IsDeleted)
{
<p class="deleted-status">Gelöscht – zählt nicht zum Kontostand</p>
}
@if (Entry.IsTransfer && !string.IsNullOrEmpty(Entry.LinkedAccountName))
{
<small class="text-muted ms-1">
@@ -1,3 +1,7 @@
@if (Entries.Any(e => e.IsDeleted))
{
<label class="history-toggle"><input type="checkbox" @bind="showDeleted" /> Gelöschte Buchungen anzeigen (@Entries.Count(e => e.IsDeleted))</label>
}
<div class="table-responsive entry-list">
<table class="table table-hover table-sm align-middle">
<thead class="table-light">
@@ -10,7 +14,7 @@
</tr>
</thead>
<tbody>
@foreach (var entry in Entries)
@foreach (var entry in VisibleEntries)
{
<EntryRow @key="entry.Id" Highlighted="@(entry.Id == HighlightedEntryId)" Entry="entry" OnDelete="OnDeleteEntry" OnRestore="OnRestoreEntry" OnEdit="OnEditEntry" />
}
@@ -18,7 +22,7 @@
</table>
</div>
@if (!Entries.Any())
@if (!VisibleEntries.Any())
{
<div class="text-center py-3 text-muted">@EmptyMessage</div>
}
@@ -5,6 +5,8 @@ namespace Duempelkas.App.Components.Accounts;
public partial class EntryTable
{
private bool showDeleted;
private IEnumerable<EntryDto> VisibleEntries => Entries.Where(e => !e.IsDeleted || showDeleted);
[Parameter] public int? HighlightedEntryId { get; set; }
[Parameter] public string EmptyMessage { get; set; } = "Keine Buchungen vorhanden.";
#region Parameters
@@ -1,9 +1,9 @@
<ModalDialog @ref="modal" Title="@Title" OnCancel="OnCancel" >
<ModalDialog @ref="modal" Title="@Title" OnCancel="OnCancel" Busy="Busy">
<h5>@Title</h5>
<p>@Message</p>
<div class="d-flex justify-content-end gap-2">
<button type="button" class="@ConfirmButtonClass" @onclick="Confirm"><i class="@ConfirmIconClass"></i> @ConfirmText</button>
<button type="button" class="btn btn-outline-secondary" data-safe-focus @onclick="Cancel"><i class="bi bi-x-lg"></i> @CancelText</button>
<button type="button" disabled="@Busy" class="@ConfirmButtonClass" @onclick="Confirm"><i class="@ConfirmIconClass"></i> @ConfirmText</button>
<button type="button" disabled="@Busy" class="btn btn-outline-secondary" data-safe-focus @onclick="Cancel"><i class="bi bi-x-lg"></i> @CancelText</button>
</div>
</ModalDialog>
@@ -4,6 +4,7 @@ namespace Duempelkas.App.Components.Dialogs;
public partial class ConfirmDialog
{
[Parameter] public bool Busy { get; set; }
#region Parameters
[Parameter]
@@ -34,7 +35,7 @@ public partial class ConfirmDialog
#region Actions
private async Task Confirm() => await OnConfirm.InvokeAsync();
private async Task Confirm() { if (!Busy) await OnConfirm.InvokeAsync(); }
private async Task Cancel() { if (modal != null) await modal.RequestCloseAsync(); else await OnCancel.InvokeAsync(); }