From dfaa91966a88801d3d8409812e8c6790c165ffca Mon Sep 17 00:00:00 2001 From: Ahmet Date: Mon, 9 Nov 2020 12:42:35 +0300 Subject: [PATCH 1/4] Update IUiNotificationService.cs --- .../Components/Notifications/IUiNotificationService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs index cef898b179..dfbde9b1eb 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Notifications/IUiNotificationService.cs @@ -6,8 +6,11 @@ namespace Volo.Abp.AspNetCore.Components.Notifications public interface IUiNotificationService { Task Info(string message, string title = null, Action options = null); + Task Success(string message, string title = null, Action options = null); + Task Warn(string message, string title = null, Action options = null); + Task Error(string message, string title = null, Action options = null); } } From 3695222b0627974eabed51d75009ce1e046afe1f Mon Sep 17 00:00:00 2001 From: Ahmet Date: Mon, 9 Nov 2020 12:49:47 +0300 Subject: [PATCH 2/4] remove async suffix from IUiMessageService methods --- .../ExceptionHandling/UserExceptionInformer.cs | 4 ++-- .../WebAssembly/Messages/SimpleUiMessageService.cs | 10 +++++----- .../Components/Messages/IUiMessageService.cs | 10 +++++----- .../Volo.Abp.BlazoriseUI/BlazoriseUiMessageService.cs | 10 +++++----- .../Components/EntityAction.razor.cs | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ExceptionHandling/UserExceptionInformer.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ExceptionHandling/UserExceptionInformer.cs index b24a1d8cb5..ca3a2be9c5 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ExceptionHandling/UserExceptionInformer.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/ExceptionHandling/UserExceptionInformer.cs @@ -31,11 +31,11 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling if (errorInfo.Details.IsNullOrEmpty()) { //TODO: Should we introduce MessageService.Error (sync) method instead of such a usage (without await)..? - MessageService.ErrorAsync(errorInfo.Message); + MessageService.Error(errorInfo.Message); } else { - MessageService.ErrorAsync(errorInfo.Details, errorInfo.Message); + MessageService.Error(errorInfo.Details, errorInfo.Message); } } diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/Messages/SimpleUiMessageService.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/Messages/SimpleUiMessageService.cs index f7dcd8f7ab..3218912ad0 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/Messages/SimpleUiMessageService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/Messages/SimpleUiMessageService.cs @@ -15,27 +15,27 @@ namespace Volo.Abp.AspNetCore.Components.WebAssembly.Messages JsRuntime = jsRuntime; } - public async Task InfoAsync(string message, string title = null, Action options = null) + public async Task Info(string message, string title = null, Action options = null) { await JsRuntime.InvokeVoidAsync("alert", message); } - public async Task SuccessAsync(string message, string title = null, Action options = null) + public async Task Success(string message, string title = null, Action options = null) { await JsRuntime.InvokeVoidAsync("alert", message); } - public async Task WarnAsync(string message, string title = null, Action options = null) + public async Task Warn(string message, string title = null, Action options = null) { await JsRuntime.InvokeVoidAsync("alert", message); } - public async Task ErrorAsync(string message, string title = null, Action options = null) + public async Task Error(string message, string title = null, Action options = null) { await JsRuntime.InvokeVoidAsync("alert", message); } - public async Task ConfirmAsync(string message, string title = null, Action options = null) + public async Task Confirm(string message, string title = null, Action options = null) { return await JsRuntime.InvokeAsync("confirm", message); } diff --git a/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs index 85191c4fd0..4f43cb90d6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components/Volo/Abp/AspNetCore/Components/Messages/IUiMessageService.cs @@ -5,14 +5,14 @@ namespace Volo.Abp.AspNetCore.Components.Messages { public interface IUiMessageService { - Task InfoAsync(string message, string title = null, Action options = null); + Task Info(string message, string title = null, Action options = null); - Task SuccessAsync(string message, string title = null, Action options = null); + Task Success(string message, string title = null, Action options = null); - Task WarnAsync(string message, string title = null, Action options = null); + Task Warn(string message, string title = null, Action options = null); - Task ErrorAsync(string message, string title = null, Action options = null); + Task Error(string message, string title = null, Action options = null); - Task ConfirmAsync(string message, string title = null, Action options = null); + Task Confirm(string message, string title = null, Action options = null); } } diff --git a/framework/src/Volo.Abp.BlazoriseUI/BlazoriseUiMessageService.cs b/framework/src/Volo.Abp.BlazoriseUI/BlazoriseUiMessageService.cs index c3b73c9941..ffffd5ed1b 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/BlazoriseUiMessageService.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/BlazoriseUiMessageService.cs @@ -30,7 +30,7 @@ namespace Volo.Abp.BlazoriseUI Logger = NullLogger.Instance; } - public Task InfoAsync(string message, string title = null, Action options = null) + public Task Info(string message, string title = null, Action options = null) { var uiMessageOptions = CreateDefaultOptions(); options?.Invoke(uiMessageOptions); @@ -40,7 +40,7 @@ namespace Volo.Abp.BlazoriseUI return Task.CompletedTask; } - public Task SuccessAsync(string message, string title = null, Action options = null) + public Task Success(string message, string title = null, Action options = null) { var uiMessageOptions = CreateDefaultOptions(); options?.Invoke(uiMessageOptions); @@ -50,7 +50,7 @@ namespace Volo.Abp.BlazoriseUI return Task.CompletedTask; } - public Task WarnAsync(string message, string title = null, Action options = null) + public Task Warn(string message, string title = null, Action options = null) { var uiMessageOptions = CreateDefaultOptions(); options?.Invoke(uiMessageOptions); @@ -60,7 +60,7 @@ namespace Volo.Abp.BlazoriseUI return Task.CompletedTask; } - public Task ErrorAsync(string message, string title = null, Action options = null) + public Task Error(string message, string title = null, Action options = null) { var uiMessageOptions = CreateDefaultOptions(); options?.Invoke(uiMessageOptions); @@ -70,7 +70,7 @@ namespace Volo.Abp.BlazoriseUI return Task.CompletedTask; } - public Task ConfirmAsync(string message, string title = null, Action options = null) + public Task Confirm(string message, string title = null, Action options = null) { var uiMessageOptions = CreateDefaultOptions(); options?.Invoke(uiMessageOptions); diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs index 06d47f9a03..e3e7112afa 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs @@ -56,7 +56,7 @@ namespace Volo.Abp.BlazoriseUI.Components { if (ConfirmationMessage != null) { - if (await UiMessageService.ConfirmAsync(ConfirmationMessage())) + if (await UiMessageService.Confirm(ConfirmationMessage())) { await Clicked.InvokeAsync(); } From 524ef5ad95393eaa1be00f09213a5890a27a10ec Mon Sep 17 00:00:00 2001 From: Ahmet Date: Mon, 9 Nov 2020 13:02:19 +0300 Subject: [PATCH 3/4] Update FeatureManagementModal.razor.cs --- .../Components/FeatureManagementModal.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs index a8f36ea20d..ea07a96b46 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs @@ -108,7 +108,7 @@ namespace Volo.Abp.FeatureManagement.Blazor.Components } else { - await UiMessageService.WarnAsync(L["Volo.Abp.FeatureManagement:InvalidFeatureValue", feature.DisplayName]); + await UiMessageService.Warn(L["Volo.Abp.FeatureManagement:InvalidFeatureValue", feature.DisplayName]); } } From 4a868ee018b446d86926df25223955a3b8572da8 Mon Sep 17 00:00:00 2001 From: Ahmet Date: Mon, 9 Nov 2020 13:02:22 +0300 Subject: [PATCH 4/4] Update AccountManage.razor.cs --- .../Pages/Account/AccountManage.razor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs index a56da4b775..e647fd9549 100644 --- a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs +++ b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs @@ -43,7 +43,7 @@ namespace Volo.Abp.Account.Blazor.Pages.Account if (ChangePasswordModel.NewPassword != ChangePasswordModel.NewPasswordConfirm) { - await UiMessageService.WarnAsync(L["NewPasswordConfirmFailed"]); + await UiMessageService.Warn(L["NewPasswordConfirmFailed"]); return; } @@ -53,7 +53,7 @@ namespace Volo.Abp.Account.Blazor.Pages.Account NewPassword = ChangePasswordModel.NewPassword }); - await UiMessageService.SuccessAsync(L["PasswordChanged"]); + await UiMessageService.Success(L["PasswordChanged"]); } protected async Task UpdatePersonalInfoAsync() @@ -62,7 +62,7 @@ namespace Volo.Abp.Account.Blazor.Pages.Account ObjectMapper.Map(PersonalInfoModel) ); - await UiMessageService.SuccessAsync(L["PersonalSettingsSaved"]); + await UiMessageService.Success(L["PersonalSettingsSaved"]); } }