Browse Source

Merge pull request #6008 from abpframework/cotur/component-base

Remove abstract component bases and more for blazor components
pull/6030/head
Halil İbrahim Kalkan 6 years ago
committed by GitHub
parent
commit
30b7e6d510
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      modules/account/src/Volo.Abp.Account.Blazor/AbpAccountComponentBase.cs
  2. 20
      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. 6
      modules/account/src/Volo.Abp.Account.Blazor/Volo.Abp.Account.Blazor.csproj
  5. 13
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/AbpFeatureManagementComponentBase.cs
  6. 140
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor
  7. 2
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs
  8. 8
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor
  9. 9
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs
  10. 8
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor
  11. 5
      modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs
  12. 2
      modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor
  13. 4
      modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs
  14. 8
      modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor
  15. 9
      modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs

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 abstract class AbpAccountComponentBase : AbpComponentBase
{
protected AbpAccountComponentBase()
{
LocalizationResource = typeof(AccountResource);
ObjectMapperContext = typeof(AbpAccountBlazorModule);
}
}
}

20
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" @page "/account/manage-profile"
@inherits AccountManageBase @using Microsoft.AspNetCore.Components.Forms
@inherits AbpAccountComponentBase
<Row> <Row>
<Column ColumnSize="ColumnSize.Is12"> <Column ColumnSize="ColumnSize.Is12">
<Tabs @bind-SelectedTab="@SelectedTab" TabPosition="TabPosition.Left" Pills="true"> <Tabs @bind-SelectedTab="@SelectedTab" TabPosition="TabPosition.Left" Pills="true">
@ -14,15 +16,15 @@
<EditForm id="ChangePasswordForm" Model="@ChangePasswordModel" OnValidSubmit="ChangePasswordAsync"> <EditForm id="ChangePasswordForm" Model="@ChangePasswordModel" OnValidSubmit="ChangePasswordAsync">
<Field> <Field>
<FieldLabel>@L["DisplayName:CurrentPassword"]</FieldLabel> <FieldLabel>@L["DisplayName:CurrentPassword"]</FieldLabel>
<TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.CurrentPassword"/> <TextEdit Role="@TextRole.Password" @bind-Text="@ChangePasswordModel.CurrentPassword"/>
</Field> </Field>
<Field> <Field>
<FieldLabel>@L["DisplayName:NewPassword"]</FieldLabel> <FieldLabel>@L["DisplayName:NewPassword"]</FieldLabel>
<TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.NewPassword"/> <TextEdit Role="@TextRole.Password" @bind-Text="@ChangePasswordModel.NewPassword"/>
</Field> </Field>
<Field> <Field>
<FieldLabel>@L["DisplayName:NewPasswordConfirm"]</FieldLabel> <FieldLabel>@L["DisplayName:NewPasswordConfirm"]</FieldLabel>
<TextEdit Role="TextRole.Password" @bind-text="@ChangePasswordModel.NewPasswordConfirm"/> <TextEdit Role="@TextRole.Password" @bind-Text="@ChangePasswordModel.NewPasswordConfirm"/>
</Field> </Field>
<Field> <Field>
<Button form="ChangePasswordForm" Color="Color.Primary" Clicked="@ChangePasswordAsync">@L["Save"]</Button> <Button form="ChangePasswordForm" Color="Color.Primary" Clicked="@ChangePasswordAsync">@L["Save"]</Button>
@ -36,25 +38,25 @@
<EditForm id="UpdatePersonalInfoForm" Model="@PersonalInfoModel" OnValidSubmit="UpdatePersonalInfoAsync"> <EditForm id="UpdatePersonalInfoForm" Model="@PersonalInfoModel" OnValidSubmit="UpdatePersonalInfoAsync">
<Field> <Field>
<FieldLabel>@L["DisplayName:UserName"]</FieldLabel> <FieldLabel>@L["DisplayName:UserName"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.UserName"/> <TextEdit @bind-Text="@PersonalInfoModel.UserName"/>
</Field> </Field>
<Fields> <Fields>
<Field ColumnSize="ColumnSize.Is6"> <Field ColumnSize="ColumnSize.Is6">
<FieldLabel>@L["DisplayName:Name"]</FieldLabel> <FieldLabel>@L["DisplayName:Name"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.Name"/> <TextEdit @bind-Text="@PersonalInfoModel.Name"/>
</Field> </Field>
<Field ColumnSize="ColumnSize.Is6"> <Field ColumnSize="ColumnSize.Is6">
<FieldLabel>@L["DisplayName:Surname"]</FieldLabel> <FieldLabel>@L["DisplayName:Surname"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.Surname"/> <TextEdit @bind-Text="@PersonalInfoModel.Surname"/>
</Field> </Field>
</Fields> </Fields>
<Field> <Field>
<FieldLabel>@L["DisplayName:Email"]</FieldLabel> <FieldLabel>@L["DisplayName:Email"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.Email"/> <TextEdit @bind-Text="@PersonalInfoModel.Email"/>
</Field> </Field>
<Field> <Field>
<FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel> <FieldLabel>@L["DisplayName:PhoneNumber"]</FieldLabel>
<TextEdit @bind-text="@PersonalInfoModel.PhoneNumber"/> <TextEdit @bind-Text="@PersonalInfoModel.PhoneNumber"/>
</Field> </Field>
<Field> <Field>
<Button form="UpdatePersonalInfoForm" Color="Color.Primary" Clicked="@UpdatePersonalInfoAsync">@L["Save"]</Button> <Button form="UpdatePersonalInfoForm" Color="Color.Primary" Clicked="@UpdatePersonalInfoAsync">@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 System.Threading.Tasks;
using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using Volo.Abp.Account.Localization;
using Volo.Abp.AspNetCore.Components.WebAssembly; using Volo.Abp.AspNetCore.Components.WebAssembly;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp.ObjectMapping;
namespace Volo.Abp.Account.Blazor.Pages.Account 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 IProfileAppService ProfileAppService { get; set; }
[Inject] protected IObjectMapper<AbpAccountBlazorModule> ObjectMapper { get; set; }
[Inject] protected IUiMessageService UiMessageService { 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 string SelectedTab = "Password";
protected ChangePasswordModel ChangePasswordModel; protected ChangePasswordModel ChangePasswordModel;
protected PersonalInfoModel PersonalInfoModel; protected PersonalInfoModel PersonalInfoModel;
protected async override Task OnInitializedAsync() protected async override Task OnInitializedAsync()
{ {
await GetUserInformations(); await GetUserInformations();

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

@ -17,10 +17,4 @@
<ProjectReference Include="..\Volo.Abp.Account.HttpApi.Client\Volo.Abp.Account.HttpApi.Client.csproj" /> <ProjectReference Include="..\Volo.Abp.Account.HttpApi.Client\Volo.Abp.Account.HttpApi.Client.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Update="Pages\Account\Manage.razor">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
</ItemGroup>
</Project> </Project>

13
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/AbpFeatureManagementComponentBase.cs

@ -0,0 +1,13 @@
using Volo.Abp.AspNetCore.Components;
using Volo.Abp.FeatureManagement.Localization;
namespace Volo.Abp.FeatureManagement.Blazor
{
public abstract class AbpFeatureManagementComponentBase : AbpComponentBase
{
protected AbpFeatureManagementComponentBase()
{
LocalizationResource = typeof(AbpFeatureManagementResource);
}
}
}

140
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor

@ -1,6 +1,8 @@
@using Volo.Abp.Validation.StringValues @using Volo.Abp.Validation.StringValues
@using Microsoft.Extensions.Localization @using Microsoft.Extensions.Localization
@inherits AbpFeatureManagementComponentBase
<Modal @ref="Modal"> <Modal @ref="Modal">
<ModalBackdrop /> <ModalBackdrop />
<ModalContent Size="ModalSize.Large" IsCentered="true"> <ModalContent Size="ModalSize.Large" IsCentered="true">
@ -9,84 +11,80 @@
<CloseButton Clicked="CloseModal" /> <CloseButton Clicked="CloseModal" />
</ModalHeader> </ModalHeader>
<ModalBody MaxHeight="50"> <ModalBody MaxHeight="50">
<EditForm id="UpdateFeaturesForm" OnValidSubmit="SaveAsync"> @if (Groups == null)
@if (Groups == null) {
{ <span>@L["NoFeatureFoundMessage"]</span>
<span>@L["NoFeatureFoundMessage"]</span> }
} else
else {
{ <Tabs TabPosition="TabPosition.Left" Pills="true" @bind-SelectedTab="@SelectedTabName">
<Tabs TabPosition="TabPosition.Left" Pills="true" @bind-SelectedTab="@SelectedTabName"> <Items>
<Items> @foreach (var group in Groups)
@foreach (var group in Groups) {
{ <Tab Name="@GetNormalizedGroupName(group.Name)">
<Tab Name="@GetNormalizedGroupName(group.Name)"> <span>@group.DisplayName</span>
<span>@group.DisplayName</span> </Tab>
</Tab> }
} </Items>
</Items> <Content>
<Content> @foreach (var group in Groups)
@foreach (var group in Groups) {
{ <TabPanel Name="@GetNormalizedGroupName(group.Name)">
<TabPanel Name="@GetNormalizedGroupName(group.Name)"> <h4>@group.DisplayName</h4>
<h4>@group.DisplayName</h4>
@foreach (var feature in group.Features)
@foreach (var feature in group.Features) {
var disabled = IsDisabled(feature.Provider.Name);
if (feature.ValueType is FreeTextStringValueType)
{ {
var disabled = IsDisabled(feature.Provider.Name); <Field>
<FieldLabel>@feature.DisplayName</FieldLabel>
if (feature.ValueType is FreeTextStringValueType) <TextEdit Disabled="@disabled"
{ Text="@feature.Value"
<Field> TextChanged="@(async(v) => await OnFeatureValueChangedAsync(v, feature))" />
<FieldLabel>@feature.DisplayName</FieldLabel> @if (feature.Description != null)
<TextEdit {
Disabled="@disabled" <span>@feature.Description</span>
Text="@feature.Value" }
TextChanged="@(async(v) => await OnFeatureValueChangedAsync(v, feature))" /> </Field>
@if (feature.Description != null) }
if (feature.ValueType is SelectionStringValueType)
{
var items = ((SelectionStringValueType)feature.ValueType).ItemSource.Items;
<Field>
<FieldLabel>@feature.DisplayName</FieldLabel>
<Select TValue="string"
@bind-SelectedValue="@SelectionStringValues[feature.Name]">
@foreach (var item in items)
{ {
<span>@feature.Description</span> <SelectItem Value="@item.Value">
@CreateStringLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name)
</SelectItem>
} }
</Field> </Select>
} </Field>
}
if (feature.ValueType is SelectionStringValueType)
{ if (feature.ValueType is ToggleStringValueType)
var items = ((SelectionStringValueType) feature.ValueType).ItemSource.Items; {
<Field>
<Field> <Check TValue="bool" @bind-checked="@ToggleValues[feature.Name]">@feature.DisplayName</Check>
<FieldLabel>@feature.DisplayName</FieldLabel> </Field>
<Select
TValue="string"
@bind-SelectedValue="@SelectionStringValues[feature.Name]">
@foreach (var item in items)
{
<SelectItem Value="@item.Value">
@CreateStringLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name)
</SelectItem>
}
</Select>
</Field>
}
if (feature.ValueType is ToggleStringValueType)
{
<Field>
<Check TValue="bool" @bind-checked="@ToggleValues[feature.Name]">@feature.DisplayName</Check>
</Field>
}
} }
}
</TabPanel>
} </TabPanel>
</Content> }
</Tabs> </Content>
} </Tabs>
</EditForm> }
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button> <Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button>
<Button form="UpdateFeaturesForm" Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button> <Button Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button>
</ModalFooter> </ModalFooter>
</ModalContent> </ModalContent>
</Modal> </Modal>

2
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor.cs

@ -20,8 +20,6 @@ namespace Volo.Abp.FeatureManagement.Blazor.Components
[Inject] protected IUiMessageService UiMessageService { get; set; } [Inject] protected IUiMessageService UiMessageService { get; set; }
[Inject] protected IStringLocalizer<AbpFeatureManagementResource> L { get; set; }
[Inject] protected IStringLocalizerFactory HtmlLocalizerFactory { get; set; } [Inject] protected IStringLocalizerFactory HtmlLocalizerFactory { get; set; }
[Inject] protected IOptions<AbpLocalizationOptions> LocalizationOptions { get; set; } [Inject] protected IOptions<AbpLocalizationOptions> LocalizationOptions { get; set; }

8
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor

@ -2,12 +2,14 @@
@attribute [Authorize(IdentityPermissions.Roles.Default)] @attribute [Authorize(IdentityPermissions.Roles.Default)]
@using Volo.Abp.Identity @using Volo.Abp.Identity
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Volo.Abp.PermissionManagement.Blazor.Components
@using Microsoft.Extensions.Localization @using Microsoft.Extensions.Localization
@using Volo.Abp.Identity.Localization @using Volo.Abp.Identity.Localization
@using Volo.Abp.PermissionManagement.Blazor.Components
@inherits RoleManagementBase
@inject IStringLocalizer<IdentityResource> L
@inject AbpIdentityBlazorMessageLocalizerHelper<IdentityResource> LH @inject AbpIdentityBlazorMessageLocalizerHelper<IdentityResource> LH
@inherits AbpCrudPageBase<IIdentityRoleAppService, IdentityRoleDto, Guid, GetIdentityRolesInput, IdentityRoleCreateDto, IdentityRoleUpdateDto>
@* ************************* PAGE HEADER ************************* *@ @* ************************* PAGE HEADER ************************* *@
<Row> <Row>
<Column ColumnSize="ColumnSize.Is6"> <Column ColumnSize="ColumnSize.Is6">

9
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs

@ -1,14 +1,13 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Blazorise; using Blazorise;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Volo.Abp.BlazoriseUI;
using Volo.Abp.Identity.Localization; using Volo.Abp.Identity.Localization;
using Volo.Abp.PermissionManagement.Blazor.Components; using Volo.Abp.PermissionManagement.Blazor.Components;
namespace Volo.Abp.Identity.Blazor.Pages.Identity namespace Volo.Abp.Identity.Blazor.Pages.Identity
{ {
public abstract class RoleManagementBase : AbpCrudPageBase<IIdentityRoleAppService, IdentityRoleDto, Guid, GetIdentityRolesInput, IdentityRoleCreateDto, IdentityRoleUpdateDto> public partial class RoleManagement
{ {
protected const string PermissionProviderName = "R"; protected const string PermissionProviderName = "R";
@ -17,7 +16,9 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity
protected bool HasManagePermissionsPermission { get; set; } protected bool HasManagePermissionsPermission { get; set; }
public RoleManagementBase() protected bool ShouldShowEntityActions { get; set; }
public RoleManagement()
{ {
ObjectMapperContext = typeof(AbpIdentityBlazorModule); ObjectMapperContext = typeof(AbpIdentityBlazorModule);
LocalizationResource = typeof(IdentityResource); LocalizationResource = typeof(IdentityResource);

8
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor

@ -1,11 +1,13 @@
@page "/identity/users" @page "/identity/users"
@attribute [Authorize(IdentityPermissions.Users.Default)] @attribute [Authorize(IdentityPermissions.Users.Default)]
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Volo.Abp.PermissionManagement.Blazor.Components
@using Microsoft.Extensions.Localization @using Microsoft.Extensions.Localization
@using Volo.Abp.Identity.Localization @using Volo.Abp.Identity.Localization
@using Volo.Abp.PermissionManagement.Blazor.Components
@inherits UserManagementBase @inherits AbpCrudPageBase<IIdentityUserAppService, IdentityUserDto, Guid, GetIdentityUsersInput, IdentityUserCreateDto, IdentityUserUpdateDto>
@inject IStringLocalizer<IdentityResource> L
@inject AbpIdentityBlazorMessageLocalizerHelper<IdentityResource> LH @inject AbpIdentityBlazorMessageLocalizerHelper<IdentityResource> LH
@* ************************* PAGE HEADER ************************* *@ @* ************************* PAGE HEADER ************************* *@
<Row> <Row>

5
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs

@ -4,13 +4,12 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Blazorise; using Blazorise;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Volo.Abp.BlazoriseUI;
using Volo.Abp.Identity.Localization; using Volo.Abp.Identity.Localization;
using Volo.Abp.PermissionManagement.Blazor.Components; using Volo.Abp.PermissionManagement.Blazor.Components;
namespace Volo.Abp.Identity.Blazor.Pages.Identity namespace Volo.Abp.Identity.Blazor.Pages.Identity
{ {
public abstract class UserManagementBase : AbpCrudPageBase<IIdentityUserAppService, IdentityUserDto, Guid, GetIdentityUsersInput, IdentityUserCreateDto, IdentityUserUpdateDto> public partial class UserManagement
{ {
protected const string PermissionProviderName = "U"; protected const string PermissionProviderName = "U";
@ -30,7 +29,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity
protected string EditModalSelectedTab = DefaultSelectedTab; protected string EditModalSelectedTab = DefaultSelectedTab;
public UserManagementBase() public UserManagement()
{ {
ObjectMapperContext = typeof(AbpIdentityBlazorModule); ObjectMapperContext = typeof(AbpIdentityBlazorModule);
LocalizationResource = typeof(IdentityResource); LocalizationResource = typeof(IdentityResource);

2
modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor

@ -1,5 +1,5 @@
@page "/setting-management" @page "/setting-management"
@inherits SettingManagementBase
@* ************************* PAGE HEADER ************************* *@ @* ************************* PAGE HEADER ************************* *@
<PageHeader Title="@L["Settings"]" BreadcrumbItems="@BreadcrumbItems"> <PageHeader Title="@L["Settings"]" BreadcrumbItems="@BreadcrumbItems">

4
modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs

@ -10,7 +10,7 @@ using Volo.Abp.SettingManagement.Localization;
namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement
{ {
public abstract class SettingManagementBase : OwningComponentBase public partial class SettingManagement
{ {
[Inject] [Inject]
protected IServiceProvider ServiceProvider { get; set; } protected IServiceProvider ServiceProvider { get; set; }
@ -44,7 +44,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement
BreadcrumbItems.Add(new BreadcrumbItem(L["Settings"])); BreadcrumbItems.Add(new BreadcrumbItem(L["Settings"]));
} }
protected string GetNormalizedString(string value) protected virtual string GetNormalizedString(string value)
{ {
return value.Replace('.', '_'); return value.Replace('.', '_');
} }

8
modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor

@ -1,11 +1,11 @@
@page "/tenant-management/tenants" @page "/tenant-management/tenants"
@attribute [Authorize(TenantManagementPermissions.Tenants.Default)] @attribute [Authorize(TenantManagementPermissions.Tenants.Default)]
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@using Microsoft.Extensions.Localization
@using Volo.Abp.TenantManagement.Localization
@using Volo.Abp.FeatureManagement.Blazor.Components @using Volo.Abp.FeatureManagement.Blazor.Components
@inherits TenantManagementBase @using Microsoft.AspNetCore.Components.Forms
@inject IStringLocalizer<AbpTenantManagementResource> L
@inherits AbpCrudPageBase<ITenantAppService, TenantDto, Guid, GetTenantsInput, TenantCreateDto, TenantUpdateDto>
@* ************************* PAGE HEADER ************************* *@ @* ************************* PAGE HEADER ************************* *@
<Row> <Row>
<Column ColumnSize="ColumnSize.Is6"> <Column ColumnSize="ColumnSize.Is6">

9
modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs

@ -4,11 +4,11 @@ using Blazorise;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Volo.Abp.BlazoriseUI; using Volo.Abp.BlazoriseUI;
using Volo.Abp.FeatureManagement.Blazor.Components; using Volo.Abp.FeatureManagement.Blazor.Components;
using Volo.Abp.TenantManagement.Localization;
namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement
{ {
public abstract class TenantManagementBase public partial class TenantManagement
: AbpCrudPageBase<ITenantAppService, TenantDto, Guid, GetTenantsInput, TenantCreateDto, TenantUpdateDto>
{ {
protected const string FeatureProviderName = "T"; protected const string FeatureProviderName = "T";
@ -22,9 +22,10 @@ namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement
protected Modal ManageConnectionStringModal; protected Modal ManageConnectionStringModal;
protected TenantInfoModel TenantInfo; protected TenantInfoModel TenantInfo;
public TenantManagementBase() public TenantManagement()
{ {
LocalizationResource = typeof(AbpTenantManagementResource);
ObjectMapperContext = typeof(AbpTenantManagementBlazorModule); ObjectMapperContext = typeof(AbpTenantManagementBlazorModule);
CreatePolicyName = TenantManagementPermissions.Tenants.Create; CreatePolicyName = TenantManagementPermissions.Tenants.Create;

Loading…
Cancel
Save