|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
using Volo.Abp.Features;
|
|
|
|
|
using Volo.Abp.SettingManagement.Localization;
|
|
|
|
|
using Volo.Abp.UI.Navigation;
|
|
|
|
|
|
|
|
|
@ -19,6 +20,12 @@ namespace Volo.Abp.SettingManagement.Blazor.Menus
|
|
|
|
|
|
|
|
|
|
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context)
|
|
|
|
|
{
|
|
|
|
|
var featureChecker = context.ServiceProvider.GetRequiredService<IFeatureChecker>();
|
|
|
|
|
if (!await featureChecker.IsEnabledAsync(SettingManagementFeatures.Enable))
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var settingManagementPageOptions = context.ServiceProvider.GetRequiredService<IOptions<SettingManagementComponentOptions>>().Value;
|
|
|
|
|
var settingPageCreationContext = new SettingComponentCreationContext(context.ServiceProvider);
|
|
|
|
|
if (!settingManagementPageOptions.Contributors.Any() ||
|
|
|
|
@ -33,7 +40,7 @@ namespace Volo.Abp.SettingManagement.Blazor.Menus
|
|
|
|
|
/* This may happen if MVC UI is being used in the same application.
|
|
|
|
|
* In this case, we are removing the MVC setting management UI. */
|
|
|
|
|
context.Menu.GetAdministration().TryRemoveMenuItem(SettingManagementMenus.GroupName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.Menu
|
|
|
|
|
.GetAdministration()
|
|
|
|
|
.AddItem(
|
|
|
|
@ -60,4 +67,4 @@ namespace Volo.Abp.SettingManagement.Blazor.Menus
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|