From a8799bd6eb4a368d9edb2ce80622756d8812e578 Mon Sep 17 00:00:00 2001 From: Ahmet Date: Fri, 30 Oct 2020 11:28:28 +0300 Subject: [PATCH] Account Blazor refactored Added AccountComponentBase: #5961 Replace Abstract Base: #5962 --- .../AbpAccountComponentBase.cs | 14 ++++++++++++++ .../{Manage.razor => AccountManage.razor} | 10 ++++++---- .../{Manage.razor.cs => AccountManage.razor.cs} | 17 +++-------------- .../Volo.Abp.Account.Blazor.csproj | 2 +- 4 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 modules/account/src/Volo.Abp.Account.Blazor/AbpAccountComponentBase.cs rename modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/{Manage.razor => AccountManage.razor} (88%) rename modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/{Manage.razor.cs => AccountManage.razor.cs} (82%) diff --git a/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountComponentBase.cs b/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountComponentBase.cs new file mode 100644 index 0000000000..61e3890ffd --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Blazor/AbpAccountComponentBase.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Account.Localization; +using Volo.Abp.AspNetCore.Components; + +namespace Volo.Abp.Account.Blazor +{ + public class AbpAccountComponentBase : AbpComponentBase + { + public AbpAccountComponentBase() + { + LocalizationResource = typeof(AccountResource); + ObjectMapperContext = typeof(AbpAccountBlazorModule); + } + } +} diff --git a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor similarity index 88% rename from modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor rename to modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor index 3e101b38a4..e31cd25080 100644 --- a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor +++ b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor @@ -1,5 +1,7 @@ @page "/account/manage-profile" -@inherits AccountManageBase +@using Microsoft.AspNetCore.Components.Forms +@inherits AbpAccountComponentBase + @@ -14,15 +16,15 @@ @L["DisplayName:CurrentPassword"] - + @L["DisplayName:NewPassword"] - + @L["DisplayName:NewPasswordConfirm"] - + diff --git a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor.cs b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs similarity index 82% rename from modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor.cs rename to modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs index 7dfee0da53..63539db7f9 100644 --- a/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor.cs +++ b/modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs @@ -1,33 +1,22 @@ using System.Threading.Tasks; -using Localization.Resources.AbpUi; using Microsoft.AspNetCore.Components; -using Microsoft.Extensions.Localization; -using Volo.Abp.Account.Localization; using Volo.Abp.AspNetCore.Components.WebAssembly; using Volo.Abp.Identity; -using Volo.Abp.ObjectMapping; namespace Volo.Abp.Account.Blazor.Pages.Account { - public abstract class AccountManageBase : OwningComponentBase + public partial class AccountManage { - [Inject] protected IAccountAppService AccountAppService { get; set; } [Inject] protected IProfileAppService ProfileAppService { get; set; } - - [Inject] protected IObjectMapper ObjectMapper { get; set; } - + [Inject] protected IUiMessageService UiMessageService { get; set; } - [Inject] protected IStringLocalizer UiLocalizer { get; set; } - - [Inject] protected IStringLocalizer L { get; set; } - protected string SelectedTab = "Password"; protected ChangePasswordModel ChangePasswordModel; protected PersonalInfoModel PersonalInfoModel; - + protected override async Task OnInitializedAsync() { await GetUserInformations(); diff --git a/modules/account/src/Volo.Abp.Account.Blazor/Volo.Abp.Account.Blazor.csproj b/modules/account/src/Volo.Abp.Account.Blazor/Volo.Abp.Account.Blazor.csproj index 84d4e4a7f4..64633f0d25 100644 --- a/modules/account/src/Volo.Abp.Account.Blazor/Volo.Abp.Account.Blazor.csproj +++ b/modules/account/src/Volo.Abp.Account.Blazor/Volo.Abp.Account.Blazor.csproj @@ -18,7 +18,7 @@ - + true