From 0a0cc59dbda707da3c7e4a019962f774de2142a9 Mon Sep 17 00:00:00 2001 From: Mathieu Suen Date: Tue, 26 Oct 2021 15:17:46 +0200 Subject: [PATCH] Fixing critical accessibility issue --- .../nav/component/projectInformation/InfoDrawer.tsx | 3 ++- .../__tests__/__snapshots__/InfoDrawer-test.tsx.snap | 2 ++ server/sonar-web/src/main/js/components/ui/Alert.tsx | 6 ++---- .../ui/__tests__/__snapshots__/Alert-test.tsx.snap | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx index ae8aef6b211..fd49934083c 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx @@ -22,6 +22,7 @@ import * as React from 'react'; import { ClearButton } from '../../../../../components/controls/buttons'; import EscKeydownHandler from '../../../../../components/controls/EscKeydownHandler'; import OutsideClickHandler from '../../../../../components/controls/OutsideClickHandler'; +import { translate } from '../../../../../helpers/l10n'; import './InfoDrawer.css'; export interface InfoDrawerProps { @@ -39,7 +40,7 @@ export default function InfoDrawer(props: InfoDrawerProps) { className={classNames('info-drawer info-drawer-pane', { open: displayed })} style={{ top }}>
- +
{displayed && ( diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/InfoDrawer-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/InfoDrawer-test.tsx.snap index 4bdb4cd7014..4280459e52c 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/InfoDrawer-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/__tests__/__snapshots__/InfoDrawer-test.tsx.snap @@ -13,6 +13,7 @@ exports[`should render correctly: default 1`] = ` className="close-button" > @@ -32,6 +33,7 @@ exports[`should render correctly: displayed 1`] = ` className="close-button" > diff --git a/server/sonar-web/src/main/js/components/ui/Alert.tsx b/server/sonar-web/src/main/js/components/ui/Alert.tsx index 5ed07a1d665..33e07772763 100644 --- a/server/sonar-web/src/main/js/components/ui/Alert.tsx +++ b/server/sonar-web/src/main/js/components/ui/Alert.tsx @@ -147,13 +147,11 @@ export function Alert(props: AlertProps & React.HTMLAttributes) className={classNames('alert', className)} isInline={isInline} role="alert" + aria-label={translate('alert.tooltip', variant)} variantInfo={variantInfo} {...domProps}> - + {variantInfo.icon} {props.children} diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Alert-test.tsx.snap b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Alert-test.tsx.snap index 893212cc564..35b25b7367d 100644 --- a/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Alert-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/Alert-test.tsx.snap @@ -69,6 +69,7 @@ exports[`should render banner alert with correct css 1`] = ` }