diff --git a/pkg/services/navtree/navtreeimpl/navtree.go b/pkg/services/navtree/navtreeimpl/navtree.go index 47ca4bbafc9..c80ddb36406 100644 --- a/pkg/services/navtree/navtreeimpl/navtree.go +++ b/pkg/services/navtree/navtreeimpl/navtree.go @@ -92,6 +92,7 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, hasEditPerm bool, p Section: navtree.NavSectionCore, Children: starredItemsLinks, EmptyMessageId: "starred-empty", + Url: s.cfg.AppSubURL + "/dashboards?starred", }) } diff --git a/public/app/core/components/MegaMenu/NavBarMenuItemWrapper.tsx b/public/app/core/components/MegaMenu/NavBarMenuItemWrapper.tsx index 7d76bb6be4c..2501c0341d7 100644 --- a/public/app/core/components/MegaMenu/NavBarMenuItemWrapper.tsx +++ b/public/app/core/components/MegaMenu/NavBarMenuItemWrapper.tsx @@ -22,7 +22,7 @@ export function NavBarMenuItemWrapper({ if (link.emptyMessage && !linkHasChildren(link)) { return ( - + diff --git a/public/app/core/components/NavBar/utils.test.ts b/public/app/core/components/NavBar/utils.test.ts index 988bc973903..3bce87818c9 100644 --- a/public/app/core/components/NavBar/utils.test.ts +++ b/public/app/core/components/NavBar/utils.test.ts @@ -163,6 +163,11 @@ describe('getActiveItem', () => { text: 'Base', url: '/', }, + { + text: 'Starred', + url: '/dashboards?starred', + id: 'starred', + }, { text: 'Dashboards', url: '/dashboards', diff --git a/public/app/core/components/NavBar/utils.ts b/public/app/core/components/NavBar/utils.ts index df94b105376..ca7eb890ee5 100644 --- a/public/app/core/components/NavBar/utils.ts +++ b/public/app/core/components/NavBar/utils.ts @@ -129,7 +129,7 @@ export const getActiveItem = ( for (const link of navTree) { const linkWithoutParams = stripQueryParams(link.url); const linkPathname = locationUtil.stripBaseFromUrl(linkWithoutParams); - if (linkPathname) { + if (linkPathname && link.id !== 'starred') { if (linkPathname === pathname) { // exact match currentBestMatch = link;