Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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 '{rowNumber}'`,
values: { rowNumber: rowIndex + 1 },
});

useEffect(() => {
if (expanded && doc && expanded._id === doc._id) {
setCellProps({
Expand All @@ -51,7 +57,7 @@ export const SelectButton = ({ rowIndex, setCellProps }: EuiDataGridCellValueEle
return (
<EuiCheckbox
id={id}
label=""
aria-label={toggleDocumentSelectionLabel}
Comment thread
bhavyarm marked this conversation as resolved.
checked={checked}
data-test-subj={`dscGridSelectDoc-${id}`}
onChange={() => {
Expand Down