0
nhontran created
If you're creating a bug/problem report, please include followings:
- ABP Framework version: v3.3.2
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
Hi, I would like to hide this identity server menu bar in staging and production by checking the environment
I have tried this but it does not work:
Configure<AbpToolbarOptions>(options =>
{
var toolbar = options.Contributors.FirstOrDefault(x => x.GetType() == typeof(AccountModuleToolbarContributor));
if (toolbar != null)
{
options.Contributors.Remove(toolbar);
}
});
any help would be appreciated.
1 Answer(s)
-
0
Hello
Language selection, User menu and Full screen items added by theme lepton via NavItemsService
You can remove these items using NavItemsService.
Example:
- Declare a variable in environments which named environmentName
// environment.ts export const environmentName = 'dev'
// environment.prod.ts export const environmentName = 'prod'
- Inject
NavItemsService
in yourapp.component.ts
and check your environment and delete item
//app.component.ts import { Component } from '@angular/core'; import { NavItemsService } from '@abp/ng.theme.shared'; import { environmentName } from '../environments/environment'; import { eThemeLeptonComponents } from '@volo/abp.ng.theme.lepton'; @Component({ selector: 'app-root', template: ` <abp-loader-bar></abp-loader-bar> <abp-dynamic-layout></abp-dynamic-layout> `, }) export class AppComponent { constructor(private navItems: NavItemsService) { // Check environment is prod if (environmentName.match('prod')) { navItems.removeItem(eThemeLeptonComponents.CurrentUser); } } }