{pageIcon && !onGoBack && (
-
+
)}
{onGoBack && (
@@ -72,17 +63,24 @@ export const PageToolbar: FC
= React.memo(
/>
)}
- {parent && onClickParent && (
-
{child}
@@ -109,21 +107,18 @@ PageToolbar.displayName = 'PageToolbar';
const getStyles = (theme: GrafanaTheme2) => {
const { spacing, typography } = theme;
- const titleStyles = `
- font-size: ${typography.size.lg};
- padding: ${spacing(0.5, 1, 0.5, 1)};
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- max-width: 240px;
+ const focusStyle = getFocusStyles(theme);
+ const titleStyles = css`
+ font-size: ${typography.size.lg};
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ max-width: 240px;
+ border-radius: 2px;
- // clear default button styles
- background: none;
- border: none;
-
- @media ${styleMixins.mediaUp(theme.v1.breakpoints.xl)} {
- max-width: unset;
- }
+ @media ${styleMixins.mediaUp(theme.v1.breakpoints.xl)} {
+ max-width: unset;
+ }
`;
return {
@@ -142,6 +137,7 @@ const getStyles = (theme: GrafanaTheme2) => {
display: none;
@media ${styleMixins.mediaUp(theme.v1.breakpoints.md)} {
display: flex;
+ padding-right: ${theme.spacing(1)};
align-items: center;
}
`,
@@ -154,12 +150,17 @@ const getStyles = (theme: GrafanaTheme2) => {
parentIcon: css`
margin-left: ${theme.spacing(0.5)};
`,
- titleText: css`
- ${titleStyles};
+ titleText: titleStyles,
+ titleLink: css`
+ &:focus-visible {
+ ${focusStyle}
+ }
+ `,
+ titleDivider: css`
+ padding: ${spacing(0, 0.5, 0, 0.5)};
`,
parentLink: css`
display: none;
- padding-right: 0;
@media ${styleMixins.mediaUp(theme.v1.breakpoints.md)} {
display: unset;
}
diff --git a/public/app/features/dashboard/components/DashNav/DashNav.tsx b/public/app/features/dashboard/components/DashNav/DashNav.tsx
index 946b04b4422..7d2b540e082 100644
--- a/public/app/features/dashboard/components/DashNav/DashNav.tsx
+++ b/public/app/features/dashboard/components/DashNav/DashNav.tsx
@@ -7,7 +7,7 @@ import { playlistSrv } from 'app/features/playlist/PlaylistSrv';
import { DashNavButton } from './DashNavButton';
import { DashNavTimeControls } from './DashNavTimeControls';
import { ButtonGroup, ModalsController, ToolbarButton, PageToolbar } from '@grafana/ui';
-import { textUtil } from '@grafana/data';
+import { locationUtil, textUtil } from '@grafana/data';
// State
import { updateTimeZoneForSession } from 'app/features/profile/state/reducers';
// Types
@@ -57,10 +57,6 @@ class DashNav extends PureComponent
{
super(props);
}
- onFolderNameClick = () => {
- locationService.partial({ search: 'open', folder: 'current' });
- };
-
onClose = () => {
locationService.partial({ viewPanel: null });
};
@@ -96,10 +92,6 @@ class DashNav extends PureComponent {
this.forceUpdate();
};
- onDashboardNameClick = () => {
- locationService.partial({ search: 'open' });
- };
-
addCustomContent(actions: DashNavButtonModel[], buttons: ReactNode[]) {
actions.map((action, index) => {
const Component = action.component;
@@ -250,13 +242,16 @@ class DashNav extends PureComponent {
const { isFullscreen, title, folderTitle } = this.props;
const onGoBack = isFullscreen ? this.onClose : undefined;
+ const titleHref = locationUtil.updateSearchParams(window.location.href, '?search=open');
+ const parentHref = locationUtil.updateSearchParams(window.location.href, '?search=open&folder=current');
+
return (