mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
A11y: Fix a11y for toolbar buttons in PanelEditor (#53864)
Co-authored-by: Vadim Beskrovnov <vbeskrovnov@fb.com>
This commit is contained in:
parent
666f84be57
commit
7caba545ec
@ -123,7 +123,7 @@ export const Components = {
|
|||||||
DataPane: {
|
DataPane: {
|
||||||
content: 'Panel editor data pane content',
|
content: 'Panel editor data pane content',
|
||||||
},
|
},
|
||||||
applyButton: 'panel editor apply',
|
applyButton: 'Apply changes and go back to dashboard',
|
||||||
toggleVizPicker: 'toggle-viz-picker',
|
toggleVizPicker: 'toggle-viz-picker',
|
||||||
toggleVizOptions: 'toggle-viz-options',
|
toggleVizOptions: 'toggle-viz-options',
|
||||||
toggleTableView: 'toggle-table-view',
|
toggleTableView: 'toggle-table-view',
|
||||||
|
@ -338,32 +338,31 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
|
|||||||
<ToolbarButton
|
<ToolbarButton
|
||||||
icon="cog"
|
icon="cog"
|
||||||
onClick={this.onOpenDashboardSettings}
|
onClick={this.onOpenDashboardSettings}
|
||||||
title="Open dashboard settings"
|
tooltip="Open dashboard settings"
|
||||||
key="settings"
|
key="settings"
|
||||||
/>,
|
/>,
|
||||||
<ToolbarButton onClick={this.onDiscard} title="Undo all changes" key="discard">
|
<ToolbarButton onClick={this.onDiscard} tooltip="Undo all changes" key="discard">
|
||||||
Discard
|
Discard
|
||||||
</ToolbarButton>,
|
</ToolbarButton>,
|
||||||
this.props.panel.libraryPanel ? (
|
this.props.panel.libraryPanel ? (
|
||||||
<ToolbarButton
|
<ToolbarButton
|
||||||
onClick={this.onSaveLibraryPanel}
|
onClick={this.onSaveLibraryPanel}
|
||||||
variant="primary"
|
variant="primary"
|
||||||
title="Apply changes and save library panel"
|
tooltip="Apply changes and save library panel"
|
||||||
key="save-panel"
|
key="save-panel"
|
||||||
>
|
>
|
||||||
Save library panel
|
Save library panel
|
||||||
</ToolbarButton>
|
</ToolbarButton>
|
||||||
) : (
|
) : (
|
||||||
<ToolbarButton onClick={this.onSaveDashboard} title="Apply changes and save dashboard" key="save">
|
<ToolbarButton onClick={this.onSaveDashboard} tooltip="Apply changes and save dashboard" key="save">
|
||||||
Save
|
Save
|
||||||
</ToolbarButton>
|
</ToolbarButton>
|
||||||
),
|
),
|
||||||
<ToolbarButton
|
<ToolbarButton
|
||||||
onClick={this.onBack}
|
onClick={this.onBack}
|
||||||
variant="primary"
|
variant="primary"
|
||||||
title="Apply changes and go back to dashboard"
|
tooltip="Apply changes and go back to dashboard"
|
||||||
key="apply"
|
key="apply"
|
||||||
aria-label={selectors.components.PanelEditor.applyButton}
|
|
||||||
>
|
>
|
||||||
Apply
|
Apply
|
||||||
</ToolbarButton>,
|
</ToolbarButton>,
|
||||||
|
@ -238,7 +238,7 @@ describe('DashboardPage', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Should render panel editor', () => {
|
it('Should render panel editor', () => {
|
||||||
expect(screen.getByTitle('Apply changes and go back to dashboard')).toBeInTheDocument();
|
expect(screen.getByLabelText('Apply changes and go back to dashboard')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should reset state when leaving', () => {
|
it('Should reset state when leaving', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user