aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2022-08-10 12:15:33 +0200
committersonartech <sonartech@sonarsource.com>2022-08-11 20:03:48 +0000
commit3e37e53ab108121dc718a00bb32c5913cdc9b02f (patch)
tree5292a0161f8c795556f68036d9043b53c93b983d
parentd43ed215dc079a4a63a4b3ff5e1532d0bdc7b215 (diff)
downloadsonarqube-3e37e53ab108121dc718a00bb32c5913cdc9b02f.tar.gz
sonarqube-3e37e53ab108121dc718a00bb32c5913cdc9b02f.zip
SONAR-16782 [893020] Buttons must have discernible text
-rw-r--r--server/sonar-web/src/main/js/components/controls/DateInput.tsx8
-rw-r--r--server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/DateInput-test.tsx.snap2
2 files changed, 9 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/components/controls/DateInput.tsx b/server/sonar-web/src/main/js/components/controls/DateInput.tsx
index 519b7850b2c..b54fbcd0158 100644
--- a/server/sonar-web/src/main/js/components/controls/DateInput.tsx
+++ b/server/sonar-web/src/main/js/components/controls/DateInput.tsx
@@ -28,7 +28,12 @@ import OutsideClickHandler from '../../components/controls/OutsideClickHandler';
import CalendarIcon from '../../components/icons/CalendarIcon';
import ChevronLeftIcon from '../../components/icons/ChevronLeftIcon';
import ChevronRightIcon from '../../components/icons/ChevronRightIcon';
-import { getShortMonthName, getShortWeekDayName, getWeekDayName } from '../../helpers/l10n';
+import {
+ getShortMonthName,
+ getShortWeekDayName,
+ getWeekDayName,
+ translate
+} from '../../helpers/l10n';
import './DayPicker.css';
import Select from './Select';
import './styles.css';
@@ -172,6 +177,7 @@ export default class DateInput extends React.PureComponent<Props, State> {
<CalendarIcon className="date-input-control-icon" fill="" />
{value !== undefined && (
<ClearButton
+ aria-label={translate('reset_verb')}
className="button-tiny date-input-control-reset"
iconProps={{ size: 12 }}
onClick={this.handleResetClick}
diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/DateInput-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/DateInput-test.tsx.snap
index 3e58abef40e..41ff0ea47e1 100644
--- a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/DateInput-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/DateInput-test.tsx.snap
@@ -44,6 +44,7 @@ exports[`should render 2`] = `
fill=""
/>
<ClearButton
+ aria-label="reset_verb"
className="button-tiny date-input-control-reset"
iconProps={
Object {
@@ -77,6 +78,7 @@ exports[`should render 3`] = `
fill=""
/>
<ClearButton
+ aria-label="reset_verb"
className="button-tiny date-input-control-reset"
iconProps={
Object {