diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job.html b/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job.html index 3582600935309..4bcb7eb7226a9 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job.html +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job.html @@ -5,11 +5,22 @@
-

New job from {{ui.pageTitle}}

+

- Chart interval: {{formConfig.chartInterval.getInterval().expression}} + New job from {{ui.pageTitle}}
-

Job settings

+

-

Population

+

@@ -37,7 +56,7 @@

Population

on-select="overChange()" ng-disabled="jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED" append-to-body=true> - + {{$select.selected.name}} @@ -88,7 +107,11 @@

Split Data

-

Job Details

+

@@ -97,7 +120,12 @@

Job Details

@@ -113,33 +141,47 @@

Job Details

-
Analysis running
-
Analysis stopping
+
+ + +
+
+ + +
@@ -147,38 +189,49 @@

Job Details

href='{{resultsUrl}}' id="job_running_view_results_link" ng-click="addNewJobToRecentlyAccessed(formConfig.jobId, resultsUrl)" - aria-label="View results of running job" + aria-label="{{ ::'xpack.ml.newJob.simple.population.viewResultsOfRunningJobAriaLabel' | i18n: {defaultMessage: 'View results of running job'} }}" ng-show="jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING" class="euiButton euiButton--primary euiButton--small euiButton--fill"> - - View Results - +
-

Job {{formConfig.jobId }} created - +

+ +

- - View Results - +
@@ -197,10 +250,18 @@

Job {{formConfig.jobId }} created

-

Results

+

- +
@@ -220,8 +281,27 @@

-

No results found

- Consider using the full {{ui.indexPattern.title}} data +

+ + +

+ + + +
@@ -234,9 +314,26 @@

No result
- + +
-
Split data:
+
No result append-to-body="true" ng-disabled="ui.formValid === false || jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED" > - + {{$select.selected.name}} @@ -262,12 +359,12 @@

No result + i18n-id="xpack.ml.newJob.simple.population.chart.removeSplitButtonLabel" + i18n-default-message="Remove split" + >

@@ -289,7 +386,13 @@

-

No results found

+

+ + +

diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job_chart_directive.js b/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job_chart_directive.js index ff2cb27c141ff..13cd21daa6bba 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job_chart_directive.js +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job_chart_directive.js @@ -24,7 +24,7 @@ import { mlChartTooltipService } from '../../../../../components/chart_tooltip/c import { uiModules } from 'ui/modules'; const module = uiModules.get('apps/ml'); -module.directive('mlPopulationJobChart', function () { +module.directive('mlPopulationJobChart', function (i18n) { function link(scope, element) { @@ -233,12 +233,14 @@ module.directive('mlPopulationJobChart', function () { const formattedDate = formatHumanReadableDateTime(data.date); contents += `${formattedDate}

`; contents += `${mlEscape(scope.overFieldName)}: ${mlEscape(data.label)}
`; - if (scope.chartData.fieldFormat !== undefined) { - contents += `Value: ${scope.chartData.fieldFormat.convert(data.value, 'text')}`; - } else { - contents += `Value: ${parseInt(data.value)}`; - } - + contents += i18n('xpack.ml.newJob.simple.population.chartTooltipValueLabel', { + defaultMessage: 'Value: {dataValue}', + values: { + dataValue: scope.chartData.fieldFormat !== undefined + ? scope.chartData.fieldFormat.convert(data.value, 'text') + : parseInt(data.value) + } + }); mlChartTooltipService.show(contents, el, { x: 5, y: 10 diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job_controller.js b/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job_controller.js index 47fc87cb00ecc..ad3350700f4e7 100644 --- a/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job_controller.js +++ b/x-pack/plugins/ml/public/jobs/new_job/simple/population/create_job/create_job_controller.js @@ -67,7 +67,8 @@ module $scope, $timeout, Private, - AppState) { + AppState, + i18n) { timefilter.enableTimeRangeSelector(); timefilter.disableAutoRefreshSelector(); @@ -121,7 +122,21 @@ module timeBasedIndexCheck(indexPattern, true); const pageTitle = (savedSearch.id !== undefined) ? - `saved search ${savedSearch.title}` : `index pattern ${indexPattern.title}`; + i18n('xpack.ml.newJob.simple.population.savedSearchPageTitle', { + defaultMessage: 'saved search {savedSearchTitle}', + values: { savedSearchTitle: savedSearch.title } + }) : + i18n('xpack.ml.newJob.simple.population.indexPatternPageTitle', { + defaultMessage: 'index pattern {indexPatternTitle}', + values: { indexPatternTitle: indexPattern.title } + }); + + $scope.analysisStoppingLabel = i18n('xpack.ml.newJob.simple.population.analysisStoppingLabel', { + defaultMessage: 'Analysis stopping' + }); + $scope.stopAnalysisLabel = i18n('xpack.ml.newJob.simple.population.stopAnalysisLabel', { + defaultMessage: 'Stop analysis' + }); $scope.ui = { indexPattern, @@ -140,34 +155,54 @@ module timeFields: [], splitText: '', intervals: [{ - title: 'Auto', + title: i18n('xpack.ml.newJob.simple.population.intervals.autoTitle', { + defaultMessage: 'Auto' + }), value: 'auto', }, { - title: 'Millisecond', + title: i18n('xpack.ml.newJob.simple.population.intervals.millisecondTitle', { + defaultMessage: 'Millisecond' + }), value: 'ms' }, { - title: 'Second', + title: i18n('xpack.ml.newJob.simple.population.intervals.secondTitle', { + defaultMessage: 'Second' + }), value: 's' }, { - title: 'Minute', + title: i18n('xpack.ml.newJob.simple.population.intervals.minuteTitle', { + defaultMessage: 'Minute' + }), value: 'm' }, { - title: 'Hourly', + title: i18n('xpack.ml.newJob.simple.population.intervals.hourlyTitle', { + defaultMessage: 'Hourly' + }), value: 'h' }, { - title: 'Daily', + title: i18n('xpack.ml.newJob.simple.population.intervals.dailyTitle', { + defaultMessage: 'Daily' + }), value: 'd' }, { - title: 'Weekly', + title: i18n('xpack.ml.newJob.simple.population.intervals.weeklyTitle', { + defaultMessage: 'Weekly' + }), value: 'w' }, { - title: 'Monthly', + title: i18n('xpack.ml.newJob.simple.population.intervals.monthlyTitle', { + defaultMessage: 'Monthly' + }), value: 'M' }, { - title: 'Yearly', + title: i18n('xpack.ml.newJob.simple.population.intervals.yearlyTitle', { + defaultMessage: 'Yearly' + }), value: 'y' }, { - title: 'Custom', + title: i18n('xpack.ml.newJob.simple.population.intervals.customTitle', { + defaultMessage: 'Custom' + }), value: 'custom' }], eventRateChartHeight: 100, @@ -292,7 +327,7 @@ module function initAgg() { _.each($scope.ui.aggTypeOptions, (agg) => { - if (agg.title === 'Mean') { + if (agg.mlName === 'mean') { $scope.formConfig.agg.type = agg; } }); @@ -481,8 +516,17 @@ module saveNewDatafeed(job, true); }) .catch((resp) => { - msgs.error('Could not open job: ', resp); - msgs.error('Job created, creating datafeed anyway'); + msgs.error( + i18n('xpack.ml.newJob.simple.population.couldNotOpenJobErrorMessage', { + defaultMessage: 'Could not open job:', + }), + resp + ); + msgs.error( + i18n('xpack.ml.newJob.simple.population.jobCreatedAndDatafeedCreatingAnywayErrorMessage', { + defaultMessage: 'Job created, creating datafeed anyway' + }) + ); // if open failed, still attempt to create the datafeed // as it may have failed because we've hit the limit of open jobs saveNewDatafeed(job, false); @@ -491,7 +535,12 @@ module }) .catch((resp) => { // save failed - msgs.error('Save failed: ', resp.resp); + msgs.error( + i18n('xpack.ml.newJob.simple.population.saveFailedErrorMessage', { + defaultMessage: 'Save failed:', + }), + resp.resp + ); }); } else { // show the advanced section as the model memory limit is invalid @@ -534,12 +583,22 @@ module }) .catch((resp) => { // datafeed failed - msgs.error('Could not start datafeed: ', resp); + msgs.error( + i18n('xpack.ml.newJob.simple.population.couldNotStartDatafeedErrorMessage', { + defaultMessage: 'Could not start datafeed:' + }), + resp + ); }); } }) .catch((resp) => { - msgs.error('Save datafeed failed: ', resp); + msgs.error( + i18n('xpack.ml.newJob.simple.population.saveDatafeedFailedErrorMessage', { + defaultMessage: 'Save datafeed failed:', + }), + resp + ); }); } };