From 9570495af5306085aee3d233dae05fd73fb5ed9c Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 29 Sep 2021 11:46:03 -0400 Subject: [PATCH] A11y: Fix fastpass issues for /explore page (#39507) (#39796) * Fix(A11y): add label to explore short url button * Grafana-UI(A11y): Set Selects images alt attribute to their option label * Update packages/grafana-ui/src/components/Select/SingleValue.tsx Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> (cherry picked from commit f61c8d3eedae937e90f3822d2c74b64189c7461d) Co-authored-by: Giordano Ricci --- packages/grafana-ui/src/components/Select/SelectMenu.tsx | 2 +- packages/grafana-ui/src/components/Select/SingleValue.tsx | 8 +++++--- public/app/features/explore/ExploreToolbar.tsx | 6 +++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/grafana-ui/src/components/Select/SelectMenu.tsx b/packages/grafana-ui/src/components/Select/SelectMenu.tsx index 628c8660365..8032180e566 100644 --- a/packages/grafana-ui/src/components/Select/SelectMenu.tsx +++ b/packages/grafana-ui/src/components/Select/SelectMenu.tsx @@ -52,7 +52,7 @@ export const SelectMenuOptions = React.forwardRef {data.icon && } - {data.imgUrl && } + {data.imgUrl && {data.label}
{renderOptionLabel ? renderOptionLabel(data) : children} {data.description &&
{data.description}
} diff --git a/packages/grafana-ui/src/components/Select/SingleValue.tsx b/packages/grafana-ui/src/components/Select/SingleValue.tsx index eb19839bb30..9f371c5d960 100644 --- a/packages/grafana-ui/src/components/Select/SingleValue.tsx +++ b/packages/grafana-ui/src/components/Select/SingleValue.tsx @@ -46,6 +46,8 @@ type StylesType = ReturnType; interface Props extends SingleValueProps<{ imgUrl?: string; + label?: string; + value: string; loading?: boolean; hideText?: boolean; }> { @@ -61,7 +63,7 @@ export const SingleValue = (props: Props) => {
{data.imgUrl ? ( - + ) : (
@@ -75,14 +77,14 @@ export const SingleValue = (props: Props) => { ); }; -const FadeWithImage = (props: { loading: boolean; imgUrl: string; styles: StylesType }) => { +const FadeWithImage = (props: { loading: boolean; imgUrl: string; styles: StylesType; alt: string }) => { return (
- + {props.alt}
); diff --git a/public/app/features/explore/ExploreToolbar.tsx b/public/app/features/explore/ExploreToolbar.tsx index d3e42087edb..623879fdad4 100644 --- a/public/app/features/explore/ExploreToolbar.tsx +++ b/public/app/features/explore/ExploreToolbar.tsx @@ -146,7 +146,11 @@ export class UnConnectedExploreToolbar extends PureComponent { ) : null} - createAndCopyShortLink(window.location.href)} /> + createAndCopyShortLink(window.location.href)} + aria-label="Copy shortened link to the executed query" + /> {!isLive && (