From 6db0af22238b45b7aef4cc340d022a37e8ca566a Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 6 Oct 2021 13:02:54 -0400 Subject: [PATCH] A11y: Fix fastpass issues for dashboard management pages (#39940) (#40065) * A11y: Fix fastpass issues for dashboard pages See #39429 (cherry picked from commit 1ce750471f257982847d3e9899dd9721bf97c6e3) Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com> --- packages/grafana-data/src/types/select.ts | 1 + .../Forms/RadioButtonGroup/RadioButton.tsx | 4 +++ .../RadioButtonGroup/RadioButtonGroup.tsx | 1 + .../app/core/components/Select/SortPicker.tsx | 1 + .../editors/DashboardPickerByID.tsx | 12 +++++++- .../VizTypePicker/PanelTypeCard.tsx | 2 +- .../components/NewDashboardsFolder.tsx | 1 + .../LibraryPanelCard/LibraryPanelCard.tsx | 2 +- .../manage-dashboards/DashboardImportPage.tsx | 29 +++++++++---------- public/app/features/playlist/PlaylistForm.tsx | 2 +- public/app/features/playlist/PlaylistPage.tsx | 2 +- .../features/search/components/ActionRow.tsx | 4 +-- .../search/components/SearchCheckbox.tsx | 17 ++++++----- .../features/search/components/SearchItem.tsx | 7 ++++- .../search/components/SearchResults.tsx | 4 +-- .../search/components/SearchResultsFilter.tsx | 17 +++++++++-- .../search/components/SectionHeader.tsx | 1 + 17 files changed, 71 insertions(+), 36 deletions(-) diff --git a/packages/grafana-data/src/types/select.ts b/packages/grafana-data/src/types/select.ts index db659062543..1243b2d0483 100644 --- a/packages/grafana-data/src/types/select.ts +++ b/packages/grafana-data/src/types/select.ts @@ -3,6 +3,7 @@ */ export interface SelectableValue { label?: string; + ariaLabel?: string; value?: T; imgUrl?: string; icon?: string; diff --git a/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButton.tsx b/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButton.tsx index 38f98307e47..257255ebdb6 100644 --- a/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButton.tsx +++ b/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButton.tsx @@ -4,6 +4,7 @@ import { GrafanaTheme2 } from '@grafana/data'; import { css } from '@emotion/css'; import { getPropertiesForButtonSize } from '../commonStyles'; import { getFocusStyles, getMouseFocusStyles } from '../../../themes/mixins'; +import { StringSelector } from '@grafana/e2e-selectors'; export type RadioButtonSize = 'sm' | 'md'; @@ -16,6 +17,7 @@ export interface RadioButtonProps { id: string; onChange: () => void; fullWidth?: boolean; + 'aria-label'?: StringSelector; } export const RadioButton: React.FC = ({ @@ -28,6 +30,7 @@ export const RadioButton: React.FC = ({ name = undefined, description, fullWidth, + 'aria-label': ariaLabel, }) => { const theme = useTheme2(); const styles = getRadioButtonStyles(theme, size, fullWidth); @@ -42,6 +45,7 @@ export const RadioButton: React.FC = ({ id={id} checked={active} name={name} + aria-label={ariaLabel} />