mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Navigation: Fix empty admin menu (#94024)
This commit is contained in:
parent
299fe3e5b1
commit
9144e3b44a
@ -167,6 +167,10 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, prefs *pref.Prefere
|
|||||||
if sec := treeRoot.FindById(navtree.NavIDCfgAccess); sec != nil && len(sec.Children) == 0 {
|
if sec := treeRoot.FindById(navtree.NavIDCfgAccess); sec != nil && len(sec.Children) == 0 {
|
||||||
treeRoot.RemoveSectionByID(navtree.NavIDCfgAccess)
|
treeRoot.RemoveSectionByID(navtree.NavIDCfgAccess)
|
||||||
}
|
}
|
||||||
|
// double-check and remove admin menu if empty
|
||||||
|
if sec := treeRoot.FindById(navtree.NavIDCfg); sec != nil && len(sec.Children) == 0 {
|
||||||
|
treeRoot.RemoveSectionByID(navtree.NavIDCfg)
|
||||||
|
}
|
||||||
|
|
||||||
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagPinNavItems) {
|
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagPinNavItems) {
|
||||||
treeRoot.AddSection(&navtree.NavLink{
|
treeRoot.AddSection(&navtree.NavLink{
|
||||||
|
Loading…
Reference in New Issue
Block a user