diff --git a/public/app/core/components/sidemenu/SideMenuDropDown.tsx b/public/app/core/components/sidemenu/SideMenuDropDown.tsx index a7371b58bc6..358ea8fb44b 100644 --- a/public/app/core/components/sidemenu/SideMenuDropDown.tsx +++ b/public/app/core/components/sidemenu/SideMenuDropDown.tsx @@ -5,6 +5,7 @@ import { IconName, Link } from '@grafana/ui'; import { css } from '@emotion/css'; interface Props { + headerTarget?: HTMLAnchorElement['target']; headerText: string; headerUrl?: string; items?: NavModelItem[]; @@ -14,6 +15,7 @@ interface Props { } const SideMenuDropDown = ({ + headerTarget, headerText, headerUrl, items = [], @@ -22,15 +24,23 @@ const SideMenuDropDown = ({ subtitleText, }: Props) => { const headerContent = {headerText}; - const header = headerUrl ? ( - - {headerContent} - - ) : ( + let header = ( ); + if (headerUrl) { + header = + !headerTarget && headerUrl.startsWith('/') ? ( + + {headerContent} + + ) : ( + + {headerContent} + + ); + } const menuClass = css` flex-direction: ${reverseDirection ? 'column-reverse' : 'column'}; diff --git a/public/app/core/components/sidemenu/SideMenuItem.tsx b/public/app/core/components/sidemenu/SideMenuItem.tsx index 325553abaf0..ea7ff686bf7 100644 --- a/public/app/core/components/sidemenu/SideMenuItem.tsx +++ b/public/app/core/components/sidemenu/SideMenuItem.tsx @@ -25,27 +25,37 @@ const SideMenuItem = ({ target, url, }: Props) => { - const anchor = url ? ( - - {children} - - ) : ( + let element = ( ); + if (url) { + element = + !target && url.startsWith('/') ? ( + + {children} + + ) : ( + + {children} + + ); + } + return (
- {anchor} + {element}