Browse Source

Account Blazor refactored

Added AccountComponentBase: #5961
Replace Abstract Base: #5962
pull/6008/head
Ahmet 6 years ago
parent
commit
a8799bd6eb
  1. 14
      modules/account/src/Volo.Abp.Account.Blazor/AbpAccountComponentBase.cs
  2. 10
      modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor
  3. 17
      modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/AccountManage.razor.cs
  4. 2
      modules/account/src/Volo.Abp.Account.Blazor/Volo.Abp.Account.Blazor.csproj

14
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);
}
}
}

10
modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor → 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
<Row>
<Column ColumnSize="ColumnSize.Is12">
<Tabs @bind-SelectedTab="@SelectedTab" TabPosition="TabPosition.Left" Pills="true">
@ -14,15 +16,15 @@
<EditForm id="ChangePasswordForm" Model="@ChangePasswordModel" OnValidSubmit="ChangePasswordAsync">
<Field>
<FieldLabel>@L["DisplayName:CurrentPassword"]</FieldLabel>
<TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.CurrentPassword"/>
<TextEdit Role="@TextRole.Password" @bind-text="@ChangePasswordModel.CurrentPassword"/>
</Field>
<Field>
<FieldLabel>@L["DisplayName:NewPassword"]</FieldLabel>
<TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.NewPassword"/>
<TextEdit Role="@TextRole.Password" @bind-text="@ChangePasswordModel.NewPassword"/>
</Field>
<Field>
<FieldLabel>@L["DisplayName:NewPasswordConfirm"]</FieldLabel>
<TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.NewPasswordConfirm"/>
<TextEdit Role="@TextRole.Password" @bind-text="@ChangePasswordModel.NewPasswordConfirm"/>
</Field>
<Field>
<Button form="ChangePasswordForm" Color="Color.Primary" Clicked="@ChangePasswordAsync">@L["Save"]</Button>

17
modules/account/src/Volo.Abp.Account.Blazor/Pages/Account/Manage.razor.cs → 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<AbpAccountBlazorModule> ObjectMapper { get; set; }
[Inject] protected IUiMessageService UiMessageService { get; set; }
[Inject] protected IStringLocalizer<AbpUiResource> UiLocalizer { get; set; }
[Inject] protected IStringLocalizer<AccountResource> L { get; set; }
protected string SelectedTab = "Password";
protected ChangePasswordModel ChangePasswordModel;
protected PersonalInfoModel PersonalInfoModel;
protected override async Task OnInitializedAsync()
{
await GetUserInformations();

2
modules/account/src/Volo.Abp.Account.Blazor/Volo.Abp.Account.Blazor.csproj

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<Content Update="Pages\Account\Manage.razor">
<Content Update="Pages\Account\AccountManage.razor">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
</ItemGroup>

Loading…
Cancel
Save