diff --git a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs index eb9cab5a73..c9e8f23b1f 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs @@ -15,6 +15,7 @@ using Volo.Abp.Application.Services; using Volo.Abp.AspNetCore.Components; using Volo.Abp.AspNetCore.Components.WebAssembly; using Volo.Abp.Authorization; +using Volo.Abp.BlazoriseUI.Components; using Volo.Abp.ObjectMapping; namespace Volo.Abp.BlazoriseUI @@ -170,7 +171,6 @@ namespace Volo.Abp.BlazoriseUI where TUpdateViewModel : class, new() { [Inject] protected TAppService AppService { get; set; } - [Inject] protected IUiMessageService UiMessageService { get; set; } [Inject] protected IStringLocalizer UiLocalizer { get; set; } [Inject] protected IAuthorizationService AuthorizationService { get; set; } @@ -189,6 +189,7 @@ namespace Volo.Abp.BlazoriseUI protected Validations CreateValidationsRef; protected Validations EditValidationsRef; protected List BreadcrumbItems = new List(2); + protected DataGridEntityActionsColumn EntityActionsColumn; protected string CreatePolicyName { get; set; } protected string UpdatePolicyName { get; set; } @@ -281,9 +282,7 @@ namespace Volo.Abp.BlazoriseUI protected virtual async Task OpenCreateModalAsync() { - await OnOpeningCreateModalAsync(); - - CreateValidationsRef.ClearAll(); + CreateValidationsRef?.ClearAll(); await CheckCreatePolicyAsync(); @@ -296,11 +295,6 @@ namespace Volo.Abp.BlazoriseUI CreateModal.Show(); } - protected virtual Task OnOpeningCreateModalAsync() - { - return Task.CompletedTask; - } - protected virtual Task CloseCreateModalAsync() { CreateModal.Hide(); @@ -309,9 +303,7 @@ namespace Volo.Abp.BlazoriseUI protected virtual async Task OpenEditModalAsync(TKey id) { - await OnOpeningEditModalAsync(id); - - EditValidationsRef.ClearAll(); + EditValidationsRef?.ClearAll(); await CheckUpdatePolicyAsync(); @@ -325,11 +317,6 @@ namespace Volo.Abp.BlazoriseUI EditModal.Show(); } - protected virtual Task OnOpeningEditModalAsync(TKey id) - { - return Task.CompletedTask; - } - protected virtual TUpdateViewModel MapToEditingEntity(TGetOutputDto entityDto) { return ObjectMapper.Map(entityDto); @@ -363,7 +350,7 @@ namespace Volo.Abp.BlazoriseUI protected virtual async Task CreateEntityAsync() { - if (CreateValidationsRef.ValidateAll()) + if (CreateValidationsRef?.ValidateAll() ?? false) { await OnCreatingEntityAsync(); @@ -390,7 +377,7 @@ namespace Volo.Abp.BlazoriseUI protected virtual async Task UpdateEntityAsync() { - if (EditValidationsRef.ValidateAll()) + if (EditValidationsRef?.ValidateAll() ?? false) { await OnUpdatingEntityAsync(); @@ -419,11 +406,6 @@ namespace Volo.Abp.BlazoriseUI { await CheckDeletePolicyAsync(); - if (!await UiMessageService.ConfirmAsync(GetDeleteConfirmationMessage(entity))) - { - return; - } - await AppService.DeleteAsync(entity.Id); await GetEntitiesAsync(); } diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/ActionType.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/ActionType.cs new file mode 100644 index 0000000000..8f6afd69c9 --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/ActionType.cs @@ -0,0 +1,8 @@ +namespace Volo.Abp.BlazoriseUI.Components +{ + public enum ActionType + { + Dropdown, + Button + } +} diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/DataGridEntityActionsColumn.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/DataGridEntityActionsColumn.cs new file mode 100644 index 0000000000..f41ec63e2c --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/DataGridEntityActionsColumn.cs @@ -0,0 +1,30 @@ +using System.Linq; +using System.Threading.Tasks; +using Blazorise.DataGrid; +using Localization.Resources.AbpUi; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Localization; + +namespace Volo.Abp.BlazoriseUI.Components +{ + public class DataGridEntityActionsColumn : DataGridColumn + { + [Inject] + public IStringLocalizer UiLocalizer { get; set; } + + protected override async Task OnInitializedAsync() + { + await base.OnInitializedAsync(); + await SetDefaultValuesAsync(); + } + + protected virtual ValueTask SetDefaultValuesAsync() + { + Caption = UiLocalizer["Actions"]; + Width = "150px"; + Sortable = false; + Field = typeof(TItem).GetProperties().First().Name; + return ValueTask.CompletedTask; + } + } +} diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor new file mode 100644 index 0000000000..99e0383fdc --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor @@ -0,0 +1,21 @@ +@typeparam TItem +@using Blazorise + +@if (ParentActions.Type == ActionType.Dropdown) +{ + if (IsVisible && Primary == false) + { + @Text + } +} +else +{ + if (IsVisible) + { + + @Text + + } +} diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs new file mode 100644 index 0000000000..a7680edc81 --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs @@ -0,0 +1,75 @@ +using System; +using System.Threading.Tasks; +using Blazorise; +using Localization.Resources.AbpUi; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Localization; +using Volo.Abp.AspNetCore.Components.WebAssembly; + +namespace Volo.Abp.BlazoriseUI.Components +{ + public partial class EntityAction : ComponentBase + { + internal bool IsVisible = true; + + [Parameter] + public string Text { get; set; } + + [Parameter] + public bool Primary { get; set; } + + [Parameter] + public EventCallback Clicked { get; set; } + + [Parameter] + public string RequiredPolicy { get; set; } + + [Parameter] + public Color Color { get; set; } + + [Parameter] + public Func ConfirmationMessage { get; set; } + + [CascadingParameter] + public EntityActions ParentActions { get; set; } + + [Inject] + protected IAuthorizationService AuthorizationService { get; set; } + + [Inject] + protected IUiMessageService UiMessageService { get; set; } + + protected async override Task OnInitializedAsync() + { + await base.OnInitializedAsync(); + await SetDefaultValuesAsync(); + if (!RequiredPolicy.IsNullOrEmpty()) + { + IsVisible = await AuthorizationService.IsGrantedAsync(RequiredPolicy); + } + ParentActions.AddAction(this); + } + + protected internal virtual async Task ActionClickedAsync() + { + if (ConfirmationMessage != null) + { + if (await UiMessageService.ConfirmAsync(ConfirmationMessage())) + { + await Clicked.InvokeAsync(); + } + } + else + { + await Clicked.InvokeAsync(); + } + } + + protected virtual ValueTask SetDefaultValuesAsync() + { + Color = Color.Primary; + return ValueTask.CompletedTask; + } + } +} diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor new file mode 100644 index 0000000000..d445d102d3 --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor @@ -0,0 +1,30 @@ +@typeparam TItem + + @if (Type == ActionType.Dropdown) + { + + @if (HasPrimaryAction) + { + + @PrimaryAction.Text + + + } + else + { + + @ToggleText + + } + + @ChildContent + + + } + else + { + @ChildContent + } + \ No newline at end of file diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs new file mode 100644 index 0000000000..0d058904c4 --- /dev/null +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/EntityActions.razor.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Blazorise; +using Localization.Resources.AbpUi; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.Localization; + +namespace Volo.Abp.BlazoriseUI.Components +{ + public partial class EntityActions : ComponentBase + { + protected readonly List> Actions = new List>(); + protected bool HasPrimaryAction => Actions.Any(t => t.Primary); + protected EntityAction PrimaryAction => Actions.FirstOrDefault(t => t.Primary); + protected internal ActionType Type => Actions.Count(t => t.IsVisible) > 1 ? ActionType.Dropdown : ActionType.Button; + + [Parameter] + public Color ToggleColor { get; set; } = Color.Primary; + + [Parameter] + public string ToggleText { get; set; } + + [Parameter] + public RenderFragment ChildContent { get; set; } + + [Parameter] + public DataGridEntityActionsColumn EntityActionsColumn { get; set; } + + [Inject] + public IStringLocalizer UiLocalizer { get; set; } + + internal void AddAction(EntityAction action) + { + Actions.Add(action); + if (EntityActionsColumn != null) + { + EntityActionsColumn.Displayable = Actions.Any(t => t.IsVisible); + } + StateHasChanged(); + } + + protected override void OnInitialized() + { + base.OnInitialized(); + ToggleText = UiLocalizer["Actions"]; + } + } +} 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 f9d2375dc5..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 @@ -1,5 +1,5 @@ @page "/identity/roles" -@attribute [Authorize( IdentityPermissions.Roles.Default )] +@attribute [Authorize(IdentityPermissions.Roles.Default)] @using Volo.Abp.Identity @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Components.Forms @@ -16,7 +16,7 @@ @L["Roles"] - @if ( HasCreatePermission ) + @if (HasCreatePermission) { @@ -33,40 +33,33 @@ ShowPager="true" PageSize="PageSize"> - @if ( ShouldShowEntityActions ) - { - - - - - @L["Actions"] - - - @if ( HasUpdatePermission ) - { - @L["Edit"] - } - @if ( HasManagePermissionsPermission ) - { - @L["Permissions"] - } - @if ( HasDeletePermission ) - { - @L["Delete"] - } - - - - - } + + + + + + + + + - @(context.As().Name) - @if ( context.As().IsDefault ) + @(context.Name) + @if (context.IsDefault) { @L["DisplayName:IsDefault"] } - @if ( context.As().IsPublic ) + @if (context.IsPublic) { @L["DisplayName:IsPublic"] } @@ -76,42 +69,42 @@ @* ************************* CREATE MODAL ************************* *@ -@if ( HasCreatePermission ) +@if (HasCreatePermission) { - - - - - @L["NewRole"] - - - - - - - @L["DisplayName:RoleName"] - - - - - - - + + + + + @L["NewRole"] + + + + + - @L["DisplayName:IsDefault"] - @L["DisplayName:IsPublic"] + @L["DisplayName:RoleName"] + + + + + - - - - - - - - + + + @L["DisplayName:IsDefault"] + @L["DisplayName:IsPublic"] + + + + + + + + + } @* ************************* EDIT MODAL ************************* *@ -@if ( HasUpdatePermission ) +@if (HasUpdatePermission) { 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 9c8151dcdd..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 @@ -12,6 +12,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity protected const string PermissionProviderName = "R"; protected PermissionManagementModal PermissionManagementModal; + protected string ManagePermissionsPolicyName; protected bool HasManagePermissionsPermission { get; set; } @@ -25,19 +26,12 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity CreatePolicyName = IdentityPermissions.Roles.Create; UpdatePolicyName = IdentityPermissions.Roles.Update; DeletePolicyName = IdentityPermissions.Roles.Delete; + ManagePermissionsPolicyName = IdentityPermissions.Roles.ManagePermissions; } - protected async override Task SetPermissionsAsync() + protected override string GetDeleteConfirmationMessage(IdentityRoleDto entity) { - await base.SetPermissionsAsync(); - - HasManagePermissionsPermission = await AuthorizationService.IsGrantedAsync( - IdentityPermissions.Roles.ManagePermissions - ); - - ShouldShowEntityActions = HasUpdatePermission || - HasDeletePermission || - HasManagePermissionsPermission; + return string.Format(L["RoleDeletionConfirmationMessage"], entity.Name); } } } 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 f8f6262c98..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,5 +1,5 @@ @page "/identity/users" -@attribute [Authorize( IdentityPermissions.Users.Default )] +@attribute [Authorize(IdentityPermissions.Users.Default)] @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Components.Forms @using Volo.Abp.PermissionManagement.Blazor.Components @@ -15,7 +15,7 @@

@L["Users"]

- @if ( HasCreatePermission ) + @if (HasCreatePermission) { @@ -32,33 +32,25 @@ ShowPager="true" PageSize="PageSize"> - @if ( ShouldShowEntityActions ) - { - - - - - @L["Actions"] - - - @if ( HasUpdatePermission ) - { - @L["Edit"] - } - @if ( HasManagePermissionsPermission ) - { - @L["Permissions"] - } - @if ( HasDeletePermission ) - { - - @L["Delete"] - } - - - - - } + + + + + + + + + @(context.As().UserName) @@ -78,7 +70,7 @@ @* ************************* CREATE MODAL ************************* *@ -@if ( HasCreatePermission ) +@if (HasCreatePermission) { @@ -161,9 +153,9 @@ - @if ( NewUserRoles != null ) + @if (NewUserRoles != null) { - @foreach ( var role in NewUserRoles ) + @foreach (var role in NewUserRoles) { @@ -185,7 +177,7 @@ } @* ************************* EDIT MODAL ************************* *@ -@if ( HasUpdatePermission ) +@if (HasUpdatePermission) { @@ -270,9 +262,9 @@ - @if ( EditUserRoles != null ) + @if (EditUserRoles != null) { - @foreach ( var role in EditUserRoles ) + @foreach (var role in EditUserRoles) { 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 8246bcaf06..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 @@ -23,8 +23,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity protected AssignedRoleViewModel[] EditUserRoles; - protected bool ShouldShowEntityActions { get; set; } - protected bool HasManagePermissionsPermission { get; set; } + protected string ManagePermissionsPolicyName; protected string CreateModalSelectedTab = DefaultSelectedTab; @@ -38,6 +37,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity CreatePolicyName = IdentityPermissions.Users.Create; UpdatePolicyName = IdentityPermissions.Users.Update; DeletePolicyName = IdentityPermissions.Users.Delete; + ManagePermissionsPolicyName = IdentityPermissions.Users.ManagePermissions; } protected async override Task OnInitializedAsync() @@ -47,20 +47,8 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity Roles = (await AppService.GetAssignableRolesAsync()).Items; } - protected async override Task SetPermissionsAsync() - { - await base.SetPermissionsAsync(); - - HasManagePermissionsPermission = await AuthorizationService.IsGrantedAsync( - IdentityPermissions.Users.ManagePermissions - ); - - ShouldShowEntityActions = HasUpdatePermission || - HasDeletePermission || - HasManagePermissionsPermission; - } - protected override async Task OnOpeningCreateModalAsync() + protected override Task OpenCreateModalAsync() { CreateModalSelectedTab = DefaultSelectedTab; @@ -70,7 +58,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity IsAssigned = x.IsDefault }).ToArray(); - await base.OnOpeningCreateModalAsync(); + return base.OpenCreateModalAsync(); } protected override Task OnCreatingEntityAsync() @@ -93,7 +81,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity IsAssigned = userRoleNames.Contains(x.Name) }).ToArray(); - await base.OnOpeningEditModalAsync(id); + await base.OpenEditModalAsync(id); } protected override Task OnUpdatingEntityAsync() @@ -103,6 +91,11 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity return base.OnUpdatingEntityAsync(); } + + protected override string GetDeleteConfirmationMessage(IdentityUserDto entity) + { + return string.Format(L["UserDeletionConfirmationMessage"], entity.UserName); + } } public class AssignedRoleViewModel diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor/_Imports.razor b/modules/identity/src/Volo.Abp.Identity.Blazor/_Imports.razor index bcb4626f1f..51955030c9 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor/_Imports.razor +++ b/modules/identity/src/Volo.Abp.Identity.Blazor/_Imports.razor @@ -2,5 +2,6 @@ @using Volo.Abp.AspNetCore.Components.WebAssembly @using Microsoft.AspNetCore.Components.Forms @using Volo.Abp.BlazoriseUI +@using Volo.Abp.BlazoriseUI.Components @using Blazorise @using Blazorise.DataGrid 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 107522c8e0..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 @@ -29,40 +29,32 @@ ShowPager="true" PageSize="PageSize"> - @if (ShouldShowEntityActions) - { - - - - - @L["Actions"] - - - @if (HasUpdatePermission) - { - @L["Edit"] - } - @if (HasManageConnectionStringsPermission) - { - @L["ConnectionStrings"] - } - @if (HasManageFeaturesPermission) - { - @L["Features"] - } - @if (HasDeletePermission) - { - - @L["Delete"] - } - - - - - } + + + + + + + + + + - @(context.As().Name) + @(context.Name) 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 4324bb40e5..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 @@ -11,13 +11,14 @@ namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement public partial class TenantManagement { protected const string FeatureProviderName = "T"; - - protected bool ShouldShowEntityActions; + protected bool HasManageConnectionStringsPermission; protected bool HasManageFeaturesPermission; + protected string ManageConnectionStringsPolicyName; + protected string ManageFeaturesPolicyName; protected FeatureManagementModal FeatureManagementModal; - + protected Modal ManageConnectionStringModal; protected TenantInfoModel TenantInfo; @@ -30,7 +31,9 @@ namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement CreatePolicyName = TenantManagementPermissions.Tenants.Create; UpdatePolicyName = TenantManagementPermissions.Tenants.Update; DeletePolicyName = TenantManagementPermissions.Tenants.Delete; - + ManageConnectionStringsPolicyName = TenantManagementPermissions.Tenants.ManageConnectionStrings; + ManageFeaturesPolicyName = TenantManagementPermissions.Tenants.ManageFeatures; + TenantInfo = new TenantInfoModel(); } @@ -38,29 +41,24 @@ namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement { await base.SetPermissionsAsync(); - HasManageConnectionStringsPermission = await AuthorizationService.IsGrantedAsync(TenantManagementPermissions.Tenants.ManageConnectionStrings); - HasManageFeaturesPermission = await AuthorizationService.IsGrantedAsync(TenantManagementPermissions.Tenants.ManageFeatures); - - ShouldShowEntityActions = HasUpdatePermission || - HasDeletePermission || - HasManageConnectionStringsPermission || - HasManageFeaturesPermission; + HasManageConnectionStringsPermission = await AuthorizationService.IsGrantedAsync(ManageConnectionStringsPolicyName); + HasManageFeaturesPermission = await AuthorizationService.IsGrantedAsync(ManageFeaturesPolicyName); } protected virtual async Task OpenEditConnectionStringModalAsync(Guid id) { var tenantConnectionString = await AppService.GetDefaultConnectionStringAsync(id); - + TenantInfo = new TenantInfoModel { Id = id, DefaultConnectionString = tenantConnectionString, UseSharedDatabase = tenantConnectionString.IsNullOrWhiteSpace() }; - + ManageConnectionStringModal.Show(); } - + protected virtual Task CloseEditConnectionStringModal() { ManageConnectionStringModal.Hide(); @@ -69,7 +67,7 @@ namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement protected virtual async Task UpdateConnectionStringAsync() { - await CheckPolicyAsync(TenantManagementPermissions.Tenants.ManageConnectionStrings); + await CheckPolicyAsync(ManageConnectionStringsPolicyName); if (TenantInfo.UseSharedDatabase || TenantInfo.DefaultConnectionString.IsNullOrWhiteSpace()) { @@ -79,9 +77,14 @@ namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement { await AppService.UpdateDefaultConnectionStringAsync(TenantInfo.Id, TenantInfo.DefaultConnectionString); } - + ManageConnectionStringModal.Hide(); } + + protected override string GetDeleteConfirmationMessage(TenantDto entity) + { + return string.Format(L["TenantDeletionConfirmationMessage"], entity.Name); + } } public class TenantInfoModel @@ -89,7 +92,7 @@ namespace Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement public Guid Id { get; set; } public bool UseSharedDatabase { get; set; } - + public string DefaultConnectionString { get; set; } } } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/_Imports.razor b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/_Imports.razor index bcb4626f1f..51955030c9 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/_Imports.razor +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/_Imports.razor @@ -2,5 +2,6 @@ @using Volo.Abp.AspNetCore.Components.WebAssembly @using Microsoft.AspNetCore.Components.Forms @using Volo.Abp.BlazoriseUI +@using Volo.Abp.BlazoriseUI.Components @using Blazorise @using Blazorise.DataGrid