PR U-7: success toasts after mutations

Add IToastService.ShowToast(ToastIntent.Success, ...) after each
successful save/delete across Accounts, BookingRules, BookingTexts,
Classes, and Transactions. Toasts fire after the list re-fetch so
the confirmation is visible even if the edited item paginated out of
view.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Claudio Schaad 2026-07-04 09:51:38 +02:00
parent 562338d0c4
commit 69d3122243
5 changed files with 30 additions and 0 deletions

View file

@ -14,6 +14,9 @@ public partial class Accounts : ComponentBase
[Inject]
private IDialogService dialogService { get; set; } = null!;
[Inject]
private IToastService toastService { get; set; } = null!;
private IQueryable<Account>? accountQueryable;
protected override async Task OnInitializedAsync()
@ -37,6 +40,7 @@ public partial class Accounts : ComponentBase
if (!result.Cancelled && result.Data != null)
{
accountQueryable = (await accountRepository.GetAccountListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Konto gespeichert", 3000);
}
}
@ -55,6 +59,7 @@ public partial class Accounts : ComponentBase
if (!result.Cancelled && result.Data != null)
{
accountQueryable = (await accountRepository.GetAccountListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Konto gespeichert", 3000);
}
}
@ -67,6 +72,7 @@ public partial class Accounts : ComponentBase
{
await accountRepository.DeleteAccountAsync(id);
accountQueryable = (await accountRepository.GetAccountListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Konto gelöscht", 3000);
}
}
}

View file

@ -18,6 +18,9 @@ public partial class BookingRules : ComponentBase
[Inject]
private IDialogService dialogService { get; set; } = null!;
[Inject]
private IToastService toastService { get; set; } = null!;
private IQueryable<BookingRuleDataset>? bookingRulesQueryable;
protected override async Task OnInitializedAsync()
@ -41,6 +44,7 @@ public partial class BookingRules : ComponentBase
if (!result.Cancelled && result.Data != null)
{
bookingRulesQueryable = (await viewService.GetBookingRuleViewListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Buchungsregel gespeichert", 3000);
}
}
@ -59,6 +63,7 @@ public partial class BookingRules : ComponentBase
if (!result.Cancelled && result.Data != null)
{
bookingRulesQueryable = (await viewService.GetBookingRuleViewListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Buchungsregel gespeichert", 3000);
}
}
@ -71,6 +76,7 @@ public partial class BookingRules : ComponentBase
{
await bookingRuleRepository.DeleteBookingRuleAsync(id);
bookingRulesQueryable = (await viewService.GetBookingRuleViewListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Buchungsregel gelöscht", 3000);
}
}
}

View file

@ -14,6 +14,9 @@ public partial class BookingTexts : ComponentBase
[Inject]
private IDialogService dialogService { get; set; } = null!;
[Inject]
private IToastService toastService { get; set; } = null!;
private IQueryable<BookingText>? bookingTextQueryable;
protected override async Task OnInitializedAsync()
@ -37,6 +40,7 @@ public partial class BookingTexts : ComponentBase
if (!result.Cancelled && result.Data != null)
{
bookingTextQueryable = (await bookingTextRepository.GetBookingTextListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Buchungstext gespeichert", 3000);
}
}
@ -55,6 +59,7 @@ public partial class BookingTexts : ComponentBase
if (!result.Cancelled && result.Data != null)
{
bookingTextQueryable = (await bookingTextRepository.GetBookingTextListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Buchungstext gespeichert", 3000);
}
}
@ -67,6 +72,7 @@ public partial class BookingTexts : ComponentBase
{
await bookingTextRepository.DeleteBookingTextAsync(id);
bookingTextQueryable = (await bookingTextRepository.GetBookingTextListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Buchungstext gelöscht", 3000);
}
}
}

View file

@ -14,6 +14,9 @@ public partial class Classes : ComponentBase
[Inject]
private IDialogService dialogService { get; set; } = null!;
[Inject]
private IToastService toastService { get; set; } = null!;
private IQueryable<SubClass>? subclassQueryable;
protected override async Task OnInitializedAsync()
@ -37,6 +40,7 @@ public partial class Classes : ComponentBase
if (!result.Cancelled && result.Data != null)
{
subclassQueryable = (await subclassRepository.GetSubClassListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Klasse gespeichert", 3000);
}
}
@ -55,6 +59,7 @@ public partial class Classes : ComponentBase
if (!result.Cancelled && result.Data != null)
{
subclassQueryable = (await subclassRepository.GetSubClassListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Klasse gespeichert", 3000);
}
}
@ -67,6 +72,7 @@ public partial class Classes : ComponentBase
{
await subclassRepository.DeleteSubClassAsync(id);
subclassQueryable = (await subclassRepository.GetSubClassListAsync()).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Klasse gelöscht", 3000);
}
}
}

View file

@ -18,6 +18,9 @@ public partial class Transactions : ComponentBase
[Inject]
private IDialogService dialogService { get; set; } = null!;
[Inject]
private IToastService toastService { get; set; } = null!;
private IReadOnlyList<AccountDataset> accounts = [];
private IQueryable<TransactionDataset>? transactionList;
@ -69,6 +72,7 @@ public partial class Transactions : ComponentBase
if (!result.Cancelled && result.Data != null)
{
transactionList = (await viewService.GetTransactionViewListAsync(selectedAccountId)).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Transaktion gespeichert", 3000);
}
}
@ -87,6 +91,7 @@ public partial class Transactions : ComponentBase
if (!result.Cancelled && result.Data != null)
{
transactionList = (await viewService.GetTransactionViewListAsync(selectedAccountId)).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Transaktion gespeichert", 3000);
}
}
@ -99,6 +104,7 @@ public partial class Transactions : ComponentBase
{
await transactionRepository.DeleteTransactionAsync(id);
transactionList = (await viewService.GetTransactionViewListAsync(selectedAccountId)).AsQueryable();
toastService.ShowToast(ToastIntent.Success, "Transaktion gelöscht", 3000);
}
}
}