mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
A11y: Add focus styles to dashboard toolbar links (#35895)
This commit is contained in:
@@ -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<Props> {
|
||||
super(props);
|
||||
}
|
||||
|
||||
onFolderNameClick = () => {
|
||||
locationService.partial({ search: 'open', folder: 'current' });
|
||||
};
|
||||
|
||||
onClose = () => {
|
||||
locationService.partial({ viewPanel: null });
|
||||
};
|
||||
@@ -96,10 +92,6 @@ class DashNav extends PureComponent<Props> {
|
||||
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<Props> {
|
||||
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 (
|
||||
<PageToolbar
|
||||
pageIcon={isFullscreen ? undefined : 'apps'}
|
||||
title={title}
|
||||
parent={folderTitle}
|
||||
onClickTitle={this.onDashboardNameClick}
|
||||
onClickParent={this.onFolderNameClick}
|
||||
titleHref={titleHref}
|
||||
parentHref={parentHref}
|
||||
onGoBack={onGoBack}
|
||||
leftItems={this.renderLeftActionsButton()}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user