Set menu order.

pull/8137/head
Halil İbrahim Kalkan 4 years ago
parent f4f6f66760
commit 722d5f819d

@ -1,11 +1,13 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using MyCompanyName.MyProjectName.Localization;
using Volo.Abp.Account.Localization;
using MyCompanyName.MyProjectName.MultiTenancy;
using Volo.Abp.Identity.Blazor;
using Volo.Abp.SettingManagement.Blazor.Menus;
using Volo.Abp.TenantManagement.Blazor.Navigation;
using Volo.Abp.UI.Navigation;
using Volo.Abp.Users;
//<TEMPLATE-REMOVE IF-NOT='CMS-KIT'>
using Volo.CmsKit.Admin.Web.Menus;
//</TEMPLATE-REMOVE>
namespace MyCompanyName.MyProjectName.Blazor.Server.Menus
{
@ -21,6 +23,7 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Menus
private Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
var administration = context.Menu.GetAdministration();
var l = context.GetLocalizer<MyProjectNameResource>();
context.Menu.Items.Insert(
@ -29,9 +32,26 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Menus
MyProjectNameMenus.Home,
l["Menu:Home"],
"/",
icon: "fas fa-home"
icon: "fas fa-home",
order: 0
)
);
//<TEMPLATE-REMOVE IF-NOT='CMS-KIT'>
context.Menu.SetSubItemOrder(CmsKitAdminMenus.GroupName, 1);
//</TEMPLATE-REMOVE>
if (MultiTenancyConsts.IsEnabled)
{
administration.SetSubItemOrder(TenantManagementMenuNames.GroupName, 1);
}
else
{
administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName);
}
administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2);
administration.SetSubItemOrder(SettingManagementMenus.GroupName, 3);
return Task.CompletedTask;
}

@ -32,6 +32,9 @@
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Blazor.Server\Volo.Abp.Identity.Blazor.Server.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Blazor.Server\Volo.Abp.TenantManagement.Blazor.Server.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Blazor.Server\Volo.Abp.SettingManagement.Blazor.Server.csproj" />
<!--<TEMPLATE-REMOVE IF-NOT='CMS-KIT'>-->
<ProjectReference Include="..\..\..\..\..\modules\cms-kit\src\Volo.CmsKit.Web\Volo.CmsKit.Web.csproj" />
<!--</TEMPLATE-REMOVE>-->
</ItemGroup>
<ItemGroup>

@ -17,7 +17,6 @@ using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling;
using Volo.Abp.AspNetCore.Components.Server.Theming.Bundling;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
@ -41,6 +40,9 @@ using Volo.Abp.UI;
using Volo.Abp.UI.Navigation;
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.VirtualFileSystem;
//<TEMPLATE-REMOVE IF-NOT='CMS-KIT'>
using Volo.CmsKit.Web;
//</TEMPLATE-REMOVE>
namespace MyCompanyName.MyProjectName.Blazor.Server
{
@ -57,6 +59,9 @@ namespace MyCompanyName.MyProjectName.Blazor.Server
typeof(AbpAspNetCoreComponentsServerBasicThemeModule),
typeof(AbpIdentityBlazorServerModule),
typeof(AbpTenantManagementBlazorServerModule),
//<TEMPLATE-REMOVE IF-NOT='CMS-KIT'>
typeof(CmsKitWebModule),
//</TEMPLATE-REMOVE>
typeof(AbpSettingManagementBlazorServerModule)
)]
public class MyProjectNameBlazorModule : AbpModule

Loading…
Cancel
Save