Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] [Accessibility] Add job ID to select row checkbox aria-label in Jobs List #40149

Merged
Merged
Changes from 1 commit
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 @@ -23,6 +23,7 @@ import {
EuiButtonIcon,
} from '@elastic/eui';
import { injectI18n } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

const PAGE_SIZE = 10;
const PAGE_SIZE_OPTIONS = [10, 25, 50];
Expand Down Expand Up @@ -102,10 +103,22 @@ class JobsListUI extends Component {
const { intl, loading } = this.props;
const selectionControls = {
selectable: job => (job.deleting !== true),
selectableMessage: (selectable) => (!selectable) ? intl.formatMessage({
id: 'xpack.ml.jobsList.cannotSelectJobTooltip',
defaultMessage: 'Cannot select job' })
: undefined,
selectableMessage: (selectable, rowItem) => (
(selectable === false)
? i18n.translate(
'xpack.ml.jobsList.cannotSelectRowForJobMessage',
{ defaultMessage: 'Cannot select job' }
)
: i18n.translate(
'xpack.ml.jobsList.selectRowForJobMessage',
{
defaultMessage: 'Select the row for job ID {jobId}',
values: {
jobId: rowItem.id,
}
}
)
),
onSelectionChange: this.props.selectJobChange
};

Expand Down