Skip to content

Commit

Permalink
[i18n] Translate ML - New Job - population (#27388) (#27954)
Browse files Browse the repository at this point in the history
* Translate new_job population

* Separate id for documentCount chart and other charts

* Resolve part of comments

* Fix issues
  • Loading branch information
pavel06081991 authored and Nox911 committed Jan 3, 2019
1 parent 06bb4ee commit afb3447
Show file tree
Hide file tree
Showing 3 changed files with 230 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@
<div ng-controller="MlCreatePopulationJob" class="population-job-container">
<div class="row">
<div class="col-md-6">
<h3 class="euiTitle euiTitle--large">New job from {{ui.pageTitle}}</h3>
<h3
class="euiTitle euiTitle--large"
i18n-id="xpack.ml.newJob.simple.population.newJobFromTitle"
i18n-default-message="New job from {pageTitle}"
i18n-values="{ pageTitle: ui.pageTitle }"
></h3>
</div>
<div class="col-md-6">
<div class="pull-right">
<span style="font-size:10px;" ng-show="formConfig.chartInterval !== undefined">Chart interval: {{formConfig.chartInterval.getInterval().expression}}</span>
<span
style="font-size:10px;"
ng-show="formConfig.chartInterval !== undefined"
i18n-id="xpack.ml.newJob.simple.population.chartIntervalLabel"
i18n-default-message="Chart interval: {interval}"
i18n-values="{ interval: formConfig.chartInterval.getInterval().expression }"
></span>
<ml-full-time-range-selector
disabled='(jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED)'
index-pattern='ui.indexPattern'
Expand All @@ -24,10 +35,18 @@ <h3 class="euiTitle euiTitle--large">New job from {{ui.pageTitle}}</h3>
<div class="row">
<div class="col-md-4">
<div class="row form-controls">
<h4 class="euiTitle euiTitle--small">Job settings</h4>
<h4
class="euiTitle euiTitle--small"
i18n-id="xpack.ml.newJob.simple.population.jobSettingsTitle"
i18n-default-message="Job settings"
></h4>
<div>
<div class='form-section form-section-overflow' >
<h4 class="euiTitle euiTitle--small">Population</h4>
<h4
class="euiTitle euiTitle--small"
i18n-id="xpack.ml.newJob.simple.population.populationTitle"
i18n-default-message="Population"
></h4>
<div class="euiSpacer euiSpacer--s"></div>
<div class="row">
<div class="col-md-12">
Expand All @@ -37,7 +56,7 @@ <h4 class="euiTitle euiTitle--small">Population</h4>
on-select="overChange()"
ng-disabled="jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED"
append-to-body=true>
<ui-select-match placeholder="Select population field">
<ui-select-match placeholder="{{ ::'xpack.ml.newJob.simple.population.selectPopulationFieldPlaceholder' | i18n: {defaultMessage: 'Select population field'} }}">
<ml-field-type-icon type="$select.selected.mlType"></ml-field-type-icon>{{$select.selected.name}}
</ui-select-match>
<ui-select-choices repeat="field in ui.overFields | filter: { name: $select.search }" group-by="'mlType'">
Expand Down Expand Up @@ -88,7 +107,11 @@ <h4 class="euiTitle euiTitle--small">Split Data</h4>

<div class='form-section' >
<div ng-show="jobState !== JOB_STATE.FINISHED">
<h4 class="euiTitle euiTitle--small">Job Details</h4>
<h4
class="euiTitle euiTitle--small"
i18n-id="xpack.ml.newJob.simple.population.jobDetailsTitle"
i18n-default-message="Job Details"
></h4>
<div class="euiSpacer euiSpacer--s"></div>
</div>

Expand All @@ -97,7 +120,12 @@ <h4 class="euiTitle euiTitle--small">Job Details</h4>
<ml-general-job-details></ml-general-job-details>

<div class="form-group">
<a href="" ng-click="moveToAdvancedJobCreation()">Move to advanced job configuration</a>
<a
href=""
ng-click="moveToAdvancedJobCreation()"
i18n-id="xpack.ml.newJob.simple.population.moveToAdvancedJobConfigurationLinkText"
i18n-default-message="Move to advanced job configuration"
></a>
</div>

<div class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--responsive">
Expand All @@ -113,72 +141,97 @@ <h4 class="euiTitle euiTitle--small">Job Details</h4>
</div>
<div class="euiFlexItem euiFlexItem--flexGrowZero">
<button
aria-label="Create Job"
aria-label="{{ ::'xpack.ml.newJob.simple.population.createJobButtonAriaLabel' | i18n: {defaultMessage: 'Create Job'} }}"
ng-click="createJob()"
type="button"
ng-show="jobState === JOB_STATE.NOT_STARTED"
ng-disabled="!ui.formValid"
class="euiButton euiButton--primary euiButton--small euiButton--fill">
<span class="euiButton__content">
Create Job
</span>
<span
class="euiButton__content"
i18n-id="xpack.ml.newJob.simple.population.createJobButtonLabel"
i18n-default-message="Create Job"
></span>
</button>
</div>
</div>

<div class='job-state-info' ng-show="jobState === JOB_STATE.RUNNING">Analysis running <i class='fa fa-spinner fa-spin'></i></div>
<div class='job-state-info' ng-show="jobState === JOB_STATE.STOPPING">Analysis stopping <i class='fa fa-spinner fa-spin'></i></div>
<div class='job-state-info' ng-show="jobState === JOB_STATE.RUNNING">
<span
i18n-id="xpack.ml.newJob.simple.population.analysisRunningLabel"
i18n-default-message="Analysis running"
></span>
<i class='fa fa-spinner fa-spin'></i>
</div>
<div class='job-state-info' ng-show="jobState === JOB_STATE.STOPPING">
<span
i18n-id="xpack.ml.newJob.simple.population.analysisStoppingLabel"
i18n-default-message="Analysis stopping"
></span>
<i class='fa fa-spinner fa-spin'></i>
</div>

<div class="euiSpacer euiSpacer--s"></div>

<button
aria-label="Stop Job"
aria-label="{{ ::'xpack.ml.newJob.simple.population.stopJobButtonAriaLabel' | i18n: {defaultMessage: 'Stop Job'} }}"
ng-click="stopJob()"
type="button"
ng-show="jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING"
ng-disabled="jobState === JOB_STATE.STOPPING"
class="euiButton euiButton--danger euiButton--small">
<span class="euiButton__content">
{{(jobState === JOB_STATE.STOPPING) ? 'Analysis stopping' : 'Stop analysis' }}
{{(jobState === JOB_STATE.STOPPING) ? analysisStoppingLabel : stopAnalysisLabel }}
</span>
</button>

<a
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">
<span class="euiButton__content">
View Results
</span>
<span
class="euiButton__content"
i18n-id="xpack.ml.newJob.simple.population.viewResultsLinkText"
i18n-default-message="View Results"
></span>
</a>
</div>
<div ng-show="jobState === JOB_STATE.FINISHED">
<h3 class="euiTitle euiTitle--large">Job {{formConfig.jobId }} created
<i style="color:green;" class="fa fa-check" aria-label="Job finished"></i>
<h3 class="euiTitle euiTitle--large">
<span
i18n-id="xpack.ml.newJob.simple.population.jobCreatedTitle"
i18n-default-message="Job {jobId} created"
i18n-values="{ jobId: formConfig.jobId }"
></span>
<i style="color:green;" class="fa fa-check" aria-label="{{ ::'xpack.ml.newJob.simple.population.jobFinishedAriaLabel' | i18n: {defaultMessage: 'Job finished'} }}"></i>
</h3>
<div class="euiSpacer euiSpacer--m"></div>

<button
aria-label="Reset"
aria-label="{{ ::'xpack.ml.newJob.simple.population.resetButtonAriaLabel' | i18n: {defaultMessage: 'Reset'} }}"
ng-click="resetJob()"
type="button"
class="euiButton euiButton--primary euiButton--small euiButton--fill">
<span class="euiButton__content">
Reset
</span>
<span
class="euiButton__content"
i18n-id="xpack.ml.newJob.simple.population.resetButtonLabel"
i18n-default-message="Reset"
></span>
</button>
<a
href='{{resultsUrl}}'
id="job_finished_view_results_link"
ng-click="addNewJobToRecentlyAccessed(formConfig.jobId, resultsUrl)"
aria-label="View results of finished job"
aria-label="{{ ::'xpack.ml.newJob.simple.population.viewResultsOfFinishedJobAriaLabel' | i18n: {defaultMessage: 'View results of finished job'} }}"
class="euiButton euiButton--primary euiButton--small euiButton--fill">
<span class="euiButton__content">
View Results
</span>
<span
class="euiButton__content"
i18n-id="xpack.ml.newJob.simple.population.viewResultsLinkText"
i18n-default-message="View Results"
></span>
</a>
</div>

Expand All @@ -197,10 +250,18 @@ <h3 class="euiTitle euiTitle--large">Job {{formConfig.jobId }} created
</div>
<div class="col-md-8">
<div class="row charts-container">
<h4 class="euiTitle euiTitle--small">Results</h4>
<h4
class="euiTitle euiTitle--small"
i18n-id="xpack.ml.newJob.simple.population.resultsTitle"
i18n-default-message="Results"
></h4>
<div>
<div class='chart-list-panel event-rate-container' style='height: {{ui.eventRateChartHeight + 70}}px;'>
<label class="kuiFormLabel">Document count</label>
<label
class="kuiFormLabel"
i18n-id="xpack.ml.newJob.simple.population.documentCountLabel"
i18n-default-message="Document count"
></label>

<div class='chart-container'>
<div style='height: {{ui.eventRateChartHeight + 25}}px;'>
Expand All @@ -220,8 +281,27 @@ <h2 class="euiTitle euiTitle"><i class='fa fa-spinner fa-spin'></i></h2>
</div>
<div class='status-label' ng-if="chartStates.eventRate === CHART_STATE.NO_RESULTS">
<div class='no-results'>
<h4 class="euiTitle euiTitle--small"><i class="fa fa-info-circle"></i> No results found</h4>
<span>Consider using the <a ng-click="setFullTimeRange()">full {{ui.indexPattern.title}} data</a></span>
<h4 class="euiTitle euiTitle--small">
<i class="fa fa-info-circle"></i>
<span
i18n-id="xpack.ml.newJob.simple.population.documentCountChart.noResultsFoundTitle"
i18n-default-message="No results found"
></span>
</h4>
<span>
<span
i18n-id="xpack.ml.newJob.simple.population.documentCountChart.noResultsDescription"
i18n-default-message="Consider using the"
i18n-description="Part of composite text xpack.ml.newJob.simple.population.documentCountChart.noResultsDescription + xpack.ml.newJob.simple.population.documentCountChart.fullIndexPatternDataLinkText"
></span>
<a
ng-click="setFullTimeRange()"
i18n-id="xpack.ml.newJob.simple.population.documentCountChart.fullIndexPatternDataLinkText"
i18n-default-message="full {indexPatternTitle} data"
i18n-values="{ indexPatternTitle: ui.indexPattern.title }"
i18n-description="Part of composite text xpack.ml.newJob.simple.population.documentCountChart.noResultsDescription + xpack.ml.newJob.simple.population.documentCountChart.fullIndexPatternDataLinkText"
></a>
</span>
</div>
</div>
</div>
Expand All @@ -234,9 +314,26 @@ <h4 class="euiTitle euiTitle--small"><i class="fa fa-info-circle"></i> No result
<div class='card-front'>
<div class="card-title"></div>
<div class='chart' style='height: {{ui.chartHeight + 90}}px;'>
<label class="kuiFormLabel">{{formConfig.fields[id].agg.type.title}} {{formConfig.fields[id].name}} over {{formConfig.overField.name}} <span ng-if="formConfig.fields[id].splitField!==undefined"> split by {{formConfig.fields[id].splitField.name}}</span></label>
<label
ng-if="formConfig.fields[id].splitField === undefined"
class="kuiFormLabel"
i18n-id="xpack.ml.newJob.simple.population.chart.chartWithoutSplitFieldLabel"
i18n-default-message="{aggTypeTitle} {fieldName} over {overFieldName}"
i18n-values="{ aggTypeTitle: formConfig.fields[id].agg.type.title, fieldName: formConfig.fields[id].name, overFieldName: formConfig.overField.name }"
></label>
<label
ng-if="formConfig.fields[id].splitField !== undefined"
class="kuiFormLabel"
i18n-id="xpack.ml.newJob.simple.population.chart.chartWithSplitFieldLabel"
i18n-default-message="{aggTypeTitle} {fieldName} over {overFieldName} split by {splitFieldName}"
i18n-values="{ aggTypeTitle: formConfig.fields[id].agg.type.title, fieldName: formConfig.fields[id].name, overFieldName: formConfig.overField.name, splitFieldName: formConfig.fields[id].splitField.name }"
></label>
<div class="split-controls">
<div class="split-align">Split data: </div>
<div
class="split-align"
i18n-id="xpack.ml.newJob.simple.population.chart.splitDataLabel"
i18n-default-message="Split data:"
></div>
<div class="split-field-container">
<ui-select
class="split-field-select"
Expand All @@ -245,7 +342,7 @@ <h4 class="euiTitle euiTitle--small"><i class="fa fa-info-circle"></i> No result
append-to-body="true"
ng-disabled="ui.formValid === false || jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED"
>
<ui-select-match placeholder="Select a field">
<ui-select-match placeholder="{{ ::'xpack.ml.newJob.simple.population.chart.splitFieldPlaceholder' | i18n: {defaultMessage: 'Select a field'} }}">
<ml-field-type-icon type="$select.selected.mlType"></ml-field-type-icon>{{$select.selected.name}}
</ui-select-match>
<ui-select-choices repeat="field in ui.splitFields | filter: { name: $select.search } | filter: ui.isOverField" group-by="'mlType'">
Expand All @@ -262,12 +359,12 @@ <h4 class="euiTitle euiTitle--small"><i class="fa fa-info-circle"></i> No result
<button
ng-if="formConfig.fields[id].splitField !== undefined && (!ui.formValid === false || jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED)"
ng-click="splitReset(id)"
aria-label="Remove split"
aria-label="{{ ::'xpack.ml.newJob.simple.population.chart.removeSplitButtonAriaLabel' | i18n: {defaultMessage: 'Remove split'} }}"
ng-disabled="jobState === JOB_STATE.RUNNING || jobState === JOB_STATE.STOPPING || jobState === JOB_STATE.FINISHED"
class="euiButton euiButton--primary euiButton--small split-align remove-split"
>
Remove split
</button>
i18n-id="xpack.ml.newJob.simple.population.chart.removeSplitButtonLabel"
i18n-default-message="Remove split"
></button>
</div>

<div class='chart-container'>
Expand All @@ -289,7 +386,13 @@ <h2 class="euiTitle euiTitle"><i class='fa fa-spinner fa-spin'></i></h2>
</div>
<div class='status-label' ng-show="chartStates.fields[id] === CHART_STATE.NO_RESULTS">
<div class='no-results'>
<h4 class="euiTitle euiTitle--small"><i class="fa fa-info-circle"></i> No results found</h4>
<h4 class="euiTitle euiTitle--small">
<i class="fa fa-info-circle"></i>
<span
i18n-id="xpack.ml.newJob.simple.population.chart.noResultsFoundTitle"
i18n-default-message="No results found"
></span>
</h4>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit afb3447

Please sign in to comment.