Skip to content

Commit

Permalink
[ML] [Accessibility] Add job ID to select row checkbox aria-label in …
Browse files Browse the repository at this point in the history
…Jobs List (#40149)

* [ML] [Accessibility] Add job ID to select row checkbox in Jobs List

* [ML] Add job ID to cannot select checkbox message in Jobs List row

* [ML] Update translations files for select job checkbox
  • Loading branch information
peteharverson authored Jul 3, 2019
1 parent 1e1153e commit 7c79427
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
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,27 @@ 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 ID {jobId}',
values: {
jobId: rowItem.id,
}
}
)
: i18n.translate(
'xpack.ml.jobsList.selectRowForJobMessage',
{
defaultMessage: 'Select the row for job ID {jobId}',
values: {
jobId: rowItem.id,
}
}
)
),
onSelectionChange: this.props.selectJobChange
};

Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -6641,7 +6641,6 @@
"xpack.ml.jobsList.actionExecuteSuccessfullyNotificationMessage": "{successesJobsCount, plural, one{{successJob}} other{# 件のジョブ}} {actionTextPT}成功",
"xpack.ml.jobsList.actionFailedNotificationMessage": "{failureId} が {actionText} に失敗しました",
"xpack.ml.jobsList.actionsLabel": "アクション",
"xpack.ml.jobsList.cannotSelectJobTooltip": "ジョブを選択できません",
"xpack.ml.jobsList.cloneJobErrorMessage": "{jobId} のクローンを作成できませんでした。ジョブが見つかりませんでした",
"xpack.ml.jobsList.closeActionStatusText": "閉じる",
"xpack.ml.jobsList.closedActionStatusText": "クローズ済み",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -6641,7 +6641,6 @@
"xpack.ml.jobsList.actionExecuteSuccessfullyNotificationMessage": "{successesJobsCount, plural, one{{successJob}} other{# 个作业}}{actionTextPT}已成功",
"xpack.ml.jobsList.actionFailedNotificationMessage": "{failureId} 未能{actionText}",
"xpack.ml.jobsList.actionsLabel": "操作",
"xpack.ml.jobsList.cannotSelectJobTooltip": "无法选择作业",
"xpack.ml.jobsList.cloneJobErrorMessage": "无法克隆 {jobId}。找不到作业",
"xpack.ml.jobsList.closeActionStatusText": "关闭",
"xpack.ml.jobsList.closedActionStatusText": "已关闭",
Expand Down

0 comments on commit 7c79427

Please sign in to comment.