diff --git a/x-pack/plugins/monitoring/public/components/license/index.js b/x-pack/plugins/monitoring/public/components/license/index.js index e4fb7b6a57e0..79d95b6cbf62 100644 --- a/x-pack/plugins/monitoring/public/components/license/index.js +++ b/x-pack/plugins/monitoring/public/components/license/index.js @@ -13,6 +13,7 @@ import { EuiPanel } from '@elastic/eui'; import { LicenseStatus, AddLicense } from 'plugins/xpack_main/components'; +import { FormattedMessage } from '@kbn/i18n/react'; const LicenseUpdateInfoForPrimary = ({ isPrimaryCluster, uploadLicensePath }) => { if (!isPrimaryCluster) { @@ -32,8 +33,14 @@ const LicenseUpdateInfoForRemote = ({ isPrimaryCluster }) => { return (

- To update the license for this cluster, provide the license file through - the Elasticsearch API: +

diff --git a/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js b/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js index 2a35f5de04a0..4e9a99671b41 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js @@ -6,12 +6,12 @@ import React from 'react'; import { boomify, forbidden } from 'boom'; -import { render } from 'enzyme'; +import { renderWithIntl } from '../../../../../../test_utils/enzyme_helpers'; import { CheckerErrors } from '../checker_errors'; describe('CheckerErrors', () => { test('should render nothing if errors is empty', () => { - const component = render(); + const component = renderWithIntl(); expect(component).toMatchSnapshot(); }); @@ -19,7 +19,7 @@ describe('CheckerErrors', () => { const err1 = forbidden(new Error('no access for you')); const err2 = boomify(new Error('bad thing happened')); const errors = [err1, err2].map(err => err.output.payload); - const component = render(); + const component = renderWithIntl(); expect(component).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/monitoring/public/components/no_data/__tests__/no_data.test.js b/x-pack/plugins/monitoring/public/components/no_data/__tests__/no_data.test.js index 43a6d8603340..df62c7a239fa 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/__tests__/no_data.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/__tests__/no_data.test.js @@ -5,14 +5,14 @@ */ import React from 'react'; -import { render } from 'enzyme'; +import { renderWithIntl } from '../../../../../../test_utils/enzyme_helpers'; import { NoData } from '../'; const enabler = {}; describe('NoData', () => { test('should show text next to the spinner while checking a setting', () => { - const component = render( + const component = renderWithIntl( { }); test('should show a default message if reason is unknown', () => { - const component = render( + const component = renderWithIntl( { return ( -

You need to make some adjustments

+

+ +

-

To run monitoring please perform the following steps

+

+ +

diff --git a/x-pack/plugins/monitoring/public/components/no_data/blurbs/looking_for.js b/x-pack/plugins/monitoring/public/components/no_data/blurbs/looking_for.js index 00d52e788ced..001b95e6ae99 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/blurbs/looking_for.js +++ b/x-pack/plugins/monitoring/public/components/no_data/blurbs/looking_for.js @@ -6,16 +6,27 @@ import React, { Fragment } from 'react'; import { EuiTitle, EuiText, EuiTextColor } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; export const LookingFor = () => { return ( -

We're looking for your monitoring data

+

+ +

-

Monitoring provides insight to your hardware performance and load.

+

+ +

diff --git a/x-pack/plugins/monitoring/public/components/no_data/blurbs/what_is.js b/x-pack/plugins/monitoring/public/components/no_data/blurbs/what_is.js index 2e92b521ce89..29d52cffc22e 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/blurbs/what_is.js +++ b/x-pack/plugins/monitoring/public/components/no_data/blurbs/what_is.js @@ -6,17 +6,26 @@ import React, { Fragment } from 'react'; import { EuiTitle, EuiText, EuiTextColor } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; export const WhatIs = () => { return ( -

Monitoring is currently off

+

+ +

- Monitoring provides insight to your hardware performance and load. +

diff --git a/x-pack/plugins/monitoring/public/components/no_data/checker_errors.js b/x-pack/plugins/monitoring/public/components/no_data/checker_errors.js index 22179c4dc44a..fc87f732372b 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/checker_errors.js +++ b/x-pack/plugins/monitoring/public/components/no_data/checker_errors.js @@ -13,6 +13,7 @@ import { EuiDescriptionListDescription, EuiSpacer, } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; const ErrorList = ({ errors }) => { return errors.map((error, errorIndex) => { @@ -44,9 +45,12 @@ export function CheckerErrors(props) { className="eui-textLeft" >

- There were some errors encountered in trying to check Elasticsearch - settings. You need administrator rights to check the settings and, if - needed, to enable the monitoring collection setting. +

diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__tests__/__snapshots__/collection_enabled.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__tests__/__snapshots__/collection_enabled.test.js.snap index 5d6aa8c0d577..8e4087812da3 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__tests__/__snapshots__/collection_enabled.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__tests__/__snapshots__/collection_enabled.test.js.snap @@ -9,6 +9,88 @@ exports[`ExplainCollectionEnabled should explain about xpack.monitoring.collecti "enableCollectionEnabled": [Function], } } + intl={ + Object { + "defaultFormats": Object { + "date": Object { + "full": Object { + "day": "numeric", + "month": "long", + "weekday": "long", + "year": "numeric", + }, + "long": Object { + "day": "numeric", + "month": "long", + "year": "numeric", + }, + "medium": Object { + "day": "numeric", + "month": "short", + "year": "numeric", + }, + "short": Object { + "day": "numeric", + "month": "numeric", + "year": "2-digit", + }, + }, + "number": Object { + "currency": Object { + "style": "currency", + }, + "percent": Object { + "style": "percent", + }, + }, + "time": Object { + "full": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "long": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "medium": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + }, + "short": Object { + "hour": "numeric", + "minute": "numeric", + }, + }, + }, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": Symbol(react.fragment), + "timeZone": null, + } + } property="xpack.monitoring.collection.enabled" > @@ -19,7 +101,13 @@ exports[`ExplainCollectionEnabled should explain about xpack.monitoring.collecti

- Monitoring is currently off + + Monitoring is currently off +

- Monitoring provides insight to your hardware performance and load. + + Monitoring provides insight to your hardware performance and load. +

@@ -60,52 +154,72 @@ exports[`ExplainCollectionEnabled should explain about xpack.monitoring.collecti className="euiText euiText--medium" >

- We checked the - cluster - settings and found that - - - - - xpack.monitoring.collection.enabled - - - - - is set to - - - - + -1 - - - - - . + , + "property": + xpack.monitoring.collection.enabled + , + } + } + > + We checked the cluster settings and found that + + + + + xpack.monitoring.collection.enabled + + + + + is set to + + + + + -1 + + + + + . +

- Would you like to turn it on? + + Would you like to turn it on? +

@@ -155,7 +269,13 @@ exports[`ExplainCollectionEnabled should explain about xpack.monitoring.collecti - Turn on monitoring + + Turn on monitoring + diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__tests__/collection_enabled.test.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__tests__/collection_enabled.test.js index 48c6b3b47960..67d0c12d65b0 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__tests__/collection_enabled.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/__tests__/collection_enabled.test.js @@ -6,7 +6,7 @@ import React from 'react'; import sinon from 'sinon'; -import { mount } from 'enzyme'; +import { mountWithIntl } from '../../../../../../../../test_utils/enzyme_helpers'; import { ExplainCollectionEnabled } from '../collection_enabled'; import { findTestSubject } from '@elastic/eui/lib/test'; @@ -27,12 +27,12 @@ describe('ExplainCollectionEnabled', () => { }); test('should explain about xpack.monitoring.collection.enabled setting', () => { - const rendered = mount(component); + const rendered = mountWithIntl(component); expect(rendered).toMatchSnapshot(); }); test('should have a button that triggers ajax action', () => { - const rendered = mount(component); + const rendered = mountWithIntl(component); const actionButton = findTestSubject(rendered, 'enableCollectionEnabled'); actionButton.simulate('click'); expect(enabler.enableCollectionEnabled.calledOnce).toBe(true); diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.js index 9f94ad56d3e8..ad796a84b16d 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.js @@ -18,6 +18,7 @@ import { EuiTitle } from '@elastic/eui'; import { WhatIs } from '../../blurbs'; +import { FormattedMessage } from '@kbn/i18n/react'; export class ExplainCollectionEnabled extends React.Component { constructor(props) { @@ -59,11 +60,22 @@ export class ExplainCollectionEnabled extends React.Component {

- We checked the {context} settings and found that {property} - is set to {data}. + {property}), + data: ({data}) + }} + />

- Would you like to turn it on? +

@@ -80,7 +92,10 @@ export class ExplainCollectionEnabled extends React.Component { data-test-subj="enableCollectionEnabled" isLoading={isCollectionEnabledUpdating} > - Turn on monitoring + @@ -89,20 +104,33 @@ export class ExplainCollectionEnabled extends React.Component { const stillWaiting = this.state.waitedTooLong ? (

- Still waiting? + + +

) : null; const renderSuccess = () => ( -

Success! Getting your monitoring data.

+

+ +

- When the data is in your cluster, your monitoring dashboard will - show up here. This might take a few seconds. +

diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap index 21175039904d..2c4f2690ca17 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/__snapshots__/collection_interval.test.js.snap @@ -9,6 +9,88 @@ exports[`ExplainCollectionInterval collection interval setting updates should sh "enableCollectionInterval": [Function], } } + intl={ + Object { + "defaultFormats": Object { + "date": Object { + "full": Object { + "day": "numeric", + "month": "long", + "weekday": "long", + "year": "numeric", + }, + "long": Object { + "day": "numeric", + "month": "long", + "year": "numeric", + }, + "medium": Object { + "day": "numeric", + "month": "short", + "year": "numeric", + }, + "short": Object { + "day": "numeric", + "month": "numeric", + "year": "2-digit", + }, + }, + "number": Object { + "currency": Object { + "style": "currency", + }, + "percent": Object { + "style": "percent", + }, + }, + "time": Object { + "full": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "long": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "medium": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + }, + "short": Object { + "hour": "numeric", + "minute": "numeric", + }, + }, + }, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": Symbol(react.fragment), + "timeZone": null, + } + } isCollectionIntervalUpdated={true} isCollectionIntervalUpdating={false} property="xpack.monitoring.collection.interval" @@ -20,7 +102,13 @@ exports[`ExplainCollectionInterval collection interval setting updates should sh

- Success! Wait a moment please. + + Success! Wait a moment please. +

- As soon as monitoring data appears in your cluster the page will automatically refresh with your monitoring dashboard. This only takes only a few seconds. + + As soon as monitoring data appears in your cluster the page will automatically refresh with your monitoring dashboard. This only takes only a few seconds. +

@@ -69,6 +163,88 @@ exports[`ExplainCollectionInterval collection interval setting updates should sh "enableCollectionInterval": [Function], } } + intl={ + Object { + "defaultFormats": Object { + "date": Object { + "full": Object { + "day": "numeric", + "month": "long", + "weekday": "long", + "year": "numeric", + }, + "long": Object { + "day": "numeric", + "month": "long", + "year": "numeric", + }, + "medium": Object { + "day": "numeric", + "month": "short", + "year": "numeric", + }, + "short": Object { + "day": "numeric", + "month": "numeric", + "year": "2-digit", + }, + }, + "number": Object { + "currency": Object { + "style": "currency", + }, + "percent": Object { + "style": "percent", + }, + }, + "time": Object { + "full": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "long": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "medium": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + }, + "short": Object { + "hour": "numeric", + "minute": "numeric", + }, + }, + }, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": Symbol(react.fragment), + "timeZone": null, + } + } isCollectionIntervalUpdated={false} isCollectionIntervalUpdating={true} property="xpack.monitoring.collection.interval" @@ -81,7 +257,13 @@ exports[`ExplainCollectionInterval collection interval setting updates should sh

- Monitoring is currently off + + Monitoring is currently off +

- Monitoring provides insight to your hardware performance and load. + + Monitoring provides insight to your hardware performance and load. +

@@ -122,55 +310,81 @@ exports[`ExplainCollectionInterval collection interval setting updates should sh className="euiText euiText--medium" >

- We checked the - cluster - settings and found that - - - - - xpack.monitoring.collection.interval - - - - - is set to - - - - + -1 - - - - - . + , + "property": + xpack.monitoring.collection.interval + , + } + } + > + We checked the cluster settings and found that + + + + + xpack.monitoring.collection.interval + + + + + is set to + + + + + -1 + + + + + . +

- The collection interval setting needs to be a positive integer (10s is recommended) in order for the collection agents to be active. + + The collection interval setting needs to be a positive integer (10s is recommended) in order for the collection agents to be active. +

- Would you like us to change it and enable monitoring? + + Would you like us to change it and enable monitoring? +

@@ -230,7 +444,13 @@ exports[`ExplainCollectionInterval collection interval setting updates should sh - Turn on monitoring + + Turn on monitoring + @@ -251,6 +471,88 @@ exports[`ExplainCollectionInterval should explain about xpack.monitoring.collect "enableCollectionInterval": [Function], } } + intl={ + Object { + "defaultFormats": Object { + "date": Object { + "full": Object { + "day": "numeric", + "month": "long", + "weekday": "long", + "year": "numeric", + }, + "long": Object { + "day": "numeric", + "month": "long", + "year": "numeric", + }, + "medium": Object { + "day": "numeric", + "month": "short", + "year": "numeric", + }, + "short": Object { + "day": "numeric", + "month": "numeric", + "year": "2-digit", + }, + }, + "number": Object { + "currency": Object { + "style": "currency", + }, + "percent": Object { + "style": "percent", + }, + }, + "time": Object { + "full": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "long": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "medium": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + }, + "short": Object { + "hour": "numeric", + "minute": "numeric", + }, + }, + }, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object {}, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": Symbol(react.fragment), + "timeZone": null, + } + } isCollectionIntervalUpdated={false} isCollectionIntervalUpdating={false} property="xpack.monitoring.collection.interval" @@ -263,7 +565,13 @@ exports[`ExplainCollectionInterval should explain about xpack.monitoring.collect

- Monitoring is currently off + + Monitoring is currently off +

- Monitoring provides insight to your hardware performance and load. + + Monitoring provides insight to your hardware performance and load. +

@@ -304,55 +618,81 @@ exports[`ExplainCollectionInterval should explain about xpack.monitoring.collect className="euiText euiText--medium" >

- We checked the - cluster - settings and found that - - - - - xpack.monitoring.collection.interval - - - - - is set to - - - - + -1 - - - - - . + , + "property": + xpack.monitoring.collection.interval + , + } + } + > + We checked the cluster settings and found that + + + + + xpack.monitoring.collection.interval + + + + + is set to + + + + + -1 + + + + + . +

- The collection interval setting needs to be a positive integer (10s is recommended) in order for the collection agents to be active. + + The collection interval setting needs to be a positive integer (10s is recommended) in order for the collection agents to be active. +

- Would you like us to change it and enable monitoring? + + Would you like us to change it and enable monitoring? +

@@ -403,7 +743,13 @@ exports[`ExplainCollectionInterval should explain about xpack.monitoring.collect - Turn on monitoring + + Turn on monitoring + diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/collection_interval.test.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/collection_interval.test.js index 855a3433f332..cdb8f3e08c65 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/collection_interval.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/__tests__/collection_interval.test.js @@ -6,7 +6,7 @@ import React from 'react'; import sinon from 'sinon'; -import { mount } from 'enzyme'; +import { mountWithIntl } from '../../../../../../../../test_utils/enzyme_helpers'; import { ExplainCollectionInterval } from '../collection_interval'; import { findTestSubject } from '@elastic/eui/lib/test'; @@ -28,7 +28,7 @@ describe('ExplainCollectionInterval', () => { enabler={enabler} /> ); - const rendered = mount(component); + const rendered = mountWithIntl(component); expect(rendered).toMatchSnapshot(); }); @@ -43,7 +43,7 @@ describe('ExplainCollectionInterval', () => { enabler={enabler} /> ); - const rendered = mount(component); + const rendered = mountWithIntl(component); const actionButton = findTestSubject(rendered, 'enableCollectionInterval'); actionButton.simulate('click'); expect(enabler.enableCollectionInterval.calledOnce).toBe(true); @@ -61,7 +61,7 @@ describe('ExplainCollectionInterval', () => { enabler={enabler} /> ); - const rendered = mount(component); + const rendered = mountWithIntl(component); expect(rendered).toMatchSnapshot(); }); @@ -76,7 +76,7 @@ describe('ExplainCollectionInterval', () => { enabler={enabler} /> ); - const rendered = mount(component); + const rendered = mountWithIntl(component); expect(rendered).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.js index 65a636e24990..2700223e7930 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.js @@ -18,6 +18,7 @@ import { EuiTitle } from '@elastic/eui'; import { WhatIs } from '../../blurbs'; +import { FormattedMessage } from '@kbn/i18n/react'; export class ExplainCollectionInterval extends React.Component { constructor(props) { @@ -45,15 +46,29 @@ export class ExplainCollectionInterval extends React.Component {

- We checked the {context} settings and found that {property} - is set to {data}. + {property}), + data: ({data}) + }} + />

- The collection interval setting needs to be a positive integer - (10s is recommended) in order for the collection agents to be active. +

- Would you like us to change it and enable monitoring? +

@@ -70,7 +85,10 @@ export class ExplainCollectionInterval extends React.Component { data-test-subj="enableCollectionInterval" isLoading={isCollectionIntervalUpdating} > - Turn on monitoring + @@ -79,14 +97,22 @@ export class ExplainCollectionInterval extends React.Component { const renderSuccess = () => ( -

Success! Wait a moment please.

+

+ +

- As soon as monitoring data appears in your - cluster the page will automatically refresh with your monitoring - dashboard. This only takes only a few seconds. +

diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/__tests__/exporters.test.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/__tests__/exporters.test.js index 6076ce7b22ce..16f1d8c798d0 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/__tests__/exporters.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/__tests__/exporters.test.js @@ -5,12 +5,12 @@ */ import React from 'react'; -import { render } from 'enzyme'; +import { renderWithIntl } from '../../../../../../../../test_utils/enzyme_helpers'; import { ExplainExporters } from '../exporters'; describe('ExplainExporters', () => { test('should explain about xpack.monitoring.exporters setting', () => { - const component = render( + const component = renderWithIntl(

- We checked the {context} settings for{' '} - {property}, and found the reason:{' '} - {data}. + {context}), + property: ({property}), + data: ({data}) + }} + />

- Using monitoring exporters ship the monitoring data to a remote - monitoring cluster is highly recommended as it keeps the integrity of - the monitoring data safe no matter what the state of the production - cluster. However, as this instance of Kibana could not find any - monitoring data, there seems to be a problem with the{' '} - {property} configuration, or the{' '} - xpack.monitoring.elasticsearch settings in{' '} - kibana.yml. + {property}), + monitoringEs: (xpack.monitoring.elasticsearch), + kibanaConfig: (kibana.yml) + }} + />

- Check that the intended exporters are enabled for sending statistics to - the monitoring cluster, and that the monitoring cluster host matches the{' '} - xpack.monitoring.elasticsearch setting in{' '} - kibana.yml to see monitoring data in this instance of - Kibana. + xpack.monitoring.elasticsearch), + kibanaConfig: (kibana.yml) + }} + />

diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/__tests__/plugin_enabled.test.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/__tests__/plugin_enabled.test.js index 747fe2fbcad6..749543765c64 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/__tests__/plugin_enabled.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/__tests__/plugin_enabled.test.js @@ -5,12 +5,12 @@ */ import React from 'react'; -import { render } from 'enzyme'; +import { renderWithIntl } from '../../../../../../../../test_utils/enzyme_helpers'; import { ExplainPluginEnabled } from '../plugin_enabled'; describe('ExplainPluginEnabled', () => { test('should explain about xpack.monitoring.enabled setting', () => { - const component = render( + const component = renderWithIntl(

- We checked the {context} settings and found that {property}{' '} - is set to {data} set, which disables monitoring. - Removing the xpack.monitoring.enabled: false setting - from your configuration will put the default into effect and enable Monitoring. + {property}), + data: ({data}), + monitoringEnableFalse: (xpack.monitoring.enabled: false) + }} + />

diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/__snapshots__/reason_found.test.js.snap b/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/__snapshots__/reason_found.test.js.snap index c97e2b65a968..b84647375507 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/__snapshots__/reason_found.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/__snapshots__/reason_found.test.js.snap @@ -35,7 +35,7 @@ Array [ xpack.monitoring.collection.interval - is set to + is set to diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/reason_found.test.js b/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/reason_found.test.js index 560fc18c6062..68ee6ac7598a 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/reason_found.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/__tests__/reason_found.test.js @@ -5,14 +5,14 @@ */ import React from 'react'; -import { render } from 'enzyme'; +import { renderWithIntl } from '../../../../../../../test_utils/enzyme_helpers'; import { ReasonFound } from '../'; const enabler = {}; describe('ReasonFound', () => { test('should load ExplainCollectionInterval component', () => { - const component = render( + const component = renderWithIntl( { }); test('should load ExplainExporters component', () => { - const component = render( + const component = renderWithIntl( { }); test('should load ExplainPluginEnabled component', () => { - const component = render( + const component = renderWithIntl( { test('should render "we tried" message', () => { - const component = render(); + const component = renderWithIntl(); expect(component).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.js b/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.js index 44156e4b9a6d..fe28bbe30a9d 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.js +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.js @@ -16,6 +16,7 @@ import { ExplainExporters, ExplainPluginEnabled } from '../explanations'; +import { FormattedMessage } from '@kbn/i18n/react'; const ExplainWhyNoData = ({ reason, ...props }) => { const { property, data, context } = reason; @@ -32,8 +33,15 @@ const ExplainWhyNoData = ({ reason, ...props }) => { return (

- There is a {context} setting that has{' '} - {property} set to {data}. + {context}), + property: ({property}), + data: ({data}) + }} + />

); diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.js b/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.js index fd226cd280fc..642c32e1e7dc 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.js +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.js @@ -10,21 +10,33 @@ import { EuiHorizontalRule, EuiTitle, } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; export function WeTried() { return ( -

We couldn't activate monitoring

+

+ +

- No monitoring data found. Try setting the time filter to "Last 1 - hour" or check if data is available for a different time period. +

- If data is in your cluster, your monitoring dashboards will show up here. +

diff --git a/x-pack/plugins/monitoring/public/components/page_loading/__tests__/__snapshots__/page_loading.test.js.snap b/x-pack/plugins/monitoring/public/components/page_loading/__tests__/__snapshots__/page_loading.test.js.snap index d26d822f2334..5fbf0ea2d000 100644 --- a/x-pack/plugins/monitoring/public/components/page_loading/__tests__/__snapshots__/page_loading.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/page_loading/__tests__/__snapshots__/page_loading.test.js.snap @@ -29,7 +29,7 @@ exports[`PageLoading should show a simple page loading component 1`] = `
- Loading... + Loading…
diff --git a/x-pack/plugins/monitoring/public/components/page_loading/__tests__/page_loading.test.js b/x-pack/plugins/monitoring/public/components/page_loading/__tests__/page_loading.test.js index 0ce30e666397..f2e698cb5521 100644 --- a/x-pack/plugins/monitoring/public/components/page_loading/__tests__/page_loading.test.js +++ b/x-pack/plugins/monitoring/public/components/page_loading/__tests__/page_loading.test.js @@ -5,12 +5,12 @@ */ import React from 'react'; -import { render } from 'enzyme'; +import { renderWithIntl } from '../../../../../../test_utils/enzyme_helpers'; import { PageLoading } from '../'; describe('PageLoading', () => { test('should show a simple page loading component', () => { - expect(render()).toMatchSnapshot(); + expect(renderWithIntl()).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/monitoring/public/components/page_loading/index.js b/x-pack/plugins/monitoring/public/components/page_loading/index.js index a36ae3f61f36..744318d73ba2 100644 --- a/x-pack/plugins/monitoring/public/components/page_loading/index.js +++ b/x-pack/plugins/monitoring/public/components/page_loading/index.js @@ -13,6 +13,7 @@ import { EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; export function PageLoading() { return ( @@ -29,7 +30,12 @@ export function PageLoading() { - Loading... + + + diff --git a/x-pack/plugins/monitoring/public/views/base_controller.js b/x-pack/plugins/monitoring/public/views/base_controller.js index 9ebb46852602..635fb328b2b2 100644 --- a/x-pack/plugins/monitoring/public/views/base_controller.js +++ b/x-pack/plugins/monitoring/public/views/base_controller.js @@ -10,6 +10,7 @@ import { render, unmountComponentAtNode } from 'react-dom'; import { getPageData } from '../lib/get_page_data'; import { PageLoading } from 'plugins/monitoring/components'; import { timefilter } from 'ui/timefilter'; +import { I18nProvider } from '@kbn/i18n/react'; /** * Class to manage common instantiation behaviors in a view controller @@ -129,7 +130,7 @@ export class MonitoringViewBaseController { renderReact(component) { if (this._isDataInitialized === false) { - render(, document.getElementById(this.reactNodeId)); + render(, document.getElementById(this.reactNodeId)); } else { render(component, document.getElementById(this.reactNodeId)); } diff --git a/x-pack/plugins/monitoring/public/views/license/controller.js b/x-pack/plugins/monitoring/public/views/license/controller.js index e69c2df648bd..21440ff0b8a1 100644 --- a/x-pack/plugins/monitoring/public/views/license/controller.js +++ b/x-pack/plugins/monitoring/public/views/license/controller.js @@ -12,11 +12,12 @@ import { formatDateTimeLocal } from '../../../common/formatting'; import { MANAGEMENT_BASE_PATH } from 'plugins/xpack_main/components'; import { License } from 'plugins/monitoring/components'; import { timefilter } from 'ui/timefilter'; +import { I18nProvider } from '@kbn/i18n/react'; const REACT_NODE_ID = 'licenseReact'; export class LicenseViewController { - constructor($injector, $scope) { + constructor($injector, $scope, i18n) { timefilter.disableTimeRangeSelector(); timefilter.disableAutoRefreshSelector(); @@ -24,17 +25,20 @@ export class LicenseViewController { unmountComponentAtNode(document.getElementById(REACT_NODE_ID)); }); - this.init($injector, $scope); + this.init($injector, $scope, i18n); } - init($injector, $scope) { + init($injector, $scope, i18n) { const globalState = $injector.get('globalState'); const title = $injector.get('title'); const $route = $injector.get('$route'); const cluster = find($route.current.locals.clusters, { cluster_uuid: globalState.cluster_uuid }); $scope.cluster = cluster; - title($scope.cluster, 'License'); + const routeTitle = i18n('xpack.monitoring.license.licenseRouteTitle', { + defaultMessage: 'License' + }); + title($scope.cluster, routeTitle); this.license = cluster.license; this.isExpired = Date.now() > get(cluster, 'license.expiry_date_in_millis'); @@ -56,14 +60,16 @@ export class LicenseViewController { // Mount the React component to the template render( - , + + + , document.getElementById(REACT_NODE_ID) ); }); diff --git a/x-pack/plugins/monitoring/public/views/no_data/controller.js b/x-pack/plugins/monitoring/public/views/no_data/controller.js index 0d0163eeb789..2f5c4f2cf12d 100644 --- a/x-pack/plugins/monitoring/public/views/no_data/controller.js +++ b/x-pack/plugins/monitoring/public/views/no_data/controller.js @@ -15,6 +15,7 @@ import { ModelUpdater } from './model_updater'; import { render, unmountComponentAtNode } from 'react-dom'; import { NoData } from 'plugins/monitoring/components'; import { timefilter } from 'ui/timefilter'; +import { I18nProvider } from '@kbn/i18n/react'; const REACT_NODE_ID_NO_DATA = 'noDataReact'; @@ -69,7 +70,9 @@ export class NoDataController { () => model, props => { render( - , + + + , document.getElementById(REACT_NODE_ID_NO_DATA) ); },