From 5eb2009fbfd1b86a1eebf901e9790a8ca3b6578e Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 12 Nov 2019 16:29:37 -0600 Subject: [PATCH] label updates --- .../uis/arguments/axis_config/simple_template.tsx | 2 +- .../components/dedicated_index/dedicated_index_switch.tsx | 8 +++++++- .../components/model_plot/model_plot_switch.tsx | 8 +++++++- .../components/sparse_data/sparse_data_switch.tsx | 5 ++++- .../recognize/components/job_settings_form.tsx | 4 +++- .../components/ml_popover/jobs_table/job_switch.tsx | 2 +- .../edit_space/enabled_features/feature_table.tsx | 2 +- 7 files changed, 24 insertions(+), 7 deletions(-) diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx index c5bc668993c33..068854866dc1b 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx @@ -20,7 +20,7 @@ export const SimpleTemplate: FunctionComponent = ({ onValueChange, argVal checked={Boolean(argValue)} onChange={() => onValueChange(!Boolean(argValue))} showLabel={false} - label="" // TODO: Add label for a11y + label="" /> ); }; diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/job_details_step/components/advanced_section/components/dedicated_index/dedicated_index_switch.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/job_details_step/components/advanced_section/components/dedicated_index/dedicated_index_switch.tsx index 00fc0da090938..5c8f346d71baf 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/job_details_step/components/advanced_section/components/dedicated_index/dedicated_index_switch.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/job_details_step/components/advanced_section/components/dedicated_index/dedicated_index_switch.tsx @@ -5,6 +5,7 @@ */ import React, { FC, useState, useContext, useEffect } from 'react'; +import { i18n } from '@kbn/i18n'; import { EuiSwitch } from '@elastic/eui'; import { JobCreatorContext } from '../../../../../job_creator_context'; import { Description } from './description'; @@ -30,7 +31,12 @@ export const DedicatedIndexSwitch: FC = () => { onChange={toggleModelPlot} data-test-subj="mlJobWizardSwitchUseDedicatedIndex" showLabel={false} - label="" // TODO: Add label for a11y + label={i18n.translate( + 'xpack.ml.newJob.wizard.jobDetailsStep.advancedSection.useDedicatedIndex.title', + { + defaultMessage: 'Use dedicated index', + } + )} /> ); diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/job_details_step/components/advanced_section/components/model_plot/model_plot_switch.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/job_details_step/components/advanced_section/components/model_plot/model_plot_switch.tsx index 24b23ccf72751..41ac4311b71ce 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/job_details_step/components/advanced_section/components/model_plot/model_plot_switch.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/job_details_step/components/advanced_section/components/model_plot/model_plot_switch.tsx @@ -5,6 +5,7 @@ */ import React, { FC, useState, useContext, useEffect } from 'react'; +import { i18n } from '@kbn/i18n'; import { EuiSwitch } from '@elastic/eui'; import { JobCreatorContext } from '../../../../../job_creator_context'; import { Description } from './description'; @@ -30,7 +31,12 @@ export const ModelPlotSwitch: FC = () => { onChange={toggleModelPlot} data-test-subj="mlJobWizardSwitchModelPlot" showLabel={false} - label="" // TODO: Add label for a11y + label={i18n.translate( + 'xpack.ml.newJob.wizard.jobDetailsStep.advancedSection.enableModelPlot.title', + { + defaultMessage: 'Enable model plot', + } + )} /> ); diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/sparse_data/sparse_data_switch.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/sparse_data/sparse_data_switch.tsx index 6b43865b8550f..3f2c45f0c62bd 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/sparse_data/sparse_data_switch.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/pages/components/pick_fields_step/components/sparse_data/sparse_data_switch.tsx @@ -5,6 +5,7 @@ */ import React, { FC, useState, useContext, useEffect } from 'react'; +import { i18n } from '@kbn/i18n'; import { EuiSwitch } from '@elastic/eui'; import { JobCreatorContext } from '../../../job_creator_context'; import { Description } from './description'; @@ -44,7 +45,9 @@ export const SparseDataSwitch: FC = () => { onChange={toggleSparseData} data-test-subj="mlJobWizardSwitchSparseData" showLabel={false} - label="" // TODO: Add label for a11y + label={i18n.translate('xpack.ml.newJob.wizard.pickFieldsStep.sparseData.title', { + defaultMessage: 'Sparse data', + })} /> ); diff --git a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/recognize/components/job_settings_form.tsx b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/recognize/components/job_settings_form.tsx index f4ea34e5081e8..8dda1415a0ab8 100644 --- a/x-pack/legacy/plugins/ml/public/jobs/new_job_new/recognize/components/job_settings_form.tsx +++ b/x-pack/legacy/plugins/ml/public/jobs/new_job_new/recognize/components/job_settings_form.tsx @@ -248,7 +248,9 @@ export const JobSettingsForm: FC = ({ }); }} showLabel={false} - label="" // TODO: Add label for a11y + label={i18n.translate('xpack.ml.newJob.recognize.useDedicatedIndexLabel', { + defaultMessage: 'Use dedicated index', + })} /> diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.tsx index e1838c76ee4b7..30e7aa368e74f 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.tsx @@ -60,7 +60,7 @@ export const JobSwitch = React.memo( onJobStateChange(job, job.latestTimestampMs || 0, e.target.checked); }} showLabel={false} - label="" // TODO: Add label for a11y + label="" /> )} diff --git a/x-pack/legacy/plugins/spaces/public/views/management/edit_space/enabled_features/feature_table.tsx b/x-pack/legacy/plugins/spaces/public/views/management/edit_space/enabled_features/feature_table.tsx index fc2ee77fdbdfa..91f14cf228c55 100644 --- a/x-pack/legacy/plugins/spaces/public/views/management/edit_space/enabled_features/feature_table.tsx +++ b/x-pack/legacy/plugins/spaces/public/views/management/edit_space/enabled_features/feature_table.tsx @@ -102,7 +102,7 @@ export class FeatureTable extends Component { id={record.feature.id} checked={checked} onChange={this.onChange(record.feature.id) as any} - label={checked ? `${record.feature.name} visible` : `${record.feature.name} disabled`} + label={`${record.feature.name} visible`} showLabel={false} /> );