NavBarMenu: Section as links and design tweak (#55538)

* scaffold new component + remove storing of expanded state

* some padding fixes

* simplify!

* move browse back to being a child of dashboards

* behaviour working

* improve child matcher to look recursively

* increase NavBarMenu zIndex to ensure it overlays explore drawer

* some renaming

* fix unit test

* make dashboards a top level item again and make chevrons their own buttons

* remove active background state

* Finished tweaks

* remove theme change

* Remove exit animation

* align button centrally + fix empty message alignment

* only show the empty message if there are no children

* ensure overflowing menu items truncate correctly

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
Torkel Ödegaard
2022-09-21 11:57:30 +02:00
committed by GitHub
co-authored by Ashley Harrison
parent 3a545007ca
commit 8440baab91
9 changed files with 378 additions and 19 deletions
+2 -1
View File
@@ -105,7 +105,7 @@ func (hs *HTTPServer) getAppLinks(c *models.ReqContext) ([]*dtos.NavLink, error)
}
if hs.Features.IsEnabled(featuremgmt.FlagTopnav) {
appLink.Url = path.Join(hs.Cfg.AppSubURL, "a", plugin.ID)
appLink.Url = hs.Cfg.AppSubURL + "/a/" + plugin.ID
} else {
appLink.Url = path.Join(hs.Cfg.AppSubURL, plugin.DefaultNavURL)
}
@@ -521,6 +521,7 @@ func (hs *HTTPServer) buildDashboardNavLinks(c *models.ReqContext, hasEditPerm b
Text: "Browse", Id: "dashboards/browse", Url: hs.Cfg.AppSubURL + "/dashboards", Icon: "sitemap",
})
}
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{
Text: "Playlists", Id: "dashboards/playlists", Url: hs.Cfg.AppSubURL + "/playlists", Icon: "presentation-play",
})