Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ProviderKeyDisplayName to feature modal #20648

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Modal @ref="Modal" Closing="@ClosingModal">
<ModalContent Size="ModalSize.Large" Centered="true">
<ModalHeader>
<ModalTitle>@L["Features"]</ModalTitle>
<ModalTitle>@L["Features"]@ProviderKeyDisplayName</ModalTitle>
<CloseButton Clicked="CloseModal" />
</ModalHeader>
@if (Groups == null || !Groups.Any())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public partial class FeatureManagementModal

protected string ProviderName;
protected string ProviderKey;
protected string ProviderKeyDisplayName;

protected string SelectedTabName;

Expand All @@ -40,7 +41,7 @@ public partial class FeatureManagementModal

protected Dictionary<string, string> SelectionStringValues;

public virtual async Task OpenAsync([NotNull] string providerName, string providerKey = null)
public virtual async Task OpenAsync([NotNull] string providerName, string providerKey = null, string providerKeyDisplayName = null)
{
try
{
Expand All @@ -50,6 +51,11 @@ public virtual async Task OpenAsync([NotNull] string providerName, string provid
ToggleValues = new Dictionary<string, bool>();
SelectionStringValues = new Dictionary<string, string>();

if (!providerKeyDisplayName.IsNullOrWhiteSpace())
{
ProviderKeyDisplayName = $" - {providerKeyDisplayName}";
}

var result = await FeatureAppService.GetAsync(ProviderName, ProviderKey);

Groups = result?.Groups ?? new List<FeatureGroupDto>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page
@using System.Web
@using Microsoft.AspNetCore.Mvc.Localization
@using Microsoft.Extensions.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
Expand All @@ -23,7 +24,7 @@

<form method="post" asp-page="/FeatureManagement/FeatureManagementModal" data-script-class="abp.modals.FeatureManagement">
<abp-modal id="featureManagmentModal" size="Large">
<abp-modal-header title="@(L["Features"].Value)"></abp-modal-header>
<abp-modal-header title="@(L["Features"].Value + Model.ProviderKeyDisplayName)"></abp-modal-header>
@if (Model.FeatureListResultDto != null && Model.FeatureListResultDto.Groups.Any())
{
var featureGroups = Model.FeatureListResultDto.Groups;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
Expand All @@ -24,6 +25,10 @@ public class FeatureManagementModal : AbpPageModel
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ProviderKey { get; set; }

[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ProviderKeyDisplayName { get; set; }

[BindProperty]
public List<FeatureGroupViewModel> FeatureGroups { get; set; }
Expand Down Expand Up @@ -51,7 +56,10 @@ public FeatureManagementModal(
public virtual async Task<IActionResult> OnGetAsync()
{
ValidateModel();

if (!ProviderKeyDisplayName.IsNullOrWhiteSpace())
{
ProviderKeyDisplayName = " - " + HttpUtility.HtmlEncode(ProviderKeyDisplayName);
}
FeatureListResultDto = await FeatureAppService.GetAsync(ProviderName, ProviderKey);

return Page();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected override ValueTask SetEntityActionsAsync()
Clicked = async (data) =>
{
var tenant = data.As<TenantDto>();
await FeatureManagementModal.OpenAsync(FeatureProviderName, tenant.Id.ToString());
await FeatureManagementModal.OpenAsync(FeatureProviderName, tenant.Id.ToString(), tenant.Name);
}
},
new EntityAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
_featuresModal.open({
providerName: 'T',
providerKey: data.record.id,
providerKeyDisplayName: data.record.name,
});
},
},
Expand Down
Loading