From f79c8bada77ac473c39113322985ecfa14a8310a Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Fri, 29 Apr 2022 13:58:23 -0400 Subject: [PATCH 1/3] fix a11y label error --- .../discover_grid/discover_grid_document_selection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx index e804dcb8eca7a..0bdf855571a1e 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx @@ -51,7 +51,7 @@ export const SelectButton = ({ rowIndex, setCellProps }: EuiDataGridCellValueEle return ( { From 7150043ff24c86675806b826079eda6097d2ba8b Mon Sep 17 00:00:00 2001 From: bhavyarm Date: Fri, 29 Apr 2022 16:54:10 -0400 Subject: [PATCH 2/3] fixing missing aria-label --- .../discover_grid/discover_grid_document_selection.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx index 0bdf855571a1e..e10638c506445 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx @@ -18,6 +18,7 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { euiLightVars as themeLight, euiDarkVars as themeDark } from '@kbn/ui-theme'; +import { i18n } from '@kbn/i18n'; import { DiscoverGridContext } from './discover_grid_context'; import { ElasticSearchHit } from '../../types'; @@ -36,6 +37,11 @@ export const SelectButton = ({ rowIndex, setCellProps }: EuiDataGridCellValueEle const id = useMemo(() => getDocId(doc), [doc]); const checked = useMemo(() => selectedDocs.includes(id), [selectedDocs, id]); + const toggleDocumentSelectionLabel = i18n.translate('discover.grid.selectDoc', { + defaultMessage: `Select document '{rowIndex}'`, + values: { rowIndex }, + }); + useEffect(() => { if (expanded && doc && expanded._id === doc._id) { setCellProps({ @@ -51,7 +57,7 @@ export const SelectButton = ({ rowIndex, setCellProps }: EuiDataGridCellValueEle return ( { From 6b30be413c478649e9f998d304752c9ce2d0e5d2 Mon Sep 17 00:00:00 2001 From: Bhavya RM Date: Tue, 3 May 2022 10:04:03 -0400 Subject: [PATCH 3/3] Update src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx Co-authored-by: Julia Rechkunova --- .../discover_grid/discover_grid_document_selection.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx index e10638c506445..2f1f74153d7af 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx @@ -38,8 +38,8 @@ export const SelectButton = ({ rowIndex, setCellProps }: EuiDataGridCellValueEle const checked = useMemo(() => selectedDocs.includes(id), [selectedDocs, id]); const toggleDocumentSelectionLabel = i18n.translate('discover.grid.selectDoc', { - defaultMessage: `Select document '{rowIndex}'`, - values: { rowIndex }, + defaultMessage: `Select document '{rowNumber}'`, + values: { rowNumber: rowIndex + 1 }, }); useEffect(() => {