EasyAbp / AbpHelper.CLI

Providing code generation and more features to help you develop applications and modules with the ABP framework.
MIT License
285 stars 95 forks source link

The module menu item may need to be a sub item of administration menu item. #41

Closed gdlcf88 closed 4 years ago

gdlcf88 commented 4 years ago
        private async Task ConfigureMainMenu(MenuConfigurationContext context)
        {
            var administrationMenuItem = context.Menu.GetAdministration();
            var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<UniappManagementResource>>();            //Add main menu items.

            var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();

            if (await authorizationService.IsGrantedAsync(UniappManagementPermissions.Uniapps.Default))
            {
                administrationMenuItem.AddItem(
                    new ApplicationMenuItem("Uniapp", l["Menu:Uniapp"], "/UniappManagement/Uniapps/Uniapp")
                );
            }
        }

Otherwise, too many menu items will cause trouble to the UI, Only a few cases require customization by developers to move out the module menu item.

gdlcf88 commented 4 years ago

Not sure and should be discussed.

wakuflair commented 4 years ago

Because business are different, it is difficult to generate a perfect menu structure to fit everyone's requirement. I prefer leave it as it, developers should adjust it manually.

gdlcf88 commented 4 years ago

I agree with you.