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 781756dd71..a45aafbe59 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 @@ -78,26 +78,32 @@ { - + @L["NewRole"] - + + + + @L["DisplayName:RoleName"] + + + + + + + - @L["DisplayName:RoleName"] - - - - @L["DisplayName:IsDefault"] - @L["DisplayName:IsPublic"] + @L["DisplayName:IsDefault"] + @L["DisplayName:IsPublic"] - + - + @@ -107,7 +113,7 @@ { - + @L["Edit"] 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 bccf3ddbd8..591707355b 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,5 +1,6 @@ using System; using System.Threading.Tasks; +using Blazorise; using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.BlazoriseUI; @@ -17,6 +18,8 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity protected bool ShouldShowEntityActions { get; set; } + protected Validations ValidationsRef { get; set; } + public RoleManagementBase() { ObjectMapperContext = typeof(AbpIdentityBlazorModule); @@ -38,5 +41,17 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity HasDeletePermission || HasManagePermissionsPermission; } + + protected virtual Task OnCreateEntityClicked() + { + if ( ValidationsRef.ValidateAll() ) + { + CreateModal.Hide(); + + return CreateEntityAsync(); + } + + return Task.CompletedTask; + } } }