From 69d31222432d97d773a524de65f4157ca39ebb20 Mon Sep 17 00:00:00 2001 From: Claudio Schaad Date: Sat, 4 Jul 2026 09:51:38 +0200 Subject: [PATCH] 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 --- Schaad.Accounting.UI/Components/Pages/Accounts.razor.cs | 6 ++++++ Schaad.Accounting.UI/Components/Pages/BookingRules.razor.cs | 6 ++++++ Schaad.Accounting.UI/Components/Pages/BookingTexts.razor.cs | 6 ++++++ Schaad.Accounting.UI/Components/Pages/Classes.razor.cs | 6 ++++++ Schaad.Accounting.UI/Components/Pages/Transactions.razor.cs | 6 ++++++ 5 files changed, 30 insertions(+) diff --git a/Schaad.Accounting.UI/Components/Pages/Accounts.razor.cs b/Schaad.Accounting.UI/Components/Pages/Accounts.razor.cs index 5e225da..df987ad 100644 --- a/Schaad.Accounting.UI/Components/Pages/Accounts.razor.cs +++ b/Schaad.Accounting.UI/Components/Pages/Accounts.razor.cs @@ -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? 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); } } } diff --git a/Schaad.Accounting.UI/Components/Pages/BookingRules.razor.cs b/Schaad.Accounting.UI/Components/Pages/BookingRules.razor.cs index e2bf4da..31ecf0c 100644 --- a/Schaad.Accounting.UI/Components/Pages/BookingRules.razor.cs +++ b/Schaad.Accounting.UI/Components/Pages/BookingRules.razor.cs @@ -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? 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); } } } diff --git a/Schaad.Accounting.UI/Components/Pages/BookingTexts.razor.cs b/Schaad.Accounting.UI/Components/Pages/BookingTexts.razor.cs index df04bb8..e838057 100644 --- a/Schaad.Accounting.UI/Components/Pages/BookingTexts.razor.cs +++ b/Schaad.Accounting.UI/Components/Pages/BookingTexts.razor.cs @@ -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? 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); } } } diff --git a/Schaad.Accounting.UI/Components/Pages/Classes.razor.cs b/Schaad.Accounting.UI/Components/Pages/Classes.razor.cs index d8464f0..609e3ec 100644 --- a/Schaad.Accounting.UI/Components/Pages/Classes.razor.cs +++ b/Schaad.Accounting.UI/Components/Pages/Classes.razor.cs @@ -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? 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); } } } diff --git a/Schaad.Accounting.UI/Components/Pages/Transactions.razor.cs b/Schaad.Accounting.UI/Components/Pages/Transactions.razor.cs index 75aa933..8c851fa 100644 --- a/Schaad.Accounting.UI/Components/Pages/Transactions.razor.cs +++ b/Schaad.Accounting.UI/Components/Pages/Transactions.razor.cs @@ -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 accounts = []; private IQueryable? 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); } } }