Merge pull request #2327 from leigh-pointer/ScreenProgess

Added Progress Indicator
This commit is contained in:
Shaun Walker 2022-08-02 07:50:59 -04:00 committed by GitHub
commit 6968476ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -140,6 +140,7 @@
{ {
try try
{ {
ModuleInstance.ShowProgressIndicator();
foreach (Page page in _pages) foreach (Page page in _pages)
{ {
await PageService.DeletePageAsync(page.PageId); await PageService.DeletePageAsync(page.PageId);
@ -148,6 +149,7 @@
await logger.LogInformation("Pages Permanently Deleted"); await logger.LogInformation("Pages Permanently Deleted");
await Load(); await Load();
ModuleInstance.HideProgressIndicator();
StateHasChanged(); StateHasChanged();
NavigationManager.NavigateTo(NavigateUrl()); NavigationManager.NavigateTo(NavigateUrl());
} }
@ -155,6 +157,7 @@
{ {
await logger.LogError(ex, "Error Permanently Deleting Pages {Error}", ex.Message); await logger.LogError(ex, "Error Permanently Deleting Pages {Error}", ex.Message);
AddModuleMessage(ex.Message, MessageType.Error); AddModuleMessage(ex.Message, MessageType.Error);
ModuleInstance.HideProgressIndicator();
} }
} }
@ -204,6 +207,7 @@
{ {
try try
{ {
ModuleInstance.ShowProgressIndicator();
foreach (Module module in _modules) foreach (Module module in _modules)
{ {
await PageModuleService.DeletePageModuleAsync(module.PageModuleId); await PageModuleService.DeletePageModuleAsync(module.PageModuleId);
@ -218,12 +222,14 @@
await logger.LogInformation("Modules Permanently Deleted"); await logger.LogInformation("Modules Permanently Deleted");
await Load(); await Load();
ModuleInstance.HideProgressIndicator();
StateHasChanged(); StateHasChanged();
} }
catch (Exception ex) catch (Exception ex)
{ {
await logger.LogError(ex, "Error Permanently Deleting Modules {Error}", ex.Message); await logger.LogError(ex, "Error Permanently Deleting Modules {Error}", ex.Message);
AddModuleMessage(Localizer["Error.Modules.Delete"], MessageType.Error); AddModuleMessage(Localizer["Error.Modules.Delete"], MessageType.Error);
ModuleInstance.HideProgressIndicator();
} }
} }
} }

View File

@ -429,6 +429,7 @@ else
{ {
try try
{ {
ModuleInstance.ShowProgressIndicator();
foreach(var Notification in notifications) foreach(var Notification in notifications)
{ {
if (!Notification.IsDeleted) if (!Notification.IsDeleted)
@ -444,12 +445,15 @@ else
} }
await logger.LogInformation("Notifications Permanently Deleted"); await logger.LogInformation("Notifications Permanently Deleted");
await LoadNotificationsAsync(); await LoadNotificationsAsync();
ModuleInstance.HideProgressIndicator();
StateHasChanged(); StateHasChanged();
} }
catch (Exception ex) catch (Exception ex)
{ {
await logger.LogError(ex, "Error Deleting Notifications {Error}", ex.Message); await logger.LogError(ex, "Error Deleting Notifications {Error}", ex.Message);
AddModuleMessage(ex.Message, MessageType.Error); AddModuleMessage(ex.Message, MessageType.Error);
ModuleInstance.HideProgressIndicator();
} }
} }