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..d41367d485 --- /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 abstract class AbpAccountComponentBase : AbpComponentBase + { + protected 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 79% 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..a6edb30a64 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"] - + @@ -36,25 +38,25 @@ @L["DisplayName:UserName"] - + @L["DisplayName:Name"] - + @L["DisplayName:Surname"] - + @L["DisplayName:Email"] - + @L["DisplayName:PhoneNumber"] - + 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 4be9f9fbe7..bececf4193 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 async override 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..727a49be5c 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 @@ -17,10 +17,4 @@ - - - true - - - diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/AbpFeatureManagementComponentBase.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/AbpFeatureManagementComponentBase.cs new file mode 100644 index 0000000000..5cb4961072 --- /dev/null +++ b/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); + } + } +} \ No newline at end of file diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor b/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor index 90d2539841..02fdd768a9 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor/Components/FeatureManagementModal.razor @@ -1,6 +1,8 @@ @using Volo.Abp.Validation.StringValues @using Microsoft.Extensions.Localization +@inherits AbpFeatureManagementComponentBase + @@ -9,84 +11,80 @@ - - @if (Groups == null) - { - @L["NoFeatureFoundMessage"] - } - else - { - - - @foreach (var group in Groups) - { - - @group.DisplayName - - } - - - @foreach (var group in Groups) - { - -

@group.DisplayName

- - @foreach (var feature in group.Features) + @if (Groups == null) + { + @L["NoFeatureFoundMessage"] + } + else + { + + + @foreach (var group in Groups) + { + + @group.DisplayName + + } + + + @foreach (var group in Groups) + { + +

@group.DisplayName

+ + @foreach (var feature in group.Features) + { + var disabled = IsDisabled(feature.Provider.Name); + + if (feature.ValueType is FreeTextStringValueType) { - var disabled = IsDisabled(feature.Provider.Name); - - if (feature.ValueType is FreeTextStringValueType) - { - - @feature.DisplayName - - @if (feature.Description != null) + + @feature.DisplayName + + @if (feature.Description != null) + { + @feature.Description + } + + } + + if (feature.ValueType is SelectionStringValueType) + { + var items = ((SelectionStringValueType)feature.ValueType).ItemSource.Items; + + + @feature.DisplayName + - @foreach (var item in items) - { - - @CreateStringLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name) - - } - - - } - - if (feature.ValueType is ToggleStringValueType) - { - - @feature.DisplayName - - } + + + } + + if (feature.ValueType is ToggleStringValueType) + { + + @feature.DisplayName + } - -
- } -
-
- } -
+ } + + + } + +
+ } - + \ No newline at end of file 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 aed44df8bc..c91b7f3892 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 @@ -20,8 +20,6 @@ namespace Volo.Abp.FeatureManagement.Blazor.Components [Inject] protected IUiMessageService UiMessageService { get; set; } - [Inject] protected IStringLocalizer L { get; set; } - [Inject] protected IStringLocalizerFactory HtmlLocalizerFactory { get; set; } [Inject] protected IOptions LocalizationOptions { get; set; } diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor index 353bfa3b6b..946fae64c3 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor +++ b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor @@ -2,12 +2,14 @@ @attribute [Authorize(IdentityPermissions.Roles.Default)] @using Volo.Abp.Identity @using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Forms +@using Volo.Abp.PermissionManagement.Blazor.Components @using Microsoft.Extensions.Localization @using Volo.Abp.Identity.Localization -@using Volo.Abp.PermissionManagement.Blazor.Components -@inherits RoleManagementBase -@inject IStringLocalizer L @inject AbpIdentityBlazorMessageLocalizerHelper LH + +@inherits AbpCrudPageBase + @* ************************* PAGE HEADER ************************* *@ diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs index f64615c1f0..19478cff34 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor.cs +++ b/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 Blazorise; using Microsoft.AspNetCore.Authorization; -using Volo.Abp.BlazoriseUI; using Volo.Abp.Identity.Localization; using Volo.Abp.PermissionManagement.Blazor.Components; namespace Volo.Abp.Identity.Blazor.Pages.Identity { - public abstract class RoleManagementBase : AbpCrudPageBase + public partial class RoleManagement { protected const string PermissionProviderName = "R"; @@ -17,7 +16,9 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity protected bool HasManagePermissionsPermission { get; set; } - public RoleManagementBase() + protected bool ShouldShowEntityActions { get; set; } + + public RoleManagement() { ObjectMapperContext = typeof(AbpIdentityBlazorModule); LocalizationResource = typeof(IdentityResource); diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor index e5ad942275..36db98f78e 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor +++ b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor @@ -1,11 +1,13 @@ @page "/identity/users" @attribute [Authorize(IdentityPermissions.Users.Default)] @using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Forms +@using Volo.Abp.PermissionManagement.Blazor.Components @using Microsoft.Extensions.Localization @using Volo.Abp.Identity.Localization -@using Volo.Abp.PermissionManagement.Blazor.Components -@inherits UserManagementBase -@inject IStringLocalizer L + +@inherits AbpCrudPageBase + @inject AbpIdentityBlazorMessageLocalizerHelper LH @* ************************* PAGE HEADER ************************* *@ diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs index 647246b954..428376d9ef 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs +++ b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs @@ -4,13 +4,12 @@ using System.Linq; using System.Threading.Tasks; using Blazorise; using Microsoft.AspNetCore.Authorization; -using Volo.Abp.BlazoriseUI; using Volo.Abp.Identity.Localization; using Volo.Abp.PermissionManagement.Blazor.Components; namespace Volo.Abp.Identity.Blazor.Pages.Identity { - public abstract class UserManagementBase : AbpCrudPageBase + public partial class UserManagement { protected const string PermissionProviderName = "U"; @@ -30,7 +29,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity protected string EditModalSelectedTab = DefaultSelectedTab; - public UserManagementBase() + public UserManagement() { ObjectMapperContext = typeof(AbpIdentityBlazorModule); LocalizationResource = typeof(IdentityResource); diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor index ce854161ef..cce73cea1f 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor @@ -1,5 +1,5 @@ @page "/setting-management" -@inherits SettingManagementBase + @* ************************* PAGE HEADER ************************* *@ diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs index 749e1449a5..845c196519 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Pages/SettingManagement/SettingManagement.razor.cs +++ b/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 { - public abstract class SettingManagementBase : OwningComponentBase + public partial class SettingManagement { [Inject] protected IServiceProvider ServiceProvider { get; set; } @@ -44,7 +44,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Pages.SettingManagement BreadcrumbItems.Add(new BreadcrumbItem(L["Settings"])); } - protected string GetNormalizedString(string value) + protected virtual string GetNormalizedString(string value) { return value.Replace('.', '_'); } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor index c777bcb50b..81c61ae9fa 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor @@ -1,11 +1,11 @@ @page "/tenant-management/tenants" @attribute [Authorize(TenantManagementPermissions.Tenants.Default)] @using Microsoft.AspNetCore.Authorization -@using Microsoft.Extensions.Localization -@using Volo.Abp.TenantManagement.Localization @using Volo.Abp.FeatureManagement.Blazor.Components -@inherits TenantManagementBase -@inject IStringLocalizer L +@using Microsoft.AspNetCore.Components.Forms + +@inherits AbpCrudPageBase + @* ************************* PAGE HEADER ************************* *@ diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs index b9272ce77f..e5fcc9c4a3 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Pages/TenantManagement/TenantManagement.razor.cs @@ -4,11 +4,11 @@ using Blazorise; using Microsoft.AspNetCore.Authorization; using Volo.Abp.BlazoriseUI; using Volo.Abp.FeatureManagement.Blazor.Components; +using Volo.Abp.TenantManagement.Localization; namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement { - public abstract class TenantManagementBase - : AbpCrudPageBase + public partial class TenantManagement { protected const string FeatureProviderName = "T"; @@ -22,9 +22,10 @@ namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement protected Modal ManageConnectionStringModal; protected TenantInfoModel TenantInfo; - - public TenantManagementBase() + + public TenantManagement() { + LocalizationResource = typeof(AbpTenantManagementResource); ObjectMapperContext = typeof(AbpTenantManagementBlazorModule); CreatePolicyName = TenantManagementPermissions.Tenants.Create;