Merge pull request #905 from abpframework/Feature-management-modal

Feature management modal
pull/926/head
Halil İbrahim Kalkan 6 years ago committed by GitHub
commit 01094c8e3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,20 @@
using System.Collections.Generic;
using Volo.Abp.Validation.StringValues;
namespace Volo.Abp.FeatureManagement
{
public class FeatureDto
{
public string Name { get; set; }
public string Value { get; set; }
public string Description { get; set; }
public IStringValueType ValueType { get; set; }
public int Depth { get; set; }
public string ParentName { get; set; }
}
}

@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Volo.Abp.FeatureManagement
{
public class FeatureListDto
{
public List<FeatureDto> Features { get; set; }
}
}

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp.Application.Services;
namespace Volo.Abp.FeatureManagement
{
public interface IFeatureAppService : IApplicationService
{
Task<FeatureListDto> GetAsync([NotNull] string providerName, [NotNull] string providerKey);
Task UpdateAsync([NotNull] string providerName, [NotNull] string providerKey, UpdateFeaturesDto input);
}
}

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Volo.Abp.FeatureManagement
{
public class UpdateFeatureDto
{
public string Name { get; set; }
public string Value { get; set; }
}
}

@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Volo.Abp.FeatureManagement
{
public class UpdateFeaturesDto
{
public List<UpdateFeatureDto> Features { get; set; }
}
}

@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using Volo.Abp.Application.Services;
using Volo.Abp.Features;
namespace Volo.Abp.FeatureManagement
{
[Authorize]
public class FeatureAppService : ApplicationService, IFeatureAppService
{
protected FeatureManagementOptions Options { get; }
private readonly IFeatureManager _featureManager;
private readonly IFeatureDefinitionManager _featureDefinitionManager;
private readonly IStringLocalizerFactory _stringLocalizerFactory;
public FeatureAppService(IFeatureManager featureManager,
IFeatureDefinitionManager featureDefinitionManager,
IStringLocalizerFactory stringLocalizerFactory,
IOptions<FeatureManagementOptions> options)
{
_featureManager = featureManager;
_featureDefinitionManager = featureDefinitionManager;
_stringLocalizerFactory = stringLocalizerFactory;
Options = options.Value;
}
public async Task<FeatureListDto> GetAsync([NotNull] string providerName, [NotNull] string providerKey)
{
await CheckProviderPolicy(providerName);
var featureDefinitions = _featureDefinitionManager.GetAll();
var features = new List<FeatureDto>();
foreach (var featureDefinition in featureDefinitions)
{
features.Add(new FeatureDto
{
Name = featureDefinition.Name,
ValueType = featureDefinition.ValueType,
Description = featureDefinition.Description.Localize(_stringLocalizerFactory),
ParentName = featureDefinition.Parent?.Name,
Value = await _featureManager.GetOrNullAsync(featureDefinition.Name, providerName, providerKey)
});
}
SetFeatureDepth(features, providerName, providerKey);
return new FeatureListDto { Features = features };
}
public async Task UpdateAsync([NotNull] string providerName, [NotNull] string providerKey, UpdateFeaturesDto input)
{
await CheckProviderPolicy(providerName);
foreach (var feature in input.Features)
{
await _featureManager.SetAsync(feature.Name, feature.Value, providerName, providerKey);
}
}
private void SetFeatureDepth(List<FeatureDto> features, string providerName, string providerKey,
FeatureDto parentFeature = null, int depth = 0)
{
foreach (var feature in features)
{
if ((parentFeature == null && feature.ParentName == null) || (parentFeature != null && parentFeature.Name == feature.ParentName))
{
feature.Depth = depth;
SetFeatureDepth(features, providerName, providerKey, feature, depth + 1);
}
}
}
protected virtual async Task CheckProviderPolicy(string providerName)
{
var policyName = Options.ProviderPolicies.GetOrDefault(providerName);
if (policyName.IsNullOrEmpty())
{
throw new AbpException($"No policy defined to get/set permissions for the provider '{policyName}'. Use {nameof(FeatureManagementOptions)} to map the policy.");
}
await AuthorizationService.CheckAsync(policyName);
}
}
}

@ -21,7 +21,6 @@ namespace Volo.Abp.FeatureManagement
{
options.Providers.Add<DefaultValueFeatureManagementProvider>();
options.Providers.Add<EditionFeatureManagementProvider>();
options.Providers.Add<TenantFeatureManagementProvider>();
});
Configure<VirtualFileSystemOptions>(options =>

@ -1,4 +1,5 @@
using Volo.Abp.Collections;
using System.Collections.Generic;
using Volo.Abp.Collections;
namespace Volo.Abp.FeatureManagement
{
@ -6,9 +7,12 @@ namespace Volo.Abp.FeatureManagement
{
public ITypeList<IFeatureManagementProvider> Providers { get; }
public Dictionary<string, string> ProviderPolicies { get; }
public FeatureManagementOptions()
{
Providers = new TypeList<IFeatureManagementProvider>();
ProviderPolicies = new Dictionary<string, string>();
}
}
}

@ -0,0 +1,60 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Abp.FeatureManagement.Localization
@using Volo.Abp.Validation.StringValues
@using Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement
@model FeatureManagementModal
@inject IHtmlLocalizer<AbpFeatureManagementResource> L
@{
Layout = null;
}
<form method="post" asp-page="/FeatureManagement/FeatureManagementModal" data-script-class="abp.modals.FeatureManagement">
<abp-modal size="Large">
<abp-modal-header title="@(L["Features"].Value)"></abp-modal-header>
<abp-modal-body class="ml-4">
<input asp-for="@Model.ProviderKey" />
<input asp-for="@Model.ProviderName" />
@for (var i = 0; i < Model.FeatureListDto.Features.Count; i++)
{
var feature = Model.FeatureListDto.Features[i];
<div class="mt-2" style="padding-left: @(feature.Depth * 20)px">
<spam class="mr-2">@feature.Name</spam>
<input type="text" name="Features[@i].Type" value="@feature.ValueType.Name" hidden />
@if (feature.ValueType is FreeTextStringValueType)
{
<input type="text" name="Features[@i].Name" value="@feature.Name" hidden />
<input type="text" name="Features[@i].Value" value="@feature.Value" />
}
@if (feature.ValueType is SelectionStringValueType)
{
<input type="text" name="Features[@i].Name" value="@feature.Name" hidden />
<select name="Features[@i].Value">
@foreach (var item in (feature.ValueType as SelectionStringValueType).ItemSource.Items)
{
if (item.Value == feature.Value)
{
<option value="@item.Value" selected="selected"> @L.GetString(item.DisplayText.Name) </option>
}
else
{
<option value="@item.Value"> @L.GetString(item.DisplayText.Name) </option>
}
}
</select>
}
@if (feature.ValueType is ToggleStringValueType)
{
<input type="text" name="Features[@i].Name" value="@feature.Name" hidden />
<input type="checkbox" class="FeatureValueCheckbox" name="Features[@i].BoolValue" value="@feature.Value"
@Html.Raw(feature.Value == "True" ? "checked" : "") />
}
</div>
}
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>
</form>

@ -0,0 +1,75 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Abp.Validation.StringValues;
namespace Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement
{
public class FeatureManagementModal : AbpPageModel
{
[Required]
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ProviderName { get; set; }
[Required]
[HiddenInput]
[BindProperty(SupportsGet = true)]
public string ProviderKey { get; set; }
[BindProperty]
public List<FeatureViewModel> Features { get; set; }
public FeatureListDto FeatureListDto { get; set; }
private readonly IFeatureAppService _featureAppService;
public FeatureManagementModal(IFeatureAppService featureAppService)
{
_featureAppService = featureAppService;
}
public async Task OnGetAsync()
{
FeatureListDto = await _featureAppService.GetAsync(ProviderName, ProviderKey);
}
public async Task<IActionResult> OnPostAsync()
{
var features = new UpdateFeaturesDto
{
Features = Features.Select(f => new UpdateFeatureDto
{
Name = f.Name,
Value = f.Type == nameof(ToggleStringValueType) ? f.BoolValue.ToString() : f.Value
}).ToList()
};
await _featureAppService.UpdateAsync(ProviderName, ProviderKey, features);
return NoContent();
}
public class ProviderInfoViewModel
{
public string ProviderName { get; set; }
public string ProviderKey { get; set; }
}
public class FeatureViewModel
{
public string Name { get; set; }
public string Value { get; set; }
public bool BoolValue { get; set; }
public string Type { get; set; }
}
}
}

@ -0,0 +1,17 @@
var abp = abp || {};
(function ($) {
abp.modals = abp.modals || {};
abp.modals.FeatureManagement = function () {
$('.FeatureValueCheckbox').change(function () {
if (this.checked) {
$(this).val("true");
}
else {
$(this).val("false");
}
});
};
})(jQuery);

@ -11,19 +11,17 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="wwwroot\**\*.*" />
<EmbeddedResource Include="Pages\**\*.cshtml" Exclude="*.cs" />
<EmbeddedResource Include="Pages\**\*.cshtml" />
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Localization\Resources\**\*.json" />
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\**\*.*" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Localization\Resources\**\*.json" />
<Content Remove="Properties\launchSettings.json" />
<None Include="Properties\launchSettings.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj" />

@ -25,14 +25,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TenantManagement.W
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TenantManagement.Application.Tests", "test\Volo.Abp.TenantManagement.Application.Tests\Volo.Abp.TenantManagement.Application.Tests.csproj", "{72445B2D-07FA-4A35-A3D6-FF4ACE299BF4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.TenantManagement.EntityFrameworkCore.Tests", "test\Volo.Abp.TenantManagement.EntityFrameworkCore.Tests\Volo.Abp.TenantManagement.EntityFrameworkCore.Tests.csproj", "{A2BB8897-EBDB-46BB-B885-F8635B21F376}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TenantManagement.EntityFrameworkCore.Tests", "test\Volo.Abp.TenantManagement.EntityFrameworkCore.Tests\Volo.Abp.TenantManagement.EntityFrameworkCore.Tests.csproj", "{A2BB8897-EBDB-46BB-B885-F8635B21F376}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.TenantManagement.MongoDB", "src\Volo.Abp.TenantManagement.MongoDB\Volo.Abp.TenantManagement.MongoDB.csproj", "{ED95242E-3C31-4A89-9C62-93B306EFEB15}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TenantManagement.MongoDB", "src\Volo.Abp.TenantManagement.MongoDB\Volo.Abp.TenantManagement.MongoDB.csproj", "{ED95242E-3C31-4A89-9C62-93B306EFEB15}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.TenantManagement.MongoDB.Tests", "test\Volo.Abp.TenantManagement.MongoDB.Tests\Volo.Abp.TenantManagement.MongoDB.Tests.csproj", "{F75B4C54-A5F1-4101-99F5-A5B868A5146B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TenantManagement.MongoDB.Tests", "test\Volo.Abp.TenantManagement.MongoDB.Tests\Volo.Abp.TenantManagement.MongoDB.Tests.csproj", "{F75B4C54-A5F1-4101-99F5-A5B868A5146B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.TenantManagement.TestBase", "test\Volo.Abp.TenantManagement.TestBase\Volo.Abp.TenantManagement.TestBase.csproj", "{C3BAD6E8-00CD-4283-9416-64287BB5B265}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.FeatureManagement.Domain.TenantManagement", "src\Volo.Abp.FeatureManagement.Domain.TenantManagement\Volo.Abp.FeatureManagement.Domain.TenantManagement.csproj", "{7A5E7998-62CF-418B-A452-0FCB4CB853CC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -91,6 +93,10 @@ Global
{C3BAD6E8-00CD-4283-9416-64287BB5B265}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3BAD6E8-00CD-4283-9416-64287BB5B265}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3BAD6E8-00CD-4283-9416-64287BB5B265}.Release|Any CPU.Build.0 = Release|Any CPU
{7A5E7998-62CF-418B-A452-0FCB4CB853CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A5E7998-62CF-418B-A452-0FCB4CB853CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A5E7998-62CF-418B-A452-0FCB4CB853CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A5E7998-62CF-418B-A452-0FCB4CB853CC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -109,6 +115,7 @@ Global
{ED95242E-3C31-4A89-9C62-93B306EFEB15} = {799CA525-4748-421A-9892-05C68BB2FA13}
{F75B4C54-A5F1-4101-99F5-A5B868A5146B} = {C6941869-A9FC-4BEA-AD3F-C1E104826ECA}
{C3BAD6E8-00CD-4283-9416-64287BB5B265} = {C6941869-A9FC-4BEA-AD3F-C1E104826ECA}
{7A5E7998-62CF-418B-A452-0FCB4CB853CC} = {799CA525-4748-421A-9892-05C68BB2FA13}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7C258726-2CE0-44D3-A2D7-71812E8F505C}

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.TenantManagement.Domain.Shared\Volo.Abp.TenantManagement.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\feature-management\src\Volo.Abp.FeatureManagement.Domain\Volo.Abp.FeatureManagement.Domain.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,18 @@
using Volo.Abp.Features;
using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement.TenantManagement
{
public class AbpFeatureManagementDomainTenantManagementModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<FeatureManagementOptions>(options =>
{
options.Providers.Add<TenantFeatureManagementProvider>();
options.ProviderPolicies[TenantFeatureValueProvider.ProviderName] = "AbpTenantManagement.Tenants.ManageFeatures";
});
}
}
}

@ -11,7 +11,7 @@ namespace Volo.Abp.FeatureManagement
protected ICurrentTenant CurrentTenant { get; }
public TenantFeatureManagementProvider(
IFeatureManagementStore store,
IFeatureManagementStore store,
ICurrentTenant currentTenant)
: base(store)
{

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
@ -15,6 +15,7 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.TenantManagement.Domain.Shared\Volo.Abp.TenantManagement.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\feature-management\src\Volo.Abp.FeatureManagement.Application.Contracts\Volo.Abp.FeatureManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj" />
</ItemGroup>

@ -1,6 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Application;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.TenantManagement.Localization;
@ -10,6 +11,7 @@ namespace Volo.Abp.TenantManagement
{
[DependsOn(typeof(AbpDddApplicationModule))]
[DependsOn(typeof(AbpTenantManagementDomainSharedModule))]
[DependsOn(typeof(AbpFeatureManagementApplicationContractsModule))]
public class AbpTenantManagementApplicationContractsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

@ -8,12 +8,13 @@ namespace Volo.Abp.TenantManagement
{
public override void Define(IPermissionDefinitionContext context)
{
var identityGroup = context.AddGroup(TenantManagementPermissions.GroupName, L("Permission:TenantManagement"));
var tenantManagementGroup = context.AddGroup(TenantManagementPermissions.GroupName, L("Permission:TenantManagement"));
var rolesPermission = identityGroup.AddPermission(TenantManagementPermissions.Tenants.Default, L("Permission:TenantManagement"));
rolesPermission.AddChild(TenantManagementPermissions.Tenants.Create, L("Permission:Create"));
rolesPermission.AddChild(TenantManagementPermissions.Tenants.Update, L("Permission:Edit"));
rolesPermission.AddChild(TenantManagementPermissions.Tenants.Delete, L("Permission:Delete"));
var tenantsPermission = tenantManagementGroup.AddPermission(TenantManagementPermissions.Tenants.Default, L("Permission:TenantManagement"));
tenantsPermission.AddChild(TenantManagementPermissions.Tenants.Create, L("Permission:Create"));
tenantsPermission.AddChild(TenantManagementPermissions.Tenants.Update, L("Permission:Edit"));
tenantsPermission.AddChild(TenantManagementPermissions.Tenants.Delete, L("Permission:Delete"));
tenantsPermission.AddChild(TenantManagementPermissions.Tenants.ManageFeatures, L("Permission:ManageFeatures"));
}
private static LocalizableString L(string name)

@ -4,6 +4,7 @@
"Permission:TenantManagement": "Tenant management",
"Permission:Create": "Create",
"Permission:Edit": "Edit",
"Permission:Delete": "Delete"
"Permission:Delete": "Delete",
"Permission:ManageFeatures": "Manage features"
}
}

@ -4,6 +4,7 @@
"Permission:TenantManagement": "Müşteri yönetimi",
"Permission:Create": "Oluşturma",
"Permission:Edit": "Düzenleme",
"Permission:Delete": "Silme"
"Permission:Delete": "Silme",
"Permission:ManageFeatures": "Özellikleri yönet"
}
}

@ -10,6 +10,7 @@
public const string Create = Default + ".Create";
public const string Update = Default + ".Update";
public const string Delete = Default + ".Delete";
public const string ManageFeatures = Default + ".ManageFeatures";
}
}
}

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\common.props" />
@ -16,8 +16,9 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.TenantManagement.Application.Contracts\Volo.Abp.TenantManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\Volo.Abp.TenantManagement.Domain\Volo.Abp.TenantManagement.Domain.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.UI\Volo.Abp.UI.csproj" />
<ProjectReference Include="..\..\..\feature-management\src\Volo.Abp.FeatureManagement.Application\Volo.Abp.FeatureManagement.Application.csproj" />
</ItemGroup>
</Project>

@ -1,11 +1,13 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Modularity;
namespace Volo.Abp.TenantManagement
{
[DependsOn(typeof(AbpTenantManagementDomainModule))]
[DependsOn(typeof(AbpTenantManagementApplicationContractsModule))]
[DependsOn(typeof(AbpFeatureManagementApplicationModule))]
public class AbpTenantManagementApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Modularity;
@ -16,6 +17,7 @@ namespace Volo.Abp.TenantManagement.Web
{
[DependsOn(typeof(AbpTenantManagementHttpApiModule))]
[DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))]
[DependsOn(typeof(AbpFeatureManagementWebModule))]
[DependsOn(typeof(AbpAutoMapperModule))]
public class AbpTenantManagementWebModule : AbpModule
{

@ -13,7 +13,10 @@
PageLayout.Content.MenuItemName = TenantManagementMenuNames.Tenants;
}
@section scripts {
<script type="text/javascript" src="~/modules/multi-tenancy/views/tenants/index.js"></script>
<abp-script-bundle name="@typeof(IndexModel).FullName">
<abp-script src="/modules/multi-tenancy/views/tenants/index.js" />
<abp-script src="/Pages/FeatureManagement/feature-management-modal.js" />
</abp-script-bundle>
}
<abp-card id="TenantsWrapper">
<abp-card-header>

@ -29,8 +29,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\feature-management\src\Volo.Abp.FeatureManagement.Web\Volo.Abp.FeatureManagement.Web.csproj" />
<ProjectReference Include="..\Volo.Abp.TenantManagement.HttpApi\Volo.Abp.TenantManagement.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
</ItemGroup>

@ -5,6 +5,7 @@
var _editModal = new abp.ModalManager(abp.appPath + 'TenantManagement/Tenants/EditModal');
var _createModal = new abp.ModalManager(abp.appPath + 'TenantManagement/Tenants/CreateModal');
var _featuresModal = new abp.ModalManager(abp.appPath + 'FeatureManagement/FeatureManagementModal');
$(function () {
@ -27,6 +28,18 @@
});
}
},
{
text: l('Features'),
visible: function () {
return true; //TODO: Check permission
},
action: function (data) {
_featuresModal.open({
providerName: 'Tenant',
providerKey: data.record.id
});
}
},
{
text: l('Delete'),
visible: function () { return true; }, //TODO: Check permission

Loading…
Cancel
Save