diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/create_job.html b/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/create_job.html index 68729812b0690..608adad54fb43 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/create_job.html +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/create_job.html @@ -4,7 +4,12 @@
-

New job from {{ui.pageTitle}}

+

@@ -16,12 +21,18 @@

New job from {{ui.pageTitle}}

- Search will be overwritten +
-

- Using a saved search will mean the query used in the datafeeds will be different from the default ones we supply in the {{moduleId}} module. -

+

@@ -32,31 +43,43 @@

New job from {{ui.pageTitle}}

-

Job settings

+

-

Job Details

+

- Job ID prefix + + {{ ::'xpack.ml.newJob.simple.recognize.jobIdPrefixLabel' | i18n: {defaultMessage: 'Job ID prefix'} }} +
{{ ui.validation.checks.jobLabel.message }}
- Job groups + + {{ ::'xpack.ml.newJob.simple.recognize.jobGroupsLabel' | i18n: {defaultMessage: 'Job groups'} }} + Job Details
- - + +
@@ -96,9 +138,11 @@

Job Details

- - Start datafeed after save - +
@@ -107,71 +151,116 @@

Job Details

class='kuiCheckBox' ng-change="changeUseFullIndexData()" ng-model="formConfig.useFullIndexData" /> - - Use full {{formConfig.indexPattern.title}} data - +
-
Analysis running
+
+ + +
-

Jobs created - +

+ +

-

Some jobs failed to be created - +

+ +

- - View Results - +
-

Jobs creation failed - +

+ +

@@ -181,7 +270,11 @@

Jobs creation failed

-

Jobs

+

@@ -191,30 +284,42 @@

Jobs

-
Job
+
- - - - + + + +
-
Datafeed
+
- - - - + + + +
-
Running
+
- - - - + + + +
@@ -229,17 +334,21 @@

{{ui.kibanaLabels[key]}}

{{obj.title}} - (already exists) +
- - - - - + + + + +
diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/create_job_controller.js b/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/create_job_controller.js index 47265c841394c..6c2b216e49c58 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/create_job_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/recognize/create_job/create_job_controller.js @@ -49,7 +49,8 @@ module $scope, $window, $route, - Private) { + Private, + i18n) { const mlCreateRecognizerJobsService = Private(CreateRecognizerJobsServiceProvider); timefilter.disableTimeRangeSelector(); @@ -91,10 +92,27 @@ module combinedQuery } = createSearchItems(); const pageTitle = (savedSearch.id !== undefined) ? - `saved search ${savedSearch.title}` : `index pattern ${indexPattern.title}`; + i18n('xpack.ml.newJob.simple.recognize.savedSearchPageTitle', { + defaultMessage: 'saved search {savedSearchTitle}', + values: { savedSearchTitle: savedSearch.title } + }) : + i18n('xpack.ml.newJob.simple.recognize.indexPatternPageTitle', { + defaultMessage: 'index pattern {indexPatternTitle}', + values: { indexPatternTitle: indexPattern.title } + }); $scope.displayQueryWarning = (savedSearch.id !== undefined); + $scope.hideAdvancedButtonAriaLabel = i18n('xpack.ml.newJob.simple.recognize.hideAdvancedButtonAriaLabel', { + defaultMessage: 'Hide Advanced' + }); + $scope.showAdvancedButtonAriaLabel = i18n('xpack.ml.newJob.simple.recognize.showAdvancedButtonAriaLabel', { + defaultMessage: 'Show Advanced' + }); + $scope.showAdvancedAriaLabel = i18n('xpack.ml.newJob.simple.recognize.showAdvancedAriaLabel', { + defaultMessage: 'Show advanced' + }); + $scope.ui = { formValid: true, indexPattern, @@ -102,9 +120,15 @@ module showJobInput: true, numberOfJobs: 0, kibanaLabels: { - dashboard: 'Dashboards', - search: 'Searches', - visualization: 'Visualizations', + dashboard: i18n('xpack.ml.newJob.simple.recognize.dashboardsLabel', { + defaultMessage: 'Dashboards' + }), + search: i18n('xpack.ml.newJob.simple.recognize.searchesLabel', { + defaultMessage: 'Searches' + }), + visualization: i18n('xpack.ml.newJob.simple.recognize.visualizationsLabel', { + defaultMessage: 'Visualizations' + }), }, validation: { checks: { @@ -276,7 +300,12 @@ module } } else { job.jobState = SAVE_STATE.FAILED; - job.errors.push(`Could not save job ${jobId}`); + job.errors.push( + i18n('xpack.ml.newJob.simple.recognize.job.couldNotSaveJobErrorMessage', { + defaultMessage: 'Could not save job {jobId}', + values: { jobId } + }) + ); } // check results from saving the datafeeds @@ -293,7 +322,12 @@ module } } else { job.datafeedState = SAVE_STATE.FAILED; - job.errors.push(`Could not save datafeed ${datafeedId}`); + job.errors.push( + i18n('xpack.ml.newJob.simple.recognize.datafeed.couldNotSaveDatafeedErrorMessage', { + defaultMessage: 'Could not save datafeed {datafeedId}', + values: { datafeedId } + }) + ); } }); } @@ -311,7 +345,12 @@ module } } else { obj.saveState = SAVE_STATE.FAILED; - obj.errors.push(`Could not save ${objName} ${obj.id}`); + obj.errors.push( + i18n('xpack.ml.newJob.simple.recognize.kibanaObject.couldNotSaveErrorMessage', { + defaultMessage: 'Could not save {objName} {objId}', + values: { objName, objId: obj.id } + }) + ); } }); }); @@ -493,19 +532,25 @@ module // also to allow an empty label const label = `${$scope.formConfig.jobLabel}extra`; + + if (isJobIdValid(label) === false) { valid = false; checks.jobLabel.valid = false; - let msg = 'Job label can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; '; - msg += 'must start and end with an alphanumeric character'; + const msg = i18n('xpack.ml.newJob.simple.recognize.jobLabelAllowedCharactersDescription', { + defaultMessage: 'Job label can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; ' + + 'must start and end with an alphanumeric character' + }); checks.jobLabel.message = msg; } $scope.formConfig.jobGroups.forEach(group => { if (isJobIdValid(group) === false) { valid = false; checks.groupIds.valid = false; - let msg = 'Job group names can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; '; - msg += 'must start and end with an alphanumeric character'; + const msg = i18n('xpack.ml.newJob.simple.recognize.jobGroupAllowedCharactersDescription', { + defaultMessage: 'Job group names can contain lowercase alphanumeric (a-z and 0-9), hyphens or underscores; ' + + 'must start and end with an alphanumeric character' + }); checks.groupIds.message = msg; } });