From 00a01e70949789e26f65c8883dceb1ef57e669b0 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Thu, 13 Sep 2018 16:18:32 -0700 Subject: [PATCH] Localize JobDetails tabs. (#23020) --- .../job_details/tabs/tab_histogram.js | 20 ++- .../components/job_details/tabs/tab_json.js | 12 +- .../job_details/tabs/tab_metrics.js | 12 +- .../job_details/tabs/tab_summary.js | 143 ++++++++++++++---- .../components/job_details/tabs/tab_terms.js | 13 +- 5 files changed, 164 insertions(+), 36 deletions(-) diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js index b898a8af16cdc..72f681ced5dd5 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js @@ -5,6 +5,7 @@ */ import React, { Fragment } from 'react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; import { EuiTitle, @@ -14,7 +15,7 @@ import { EuiFlexItem, } from '@elastic/eui'; -export const TabHistogram = ({ histogram, histogramInterval }) => { +export const TabHistogramUi = ({ histogram, histogramInterval }) => { // TODO: Render a table if there are more than 20 fields. const renderedTerms = histogram.map(({ name }) => { @@ -30,13 +31,24 @@ export const TabHistogram = ({ histogram, histogramInterval }) => { -

Histogram

+

+ +

-

Interval: {histogramInterval}

+

+ +

@@ -51,3 +63,5 @@ export const TabHistogram = ({ histogram, histogramInterval }) => { ); }; + +export const TabHistogram = injectI18n(TabHistogramUi); diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_json.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_json.js index 49608e9a8a3c9..cbaf4bf5d87fc 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_json.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_json.js @@ -5,6 +5,7 @@ */ import React, { Fragment } from 'react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; import { EuiTitle, @@ -12,7 +13,7 @@ import { EuiCodeEditor, } from '@elastic/eui'; -export const TabJson = ({ +export const TabJsonUi = ({ json, }) => { const jsonString = JSON.stringify(json, null, 2); @@ -20,7 +21,12 @@ export const TabJson = ({ return ( -

JSON

+

+ +

@@ -38,3 +44,5 @@ export const TabJson = ({
); }; + +export const TabJson = injectI18n(TabJsonUi); diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_metrics.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_metrics.js index e24c9113e7c29..19b8e7713fa93 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_metrics.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_metrics.js @@ -5,6 +5,7 @@ */ import React, { Fragment } from 'react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; import { EuiDescriptionList, @@ -12,7 +13,7 @@ import { EuiSpacer, } from '@elastic/eui'; -export const TabMetrics = ({ metrics }) => { +export const TabMetricsUi = ({ metrics }) => { // TODO: Render a table if there are more than 20 metrics. const listMetrics = metrics.map(({ name, types }) => { return { @@ -24,7 +25,12 @@ export const TabMetrics = ({ metrics }) => { return ( -

Metrics

+

+ +

@@ -33,3 +39,5 @@ export const TabMetrics = ({ metrics }) => {
); }; + +export const TabMetrics = injectI18n(TabMetricsUi); diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js index aa67ed439e5a7..797bcfffac650 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js @@ -6,6 +6,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; +import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; import { EuiDescriptionList, @@ -18,7 +19,7 @@ import { import { JobStatus } from '../../job_status'; -export class TabSummary extends Component { +export class TabSummaryUi extends Component { static propTypes = { job: PropTypes.object.isRequired, stats: PropTypes.object, @@ -44,24 +45,37 @@ export class TabSummary extends Component { -

Stats

+

+ +

- - - Status - + + + + + - - - - + + + - Documents processed + + + @@ -69,7 +83,12 @@ export class TabSummary extends Component { - Pages processed + + + @@ -77,7 +96,12 @@ export class TabSummary extends Component { - Rollups indexed + + + @@ -85,7 +109,12 @@ export class TabSummary extends Component { - Trigger count + + + @@ -112,14 +141,24 @@ export class TabSummary extends Component { return ( -

Logistics

+

+ +

- Index pattern + + + @@ -127,7 +166,12 @@ export class TabSummary extends Component { - Rollup index + + + @@ -135,9 +179,19 @@ export class TabSummary extends Component { - Cron{' '} + + + {' '} + )} /> @@ -149,14 +203,24 @@ export class TabSummary extends Component { -

Date histogram

+

+ +

- Time field + + + @@ -164,7 +228,12 @@ export class TabSummary extends Component { - Timezone + + + @@ -172,17 +241,37 @@ export class TabSummary extends Component { - Delay + + + - {dateHistogramDelay || 'None'} + {dateHistogramDelay || ( + + )} - Interval{' '} + + + {' '} + )} /> @@ -196,3 +285,5 @@ export class TabSummary extends Component { ); } } + +export const TabSummary = injectI18n(TabSummaryUi); diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_terms.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_terms.js index 0695a66b423ce..b5042d65c5fc3 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_terms.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_terms.js @@ -5,6 +5,7 @@ */ import React, { Fragment } from 'react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; import { EuiTitle, @@ -12,9 +13,8 @@ import { EuiText, } from '@elastic/eui'; -export const TabTerms = ({ terms }) => { +export const TabTermsUi = ({ terms }) => { // TODO: Render a table if there are more than 20 fields. - const renderedTerms = terms.map(({ name }) => { return (
  • @@ -26,7 +26,12 @@ export const TabTerms = ({ terms }) => { return ( -

    Terms

    +

    + +

    @@ -39,3 +44,5 @@ export const TabTerms = ({ terms }) => {
    ); }; + +export const TabTerms = injectI18n(TabTermsUi);