+
+
+
+
+
`;
diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx
index 399f5257063a..dd357d70f8a0 100644
--- a/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx
+++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/new_vis_modal.test.tsx
@@ -17,7 +17,6 @@
* under the License.
*/
-import { I18nProvider } from '@kbn/i18n/react';
import React from 'react';
import { mountWithIntl } from 'test_utils/enzyme_helpers';
@@ -57,18 +56,14 @@ describe('NewVisModal', () => {
it('should render as expected', () => {
const wrapper = mountWithIntl(
-
- null} visTypesRegistry={visTypes} />
-
+ null} visTypesRegistry={visTypes} />
);
expect(wrapper).toMatchSnapshot();
});
it('should show a button for regular visualizations', () => {
const wrapper = mountWithIntl(
-
- null} visTypesRegistry={visTypes} />
-
+ null} visTypesRegistry={visTypes} />
);
expect(wrapper.find('[data-test-subj="visType-vis"]').exists()).toBe(true);
});
@@ -77,9 +72,7 @@ describe('NewVisModal', () => {
it('should open the editor for visualizations without search', () => {
window.location.assign = jest.fn();
const wrapper = mountWithIntl(
-
- null} visTypesRegistry={visTypes} />
-
+ null} visTypesRegistry={visTypes} />
);
const visButton = wrapper.find('button[data-test-subj="visType-vis"]');
visButton.simulate('click');
@@ -89,14 +82,12 @@ describe('NewVisModal', () => {
it('passes through editor params to the editor URL', () => {
window.location.assign = jest.fn();
const wrapper = mountWithIntl(
-
- null}
- visTypesRegistry={visTypes}
- editorParams={['foo=true', 'bar=42']}
- />
-
+ null}
+ visTypesRegistry={visTypes}
+ editorParams={['foo=true', 'bar=42']}
+ />
);
const visButton = wrapper.find('button[data-test-subj="visType-vis"]');
visButton.simulate('click');
@@ -107,9 +98,7 @@ describe('NewVisModal', () => {
describe('filter for visualization types', () => {
it('should render as expected', () => {
const wrapper = mountWithIntl(
-
- null} visTypesRegistry={visTypes} />
-
+ null} visTypesRegistry={visTypes} />
);
const searchBox = wrapper.find('input[data-test-subj="filterVisType"]');
searchBox.simulate('change', { target: { value: 'with' } });
@@ -121,9 +110,7 @@ describe('NewVisModal', () => {
it('should not show experimental visualizations if visualize:enableLabs is false', () => {
settingsGet.mockReturnValue(false);
const wrapper = mountWithIntl(
-
- null} visTypesRegistry={visTypes} />
-
+ null} visTypesRegistry={visTypes} />
);
expect(wrapper.find('[data-test-subj="visType-visExp"]').exists()).toBe(false);
});
@@ -131,9 +118,7 @@ describe('NewVisModal', () => {
it('should show experimental visualizations if visualize:enableLabs is true', () => {
settingsGet.mockReturnValue(true);
const wrapper = mountWithIntl(
-
- null} visTypesRegistry={visTypes} />
-
+ null} visTypesRegistry={visTypes} />
);
expect(wrapper.find('[data-test-subj="visType-visExp"]').exists()).toBe(true);
});
diff --git a/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx b/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx
index fe4d28900c11..3b67330a9c96 100644
--- a/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx
+++ b/src/legacy/core_plugins/kibana/public/visualize/wizard/show_new_vis.tsx
@@ -20,7 +20,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { VisType } from 'ui/vis';
import { NewVisModal } from './new_vis_modal';
@@ -40,14 +40,14 @@ export function showNewVisModal(
document.body.appendChild(container);
const element = (
-
+
-
+
);
ReactDOM.render(element, container);
}
diff --git a/src/legacy/core_plugins/metrics/public/components/vis_editor.js b/src/legacy/core_plugins/metrics/public/components/vis_editor.js
index 65981130921e..667dff481f9d 100644
--- a/src/legacy/core_plugins/metrics/public/components/vis_editor.js
+++ b/src/legacy/core_plugins/metrics/public/components/vis_editor.js
@@ -29,7 +29,6 @@ import brushHandler from '../lib/create_brush_handler';
import { extractIndexPatterns } from '../lib/extract_index_patterns';
import { fetchFields } from '../lib/fetch_fields';
import chrome from 'ui/chrome';
-import { I18nProvider } from '@kbn/i18n/react';
const IS_DARK_THEME = chrome.getUiSettingsClient().get('theme:darkMode');
@@ -116,19 +115,17 @@ class VisEditor extends Component {
return null;
}
return (
-
-
-
+
);
}
diff --git a/src/legacy/core_plugins/metrics/public/kbn_vis_types/editor_controller.js b/src/legacy/core_plugins/metrics/public/kbn_vis_types/editor_controller.js
index af40856fb20d..cccc898dd661 100644
--- a/src/legacy/core_plugins/metrics/public/kbn_vis_types/editor_controller.js
+++ b/src/legacy/core_plugins/metrics/public/kbn_vis_types/editor_controller.js
@@ -19,7 +19,7 @@
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
function ReactEditorControllerProvider(Private, config) {
class ReactEditorController {
@@ -32,7 +32,7 @@ function ReactEditorControllerProvider(Private, config) {
async render(params) {
const Component = this.vis.type.editorConfig.component;
render(
-
+
- ,
+ ,
this.el);
}
diff --git a/src/legacy/core_plugins/status_page/public/components/render.js b/src/legacy/core_plugins/status_page/public/components/render.js
index d5077af08e6c..427a76c40fbf 100644
--- a/src/legacy/core_plugins/status_page/public/components/render.js
+++ b/src/legacy/core_plugins/status_page/public/components/render.js
@@ -19,7 +19,7 @@
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import StatusApp from './status_app';
@@ -33,12 +33,12 @@ export function renderStatusPage(buildNum, buildSha) {
}
render(
-
+
- ,
+ ,
node,
);
}
diff --git a/src/legacy/core_plugins/tagcloud/public/tag_cloud_visualization.js b/src/legacy/core_plugins/tagcloud/public/tag_cloud_visualization.js
index 1eaab048a12f..78307cd75ad7 100644
--- a/src/legacy/core_plugins/tagcloud/public/tag_cloud_visualization.js
+++ b/src/legacy/core_plugins/tagcloud/public/tag_cloud_visualization.js
@@ -24,7 +24,7 @@ import { render, unmountComponentAtNode } from 'react-dom';
import React from 'react';
import { getFormat } from 'ui/visualize/loader/pipeline_helpers/utilities';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { Label } from './label';
import { FeedbackMessage } from './feedback_message';
@@ -57,7 +57,7 @@ export class TagCloudVisualization {
this._feedbackNode = document.createElement('div');
this._containerNode.appendChild(this._feedbackNode);
this._feedbackMessage = React.createRef();
- render(, this._feedbackNode);
+ render(, this._feedbackNode);
this._labelNode = document.createElement('div');
this._containerNode.appendChild(this._labelNode);
diff --git a/src/ui/public/chrome/directives/header_global_nav/header_global_nav.js b/src/ui/public/chrome/directives/header_global_nav/header_global_nav.js
index 3603c724549b..66b34b38df6c 100644
--- a/src/ui/public/chrome/directives/header_global_nav/header_global_nav.js
+++ b/src/ui/public/chrome/directives/header_global_nav/header_global_nav.js
@@ -20,8 +20,8 @@
import { uiModules } from '../../../modules';
import { Header } from './components/header';
+import { wrapInI18nContext } from 'ui/i18n';
import { chromeHeaderNavControlsRegistry } from 'ui/registry/chrome_header_nav_controls';
-import { injectI18nProvider } from '@kbn/i18n/react';
const module = uiModules.get('kibana');
@@ -30,7 +30,7 @@ module.directive('headerGlobalNav', (reactDirective, chrome, Private) => {
const navControls = Private(chromeHeaderNavControlsRegistry);
const homeHref = chrome.addBasePath('/app/kibana#/home');
- return reactDirective(injectI18nProvider(Header), [
+ return reactDirective(wrapInI18nContext(Header), [
// scope accepted by directive, passed in as React props
'appTitle',
'isVisible',
diff --git a/src/ui/public/chrome/directives/kbn_chrome.js b/src/ui/public/chrome/directives/kbn_chrome.js
index bbd0e4189f45..96c829cdba2e 100644
--- a/src/ui/public/chrome/directives/kbn_chrome.js
+++ b/src/ui/public/chrome/directives/kbn_chrome.js
@@ -32,7 +32,7 @@ import {
banners,
} from '../../notify';
import { SubUrlRouteFilterProvider } from './sub_url_route_filter';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from '../../i18n';
export function kbnChromeProvider(chrome, internals) {
@@ -86,12 +86,12 @@ export function kbnChromeProvider(chrome, internals) {
// Banners
ReactDOM.render(
-
+
- ,
+ ,
document.getElementById('globalBannerList')
);
diff --git a/src/ui/public/filter_bar/directive.js b/src/ui/public/filter_bar/directive.js
index afb598de5a7b..1178e69df2c3 100644
--- a/src/ui/public/filter_bar/directive.js
+++ b/src/ui/public/filter_bar/directive.js
@@ -18,12 +18,12 @@
*/
import 'ngreact';
+import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from '../modules';
import { FilterBar } from './filter_bar';
-import { injectI18nProvider } from '@kbn/i18n/react';
const app = uiModules.get('app/kibana', ['react']);
app.directive('filterBar', reactDirective => {
- return reactDirective(injectI18nProvider(FilterBar));
+ return reactDirective(wrapInI18nContext(FilterBar));
});
diff --git a/src/ui/public/i18n/__snapshots__/index.test.tsx.snap b/src/ui/public/i18n/__snapshots__/index.test.tsx.snap
new file mode 100644
index 000000000000..fd6a0a07ba39
--- /dev/null
+++ b/src/ui/public/i18n/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,10 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ui/i18n renders children and forwards properties 1`] = `
+
+ Context:
+
+ Child: some prop:100500
+
+
+`;
diff --git a/src/ui/public/i18n/index.test.tsx b/src/ui/public/i18n/index.test.tsx
new file mode 100644
index 000000000000..198940bc55a9
--- /dev/null
+++ b/src/ui/public/i18n/index.test.tsx
@@ -0,0 +1,54 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { render } from 'enzyme';
+import PropTypes from 'prop-types';
+import React from 'react';
+
+import { __newPlatformInit__, wrapInI18nContext } from '.';
+
+describe('ui/i18n', () => {
+ test('renders children and forwards properties', () => {
+ __newPlatformInit__(({ children }) =>
Context: {children}
);
+
+ const mockPropTypes = {
+ stringProp: PropTypes.string.isRequired,
+ numberProp: PropTypes.number,
+ };
+
+ const WrappedComponent = wrapInI18nContext(
+ class extends React.PureComponent<{ [P in keyof typeof mockPropTypes]: unknown }> {
+ public static propTypes = mockPropTypes;
+
+ public render() {
+ return (
+
+ Child: {this.props.stringProp}:{this.props.numberProp}
+
+ );
+ }
+ }
+ );
+
+ expect(WrappedComponent.propTypes).toBe(mockPropTypes);
+ expect(
+ render()
+ ).toMatchSnapshot();
+ });
+});
diff --git a/src/ui/public/i18n/index.tsx b/src/ui/public/i18n/index.tsx
new file mode 100644
index 000000000000..adbc281913e5
--- /dev/null
+++ b/src/ui/public/i18n/index.tsx
@@ -0,0 +1,57 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React from 'react';
+
+import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
+// @ts-ignore
+import { uiModules } from 'ui/modules';
+import { I18nStartContract } from '../../../core/public/i18n';
+
+export let I18nContext: I18nStartContract['Context'] = null!;
+export function __newPlatformInit__(context: typeof I18nContext) {
+ if (I18nContext) {
+ throw new Error('ui/i18n already initialized with new platform apis');
+ }
+
+ I18nContext = context;
+}
+
+export function wrapInI18nContext
(ComponentToWrap: React.ComponentType
) {
+ const ContextWrapper: React.SFC
= props => {
+ return (
+
+
+
+ );
+ };
+
+ // Original propTypes from the wrapped component should be re-exposed
+ // since it will be used by reactDirective Angular service
+ // that will rely on propTypes to watch attributes with these names
+ ContextWrapper.propTypes = ComponentToWrap.propTypes;
+
+ return ContextWrapper;
+}
+
+uiModules
+ .get('i18n')
+ .provider('i18n', I18nProvider)
+ .filter('i18n', i18nFilter)
+ .directive('i18nId', i18nDirective);
diff --git a/src/ui/public/inspector/inspector.tsx b/src/ui/public/inspector/inspector.tsx
index f97382451b89..c0bae0a050f4 100644
--- a/src/ui/public/inspector/inspector.tsx
+++ b/src/ui/public/inspector/inspector.tsx
@@ -19,7 +19,6 @@
import React from 'react';
import { i18n } from '@kbn/i18n';
-import { I18nProvider } from '@kbn/i18n/react';
import { FlyoutSession, openFlyout } from 'ui/flyout';
import { Adapters } from './types';
import { InspectorPanel } from './ui/inspector_panel';
@@ -73,15 +72,10 @@ function open(adapters: Adapters, options: InspectorOptions = {}): InspectorSess
if an inspector can be shown.`);
}
- return openFlyout(
-
-
- ,
- {
- 'data-test-subj': 'inspectorPanel',
- closeButtonAriaLabel: closeButtonLabel,
- }
- );
+ return openFlyout(, {
+ 'data-test-subj': 'inspectorPanel',
+ closeButtonAriaLabel: closeButtonLabel,
+ });
}
const Inspector = {
diff --git a/src/ui/public/query_bar/directive/index.js b/src/ui/public/query_bar/directive/index.js
index 347f3aeb12c0..9c42e59ec8e0 100644
--- a/src/ui/public/query_bar/directive/index.js
+++ b/src/ui/public/query_bar/directive/index.js
@@ -20,15 +20,15 @@
import 'ngreact';
+import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from '../../modules';
import { QueryBar } from '../components';
-import { injectI18nProvider } from '@kbn/i18n/react';
const app = uiModules.get('app/kibana', ['react']);
app.directive('queryBar', (reactDirective, localStorage) => {
return reactDirective(
- injectI18nProvider(QueryBar),
+ wrapInI18nContext(QueryBar),
undefined,
{},
{
diff --git a/src/ui/public/saved_objects/show_saved_object_save_modal.js b/src/ui/public/saved_objects/show_saved_object_save_modal.js
index 5cb1681c0828..bd2fbba3aa14 100644
--- a/src/ui/public/saved_objects/show_saved_object_save_modal.js
+++ b/src/ui/public/saved_objects/show_saved_object_save_modal.js
@@ -19,7 +19,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
export function showSaveModal(saveModal) {
const container = document.createElement('div');
@@ -46,5 +46,5 @@ export function showSaveModal(saveModal) {
}
);
- ReactDOM.render({element}, container);
+ ReactDOM.render({element}, container);
}
diff --git a/src/ui/public/search_bar/directive/index.js b/src/ui/public/search_bar/directive/index.js
index f03624dd189a..7c162c133410 100644
--- a/src/ui/public/search_bar/directive/index.js
+++ b/src/ui/public/search_bar/directive/index.js
@@ -18,15 +18,15 @@
*/
import 'ngreact';
+import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from '../../modules';
import { SearchBar } from '../components';
-import { injectI18nProvider } from '@kbn/i18n/react';
const app = uiModules.get('app/kibana', ['react']);
app.directive('searchBar', (reactDirective, localStorage) => {
return reactDirective(
- injectI18nProvider(SearchBar),
+ wrapInI18nContext(SearchBar),
undefined,
{},
{
diff --git a/src/ui/public/share/show_share_context_menu.tsx b/src/ui/public/share/show_share_context_menu.tsx
index de2eba3e362e..7b39c2e1d444 100644
--- a/src/ui/public/share/show_share_context_menu.tsx
+++ b/src/ui/public/share/show_share_context_menu.tsx
@@ -25,7 +25,7 @@ import { ShareActionProvider } from './share_action';
import { EuiWrappingPopover } from '@elastic/eui';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
let isOpen = false;
@@ -66,7 +66,7 @@ export function showShareContextMenu({
document.body.appendChild(container);
const element = (
-
+
-
+
);
ReactDOM.render(element, container);
}
diff --git a/src/ui/public/vis/editors/default/vis_options.js b/src/ui/public/vis/editors/default/vis_options.js
index cb1e3131cce0..7a1b64ec18ca 100644
--- a/src/ui/public/vis/editors/default/vis_options.js
+++ b/src/ui/public/vis/editors/default/vis_options.js
@@ -22,7 +22,7 @@ import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { uiModules } from '../../../modules';
import visOptionsTemplate from './vis_options.html';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
/**
* This directive sort of "transcludes" in whatever template you pass in via the `editor` attribute.
@@ -55,9 +55,9 @@ uiModules
const renderReactComponent = () => {
const Component = $scope.editor;
render(
-
+
- , $el[0]);
+ , $el[0]);
};
// Bind the `editor` template with the scope.
if (reactOptionsComponent) {
diff --git a/src/ui/public/vis/vis_types/react_vis_type.js b/src/ui/public/vis/vis_types/react_vis_type.js
index 6d3f391c3b9f..f9784f6a8b1b 100644
--- a/src/ui/public/vis/vis_types/react_vis_type.js
+++ b/src/ui/public/vis/vis_types/react_vis_type.js
@@ -20,6 +20,7 @@
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import chrome from '../../chrome';
+import { I18nContext } from '../../i18n';
import { BaseVisTypeProvider } from './base_vis_type';
export function ReactVisTypeProvider(Private) {
@@ -37,13 +38,16 @@ export function ReactVisTypeProvider(Private) {
return new Promise((resolve) => {
const Component = this.vis.type.visConfig.component;
const config = chrome.getUiSettingsClient();
- render(, this.el);
+ render(
+
+
+ , this.el);
});
}
diff --git a/x-pack/plugins/apm/public/index.js b/x-pack/plugins/apm/public/index.js
index 74b246fab948..99caa514bade 100644
--- a/x-pack/plugins/apm/public/index.js
+++ b/x-pack/plugins/apm/public/index.js
@@ -26,14 +26,14 @@ import LicenseChecker from './components/app/Main/LicenseChecker';
import { history } from './components/shared/Links/url_helpers';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
chrome.setRootTemplate(template);
const store = configureStore();
initTimepicker(history, store.dispatch).then(() => {
ReactDOM.render(
-
+
@@ -43,7 +43,7 @@ initTimepicker(history, store.dispatch).then(() => {
- ,
+ ,
document.getElementById('react-apm-root')
);
});
diff --git a/x-pack/plugins/beats_management/public/index.tsx b/x-pack/plugins/beats_management/public/index.tsx
index 535d984c103a..3bbd1d496e2b 100644
--- a/x-pack/plugins/beats_management/public/index.tsx
+++ b/x-pack/plugins/beats_management/public/index.tsx
@@ -6,10 +6,10 @@
import * as euiVars from '@elastic/eui/dist/eui_theme_k6_light.json';
import { i18n } from '@kbn/i18n';
-import { I18nProvider } from '@kbn/i18n/react';
import React from 'react';
import { HashRouter } from 'react-router-dom';
import { ThemeProvider } from 'styled-components';
+import { I18nContext } from 'ui/i18n';
import { Provider as UnstatedProvider, Subscribe } from 'unstated';
import { BASE_PATH } from '../common/constants';
import { Background } from './components/layouts/background';
@@ -25,7 +25,7 @@ async function startApp(libs: FrontendLibs) {
libs.framework.renderUIAtPath(
BASE_PATH,
-
+
@@ -44,7 +44,7 @@ async function startApp(libs: FrontendLibs) {
-
+
,
libs.framework.versionGreaterThen('6.7.0') ? 'management' : 'self'
);
diff --git a/x-pack/plugins/cross_cluster_replication/public/app/index.js b/x-pack/plugins/cross_cluster_replication/public/app/index.js
index 1400dcdb19e1..2755ebf07dca 100644
--- a/x-pack/plugins/cross_cluster_replication/public/app/index.js
+++ b/x-pack/plugins/cross_cluster_replication/public/app/index.js
@@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
@@ -14,13 +14,13 @@ import { ccrStore } from './store';
export const renderReact = async (elem) => {
render(
-
+
- ,
+ ,
elem
);
};
diff --git a/x-pack/plugins/grokdebugger/public/sections/grokdebugger/directives/grokdebugger/grokdebugger.js b/x-pack/plugins/grokdebugger/public/sections/grokdebugger/directives/grokdebugger/grokdebugger.js
index 33e5c561d63a..a07ba56057b4 100644
--- a/x-pack/plugins/grokdebugger/public/sections/grokdebugger/directives/grokdebugger/grokdebugger.js
+++ b/x-pack/plugins/grokdebugger/public/sections/grokdebugger/directives/grokdebugger/grokdebugger.js
@@ -9,7 +9,7 @@ import 'plugins/grokdebugger/services/grokdebugger';
import { GrokDebugger } from '../../components/grok_debugger';
import { render } from 'react-dom';
import React from 'react';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const app = uiModules.get('xpack/grokdebugger');
@@ -19,7 +19,7 @@ app.directive('grokdebugger', function ($injector) {
return {
restrict: 'E',
link: (scope, el) => {
- render(, el[0]);
+ render(, el[0]);
}
};
});
diff --git a/x-pack/plugins/index_lifecycle_management/public/register_routes.js b/x-pack/plugins/index_lifecycle_management/public/register_routes.js
index 643ac68af613..41072e4c6e69 100644
--- a/x-pack/plugins/index_lifecycle_management/public/register_routes.js
+++ b/x-pack/plugins/index_lifecycle_management/public/register_routes.js
@@ -12,7 +12,7 @@ import chrome from 'ui/chrome';
import { App } from './app';
import { BASE_PATH } from '../common/constants';
import { indexLifecycleManagementStore } from './store';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { setUrlService } from './services/navigation';
import routes from 'ui/routes';
@@ -22,11 +22,11 @@ import { manageAngularLifecycle } from './services/manage_angular_lifecycle';
let elem;
const renderReact = async (elem) => {
render(
-
+
- ,
+ ,
elem
);
};
diff --git a/x-pack/plugins/index_management/public/register_routes.js b/x-pack/plugins/index_management/public/register_routes.js
index 2936664a1285..a926d64d3274 100644
--- a/x-pack/plugins/index_management/public/register_routes.js
+++ b/x-pack/plugins/index_management/public/register_routes.js
@@ -9,7 +9,6 @@ import { render, unmountComponentAtNode } from 'react-dom';
import { Provider } from 'react-redux';
import { HashRouter } from 'react-router-dom';
import { i18n } from '@kbn/i18n';
-import { I18nProvider } from '@kbn/i18n/react';
import { setHttpClient } from './services/api';
import { setUrlService } from './services/navigation';
@@ -17,6 +16,7 @@ import { App } from './app';
import { BASE_PATH } from '../common/constants/base_path';
import routes from 'ui/routes';
+import { I18nContext } from 'ui/i18n';
import { MANAGEMENT_BREADCRUMB } from 'ui/management';
import template from './main.html';
@@ -26,13 +26,13 @@ import { indexManagementStore } from './store';
let elem;
const renderReact = async (elem) => {
render(
-
+
- ,
+ ,
elem
);
};
diff --git a/x-pack/plugins/infra/public/apps/start_app.tsx b/x-pack/plugins/infra/public/apps/start_app.tsx
index 4227f58dd634..b3d67511a617 100644
--- a/x-pack/plugins/infra/public/apps/start_app.tsx
+++ b/x-pack/plugins/infra/public/apps/start_app.tsx
@@ -17,7 +17,7 @@ import { ThemeProvider } from 'styled-components';
import { EuiErrorBoundary } from '@elastic/eui';
import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json';
import euiLightVars from '@elastic/eui/dist/eui_theme_light.json';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { InfraFrontendLibs } from '../lib/lib';
import { PageRouter } from '../routes';
import { createStore } from '../store';
@@ -32,7 +32,7 @@ export async function startApp(libs: InfraFrontendLibs) {
});
libs.framework.render(
-
+
@@ -49,6 +49,6 @@ export async function startApp(libs: InfraFrontendLibs) {
-
+
);
}
diff --git a/x-pack/plugins/license_management/public/register_route.js b/x-pack/plugins/license_management/public/register_route.js
index 99ff1e57b576..720be44bd5d5 100644
--- a/x-pack/plugins/license_management/public/register_route.js
+++ b/x-pack/plugins/license_management/public/register_route.js
@@ -9,7 +9,7 @@ import { render, unmountComponentAtNode } from 'react-dom';
import { Provider } from 'react-redux';
import { HashRouter } from 'react-router-dom';
import { setTelemetryOptInService, setTelemetryEnabled, setHttpClient, TelemetryOptInProvider } from './lib/telemetry';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import chrome from 'ui/chrome';
import App from './app';
@@ -24,13 +24,13 @@ import { getDashboardBreadcrumbs, getUploadBreadcrumbs } from './breadcrumbs';
const renderReact = (elem, store) => {
render(
-
+
- ,
+ ,
elem
);
};
diff --git a/x-pack/plugins/logstash/public/sections/pipeline_edit/components/pipeline_edit/pipeline_edit.js b/x-pack/plugins/logstash/public/sections/pipeline_edit/components/pipeline_edit/pipeline_edit.js
index da40327e50db..4a88de6426d5 100755
--- a/x-pack/plugins/logstash/public/sections/pipeline_edit/components/pipeline_edit/pipeline_edit.js
+++ b/x-pack/plugins/logstash/public/sections/pipeline_edit/components/pipeline_edit/pipeline_edit.js
@@ -9,7 +9,7 @@ import { render } from 'react-dom';
import { isEmpty } from 'lodash';
import { uiModules } from 'ui/modules';
import { Notifier, toastNotifications } from 'ui/notify';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { PipelineEditor } from '../../../../components/pipeline_editor';
import 'plugins/logstash/services/license';
import 'plugins/logstash/services/security';
@@ -37,7 +37,7 @@ app.directive('pipelineEdit', function ($injector) {
: null;
render(
-
+
- ,
+ ,
el[0]
);
},
diff --git a/x-pack/plugins/logstash/public/sections/pipeline_edit/components/upgrade_failure/upgrade_failure.js b/x-pack/plugins/logstash/public/sections/pipeline_edit/components/upgrade_failure/upgrade_failure.js
index cf67b88c1de1..2ef99d3b4767 100755
--- a/x-pack/plugins/logstash/public/sections/pipeline_edit/components/upgrade_failure/upgrade_failure.js
+++ b/x-pack/plugins/logstash/public/sections/pipeline_edit/components/upgrade_failure/upgrade_failure.js
@@ -8,7 +8,7 @@ import React from 'react';
import { render } from 'react-dom';
import { isEmpty } from 'lodash';
import { uiModules } from 'ui/modules';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { UpgradeFailure } from '../../../../components/upgrade_failure';
const app = uiModules.get('xpack/logstash');
@@ -30,14 +30,14 @@ app.directive('upgradeFailure', $injector => {
const isManualUpgrade = !!$route.current.params.retry;
render(
-
+
- ,
+ ,
el[0]
);
},
diff --git a/x-pack/plugins/logstash/public/sections/pipeline_list/components/pipeline_list/pipeline_list.js b/x-pack/plugins/logstash/public/sections/pipeline_list/components/pipeline_list/pipeline_list.js
index 4000fe7ef08a..d248c9b1851a 100755
--- a/x-pack/plugins/logstash/public/sections/pipeline_list/components/pipeline_list/pipeline_list.js
+++ b/x-pack/plugins/logstash/public/sections/pipeline_list/components/pipeline_list/pipeline_list.js
@@ -8,7 +8,7 @@ import React from 'react';
import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
import { toastNotifications } from 'ui/notify';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { PipelineList } from '../../../../components/pipeline_list';
import 'plugins/logstash/services/pipelines';
import 'plugins/logstash/services/license';
@@ -34,7 +34,7 @@ app.directive('pipelineList', function ($injector) {
const clonePipeline = id =>
scope.$evalAsync(kbnUrl.change(`management/logstash/pipelines/pipeline/${id}/edit?clone`));
render(
-
+
- ,
+ ,
el[0]
);
},
diff --git a/x-pack/plugins/maps/public/angular/map_controller.js b/x-pack/plugins/maps/public/angular/map_controller.js
index e246ec20a3a6..c483c3cbac07 100644
--- a/x-pack/plugins/maps/public/angular/map_controller.js
+++ b/x-pack/plugins/maps/public/angular/map_controller.js
@@ -6,7 +6,7 @@
import chrome from 'ui/chrome';
import React from 'react';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { render, unmountComponentAtNode } from 'react-dom';
import { uiModules } from 'ui/modules';
import { timefilter } from 'ui/timefilter';
@@ -142,9 +142,9 @@ app.controller('GisMapController', ($scope, $route, config, kbnUrl, localStorage
const root = document.getElementById(REACT_ANCHOR_DOM_ELEMENT_ID);
render(
-
+
-
+
,
root
);
diff --git a/x-pack/plugins/ml/public/components/annotations_table/annotations_table_directive.js b/x-pack/plugins/ml/public/components/annotations_table/annotations_table_directive.js
index 29d8dcb87595..5e8cece16299 100644
--- a/x-pack/plugins/ml/public/components/annotations_table/annotations_table_directive.js
+++ b/x-pack/plugins/ml/public/components/annotations_table/annotations_table_directive.js
@@ -23,7 +23,7 @@ const module = uiModules.get('apps/ml');
import chrome from 'ui/chrome';
const mlAnnotationsEnabled = chrome.getInjected('mlAnnotationsEnabled', false);
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
module.directive('mlAnnotationTable', function () {
@@ -41,9 +41,9 @@ module.directive('mlAnnotationTable', function () {
};
ReactDOM.render(
-
+
{React.createElement(AnnotationsTable, props)}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table_directive.js b/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table_directive.js
index da855ebea053..5772bc98959e 100644
--- a/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table_directive.js
+++ b/x-pack/plugins/ml/public/components/anomalies_table/anomalies_table_directive.js
@@ -7,9 +7,9 @@
import 'ngreact';
+import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
import { timefilter } from 'ui/timefilter';
-import { injectI18nProvider } from '@kbn/i18n/react';
const module = uiModules.get('apps/ml', ['react']);
import { AnomaliesTable } from './anomalies_table';
@@ -18,7 +18,7 @@ module.directive('mlAnomaliesTable', function ($injector) {
const reactDirective = $injector.get('reactDirective');
return reactDirective(
- injectI18nProvider(AnomaliesTable),
+ wrapInI18nContext(AnomaliesTable),
[
['filter', { watchDepth: 'reference' }],
['tableData', { watchDepth: 'reference' }]
diff --git a/x-pack/plugins/ml/public/components/controls/select_severity/select_severity_directive.js b/x-pack/plugins/ml/public/components/controls/select_severity/select_severity_directive.js
index 58e0da263d29..ef168fa0f0e8 100644
--- a/x-pack/plugins/ml/public/components/controls/select_severity/select_severity_directive.js
+++ b/x-pack/plugins/ml/public/components/controls/select_severity/select_severity_directive.js
@@ -7,13 +7,13 @@
import 'ngreact';
+import { wrapInI18nContext } from 'ui/i18n';
import { stateFactoryProvider } from 'plugins/ml/factories/state_factory';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml', ['react']);
import { SelectSeverity, mlSelectSeverityService } from './select_severity';
-import { injectI18nProvider } from '@kbn/i18n/react';
module.service('mlSelectSeverityService', function (Private, i18n) {
const stateFactory = Private(stateFactoryProvider);
@@ -29,7 +29,7 @@ module.service('mlSelectSeverityService', function (Private, i18n) {
const reactDirective = $injector.get('reactDirective');
return reactDirective(
- injectI18nProvider(SelectSeverity),
+ wrapInI18nContext(SelectSeverity),
undefined,
{ restrict: 'E' },
);
diff --git a/x-pack/plugins/ml/public/components/field_title_bar/field_title_bar_directive.js b/x-pack/plugins/ml/public/components/field_title_bar/field_title_bar_directive.js
index 18f18a5949f1..96ea2e7e27c3 100644
--- a/x-pack/plugins/ml/public/components/field_title_bar/field_title_bar_directive.js
+++ b/x-pack/plugins/ml/public/components/field_title_bar/field_title_bar_directive.js
@@ -10,7 +10,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { FieldTitleBar } from './field_title_bar';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml');
@@ -33,9 +33,9 @@ module.directive('mlFieldTitleBar', function () {
};
ReactDOM.render(
-
+
{React.createElement(FieldTitleBar, props)}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon_directive.js b/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon_directive.js
index a134ebfcb691..2be9129df6f7 100644
--- a/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon_directive.js
+++ b/x-pack/plugins/ml/public/components/field_type_icon/field_type_icon_directive.js
@@ -10,7 +10,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { FieldTypeIcon } from './field_type_icon.js';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml');
@@ -35,9 +35,9 @@ module.directive('mlFieldTypeIcon', function () {
};
ReactDOM.render(
-
+
{React.createElement(FieldTypeIcon, props)}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/ml/public/components/validate_job/validate_job_directive.js b/x-pack/plugins/ml/public/components/validate_job/validate_job_directive.js
index e2d8ce214179..29455f394915 100644
--- a/x-pack/plugins/ml/public/components/validate_job/validate_job_directive.js
+++ b/x-pack/plugins/ml/public/components/validate_job/validate_job_directive.js
@@ -9,16 +9,16 @@
import 'ngreact';
+import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml', ['react']);
import { ValidateJob } from './validate_job_view';
import { mlJobService } from 'plugins/ml/services/job_service';
-import { injectI18nProvider } from '@kbn/i18n/react';
module.directive('mlValidateJob', function (reactDirective) {
return reactDirective(
- injectI18nProvider(ValidateJob),
+ wrapInI18nContext(ValidateJob),
undefined,
{ restrict: 'E' },
{ mlJobService }
diff --git a/x-pack/plugins/ml/public/datavisualizer/selector/directive.js b/x-pack/plugins/ml/public/datavisualizer/selector/directive.js
index 603a5f8f1b85..3b00bf7430e7 100644
--- a/x-pack/plugins/ml/public/datavisualizer/selector/directive.js
+++ b/x-pack/plugins/ml/public/datavisualizer/selector/directive.js
@@ -6,8 +6,7 @@
import 'ngreact';
-import { injectI18nProvider } from '@kbn/i18n/react';
-
+import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml', ['react']);
@@ -35,5 +34,5 @@ import { DatavisualizerSelector } from './datavisualizer_selector';
module.directive('datavisualizerSelector', function ($injector) {
const reactDirective = $injector.get('reactDirective');
- return reactDirective(injectI18nProvider(DatavisualizerSelector), undefined, { restrict: 'E' }, { });
+ return reactDirective(wrapInI18nContext(DatavisualizerSelector), undefined, { restrict: 'E' }, { });
});
diff --git a/x-pack/plugins/ml/public/explorer/explorer_react_wrapper_directive.js b/x-pack/plugins/ml/public/explorer/explorer_react_wrapper_directive.js
index b1cbf9bb554d..dc2618c992b8 100644
--- a/x-pack/plugins/ml/public/explorer/explorer_react_wrapper_directive.js
+++ b/x-pack/plugins/ml/public/explorer/explorer_react_wrapper_directive.js
@@ -16,7 +16,7 @@ import { Explorer } from './explorer';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml');
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { mapScopeToProps } from './explorer_utils';
import { EXPLORER_ACTION } from './explorer_constants';
@@ -25,7 +25,7 @@ import { mlExplorerDashboardService } from './explorer_dashboard_service';
module.directive('mlExplorerReactWrapper', function () {
function link(scope, element) {
ReactDOM.render(
- {React.createElement(Explorer, mapScopeToProps(scope))},
+ {React.createElement(Explorer, mapScopeToProps(scope))},
element[0]
);
diff --git a/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer_directive.js b/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer_directive.js
index 5452ab036eb7..7ba3c83f3b31 100644
--- a/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer_directive.js
+++ b/x-pack/plugins/ml/public/file_datavisualizer/file_datavisualizer_directive.js
@@ -6,8 +6,8 @@
import 'ngreact';
-import { injectI18nProvider } from '@kbn/i18n/react';
+import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml', ['react']);
@@ -42,5 +42,5 @@ module.directive('fileDatavisualizerPage', function ($injector) {
const indexPatterns = $injector.get('indexPatterns');
const kibanaConfig = $injector.get('config');
- return reactDirective(injectI18nProvider(FileDataVisualizerPage), undefined, { restrict: 'E' }, { indexPatterns, kibanaConfig });
+ return reactDirective(wrapInI18nContext(FileDataVisualizerPage), undefined, { restrict: 'E' }, { indexPatterns, kibanaConfig });
});
diff --git a/x-pack/plugins/ml/public/jobs/jobs_list/directive.js b/x-pack/plugins/ml/public/jobs/jobs_list/directive.js
index 0025cc0d4cae..f02bd920529e 100644
--- a/x-pack/plugins/ml/public/jobs/jobs_list/directive.js
+++ b/x-pack/plugins/ml/public/jobs/jobs_list/directive.js
@@ -36,7 +36,7 @@ uiRoutes
});
import { JobsPage } from './jobs';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
module.directive('jobsPage', function () {
return {
@@ -44,9 +44,9 @@ module.directive('jobsPage', function () {
restrict: 'E',
link: (scope, element) => {
ReactDOM.render(
-
+
{React.createElement(JobsPage, { angularWrapperScope: scope })}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/ml/public/jobs/new_job/advanced/enable_model_plot_callout/enable_model_plot_callout_directive.js b/x-pack/plugins/ml/public/jobs/new_job/advanced/enable_model_plot_callout/enable_model_plot_callout_directive.js
index 2284624570cc..fadb32a2c459 100644
--- a/x-pack/plugins/ml/public/jobs/new_job/advanced/enable_model_plot_callout/enable_model_plot_callout_directive.js
+++ b/x-pack/plugins/ml/public/jobs/new_job/advanced/enable_model_plot_callout/enable_model_plot_callout_directive.js
@@ -8,15 +8,15 @@
import 'ngreact';
+import { wrapInI18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml', ['react']);
import { EnableModelPlotCallout } from './enable_model_plot_callout_view.js';
-import { injectI18nProvider } from '@kbn/i18n/react';
module.directive('mlEnableModelPlotCallout', function (reactDirective) {
return reactDirective(
- injectI18nProvider(
+ wrapInI18nContext(
EnableModelPlotCallout,
undefined,
{ restrict: 'E' }
diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/components/bucket_span_estimator/bucket_span_estimator_directive.js b/x-pack/plugins/ml/public/jobs/new_job/simple/components/bucket_span_estimator/bucket_span_estimator_directive.js
index 91c41b0fcf71..7bb6238354c5 100644
--- a/x-pack/plugins/ml/public/jobs/new_job/simple/components/bucket_span_estimator/bucket_span_estimator_directive.js
+++ b/x-pack/plugins/ml/public/jobs/new_job/simple/components/bucket_span_estimator/bucket_span_estimator_directive.js
@@ -11,7 +11,7 @@ import { BucketSpanEstimator } from './bucket_span_estimator_view';
import { EVENT_RATE_COUNT_FIELD } from 'plugins/ml/jobs/new_job/simple/components/constants/general';
import { ml } from 'plugins/ml/services/ml_api_service';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml');
@@ -138,9 +138,9 @@ module.directive('mlBucketSpanEstimator', function (i18n) {
};
ReactDOM.render(
-
+
{React.createElement(BucketSpanEstimator, props)}
- ,
+ ,
$element[0]
);
}
diff --git a/x-pack/plugins/ml/public/jobs/new_job/simple/components/enable_model_plot_checkbox/enable_model_plot_checkbox_directive.js b/x-pack/plugins/ml/public/jobs/new_job/simple/components/enable_model_plot_checkbox/enable_model_plot_checkbox_directive.js
index 82773e9e4e62..3fc1bb85d193 100644
--- a/x-pack/plugins/ml/public/jobs/new_job/simple/components/enable_model_plot_checkbox/enable_model_plot_checkbox_directive.js
+++ b/x-pack/plugins/ml/public/jobs/new_job/simple/components/enable_model_plot_checkbox/enable_model_plot_checkbox_directive.js
@@ -11,7 +11,7 @@ import { EnableModelPlotCheckbox } from './enable_model_plot_checkbox_view.js';
import { ml } from '../../../../../services/ml_api_service';
import { checkCardinalitySuccess } from '../../../utils/new_job_utils';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml');
@@ -142,9 +142,9 @@ module.directive('mlEnableModelPlotCheckbox', function (i18n) {
};
ReactDOM.render(
-
+
{React.createElement(EnableModelPlotCheckbox, props)}
- ,
+ ,
$element[0]
);
}
diff --git a/x-pack/plugins/ml/public/settings/calendars/edit/directive.js b/x-pack/plugins/ml/public/settings/calendars/edit/directive.js
index 5baa0de1421d..9819dacde9ca 100644
--- a/x-pack/plugins/ml/public/settings/calendars/edit/directive.js
+++ b/x-pack/plugins/ml/public/settings/calendars/edit/directive.js
@@ -19,7 +19,7 @@ import { getCreateCalendarBreadcrumbs, getEditCalendarBreadcrumbs } from '../../
import uiRoutes from 'ui/routes';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const template = `
@@ -63,9 +63,9 @@ module.directive('mlNewCalendar', function ($route) {
};
ReactDOM.render(
-
+
{React.createElement(NewCalendar, props)}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/ml/public/settings/calendars/list/directive.js b/x-pack/plugins/ml/public/settings/calendars/list/directive.js
index 251ddafae448..cd142f85de62 100644
--- a/x-pack/plugins/ml/public/settings/calendars/list/directive.js
+++ b/x-pack/plugins/ml/public/settings/calendars/list/directive.js
@@ -19,7 +19,7 @@ import { getCalendarManagementBreadcrumbs } from '../../breadcrumbs';
import uiRoutes from 'ui/routes';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const template = `
@@ -54,9 +54,9 @@ module.directive('mlCalendarsList', function () {
};
ReactDOM.render(
-
+
{React.createElement(CalendarsList, props)}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/ml/public/settings/filter_lists/edit/directive.js b/x-pack/plugins/ml/public/settings/filter_lists/edit/directive.js
index 7878d1cdb0ca..eabf0575f67d 100644
--- a/x-pack/plugins/ml/public/settings/filter_lists/edit/directive.js
+++ b/x-pack/plugins/ml/public/settings/filter_lists/edit/directive.js
@@ -9,7 +9,7 @@ import 'ngreact';
import React from 'react';
import ReactDOM from 'react-dom';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml', ['react']);
@@ -62,9 +62,9 @@ module.directive('mlEditFilterList', function ($route) {
};
ReactDOM.render(
-
+
{React.createElement(EditFilterList, props)}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/ml/public/settings/filter_lists/list/directive.js b/x-pack/plugins/ml/public/settings/filter_lists/list/directive.js
index e1c5c586f3b4..7e5b90add912 100644
--- a/x-pack/plugins/ml/public/settings/filter_lists/list/directive.js
+++ b/x-pack/plugins/ml/public/settings/filter_lists/list/directive.js
@@ -9,7 +9,7 @@ import 'ngreact';
import React from 'react';
import ReactDOM from 'react-dom';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml', ['react']);
@@ -52,9 +52,9 @@ module.directive('mlFilterLists', function () {
};
ReactDOM.render(
-
+
{React.createElement(FilterLists, props)}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/ml/public/settings/settings.test.js b/x-pack/plugins/ml/public/settings/settings.test.js
index 207537ea089b..3e41aba37a26 100644
--- a/x-pack/plugins/ml/public/settings/settings.test.js
+++ b/x-pack/plugins/ml/public/settings/settings.test.js
@@ -10,7 +10,7 @@ jest.mock('ui/chrome', () => ({
getBasePath: jest.fn()
}));
-import { shallow, mount } from 'enzyme';
+import { shallowWithIntl, mountWithIntl } from 'test_utils/enzyme_helpers';
import React from 'react';
import { Settings } from './settings';
@@ -19,7 +19,7 @@ import { Settings } from './settings';
describe('Settings', () => {
test('Renders settings page', () => {
- const wrapper = shallow(
+ const wrapper = shallowWithIntl(
);
@@ -27,7 +27,7 @@ describe('Settings', () => {
});
test('Filter Lists button disabled if canGetFilters is false', () => {
- const wrapper = mount(
+ const wrapper = mountWithIntl(
);
@@ -37,7 +37,7 @@ describe('Settings', () => {
});
test('Calendar management button disabled if canGetCalendars is false', () => {
- const wrapper = mount(
+ const wrapper = mountWithIntl(
);
diff --git a/x-pack/plugins/ml/public/settings/settings_directive.js b/x-pack/plugins/ml/public/settings/settings_directive.js
index d9272cda344f..b82a03f45ee1 100644
--- a/x-pack/plugins/ml/public/settings/settings_directive.js
+++ b/x-pack/plugins/ml/public/settings/settings_directive.js
@@ -17,9 +17,9 @@ import { checkGetJobsPrivilege, checkPermission } from '../privilege/check_privi
import { getMlNodeCount } from '../ml_nodes_check/check_ml_nodes';
import { getSettingsBreadcrumbs } from './breadcrumbs';
+import { I18nContext } from 'ui/i18n';
import uiRoutes from 'ui/routes';
import { timefilter } from 'ui/timefilter';
-import { I18nProvider } from '@kbn/i18n/react';
const template = `
@@ -56,14 +56,14 @@ module.directive('mlSettings', function () {
scope: {},
link: function (scope, element) {
ReactDOM.render(
-
+
{React.createElement(
Settings, {
canGetFilters,
canGetCalendars
})
}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/ml/public/timeseriesexplorer/components/forecasting_modal/forecasting_modal_directive.js b/x-pack/plugins/ml/public/timeseriesexplorer/components/forecasting_modal/forecasting_modal_directive.js
index 6b1c74ec8fa5..cf101256724e 100644
--- a/x-pack/plugins/ml/public/timeseriesexplorer/components/forecasting_modal/forecasting_modal_directive.js
+++ b/x-pack/plugins/ml/public/timeseriesexplorer/components/forecasting_modal/forecasting_modal_directive.js
@@ -7,18 +7,17 @@
import 'ngreact';
+import { wrapInI18nContext } from 'ui/i18n';
import { timefilter } from 'ui/timefilter';
import { uiModules } from 'ui/modules';
const module = uiModules.get('apps/ml', ['react']);
import { ForecastingModal } from './forecasting_modal';
-import { injectI18nProvider } from '@kbn/i18n/react';
-
module.directive('mlForecastingModal', function ($injector) {
const reactDirective = $injector.get('reactDirective');
return reactDirective(
- injectI18nProvider(ForecastingModal),
+ wrapInI18nContext(ForecastingModal),
// reactDirective service requires for react component to have propTypes, but injectI18n doesn't copy propTypes from wrapped component.
// That's why we pass propTypes directly to reactDirective service.
Object.keys(ForecastingModal.WrappedComponent.propTypes || {}),
diff --git a/x-pack/plugins/ml/public/timeseriesexplorer/components/timeseries_chart/timeseries_chart_directive.js b/x-pack/plugins/ml/public/timeseriesexplorer/components/timeseries_chart/timeseries_chart_directive.js
index 5f3c8c1fec46..d5464680fb6d 100644
--- a/x-pack/plugins/ml/public/timeseriesexplorer/components/timeseries_chart/timeseries_chart_directive.js
+++ b/x-pack/plugins/ml/public/timeseriesexplorer/components/timeseries_chart/timeseries_chart_directive.js
@@ -27,7 +27,7 @@ const module = uiModules.get('apps/ml');
import { ml } from 'plugins/ml/services/ml_api_service';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import chrome from 'ui/chrome';
const mlAnnotationsEnabled = chrome.getInjected('mlAnnotationsEnabled', false);
@@ -75,9 +75,9 @@ module.directive('mlTimeseriesChart', function ($timeout) {
};
ReactDOM.render(
-
+
{React.createElement(TimeseriesChart, props)}
- ,
+ ,
element[0]
);
}
diff --git a/x-pack/plugins/monitoring/public/components/cluster/listing/listing.js b/x-pack/plugins/monitoring/public/components/cluster/listing/listing.js
index e36f2aa0d0bb..4cebf48a01a1 100644
--- a/x-pack/plugins/monitoring/public/components/cluster/listing/listing.js
+++ b/x-pack/plugins/monitoring/public/components/cluster/listing/listing.js
@@ -22,7 +22,7 @@ import {
import { toastNotifications } from 'ui/notify';
import { EuiMonitoringTable } from 'plugins/monitoring/components/table';
import { AlertsIndicator } from 'plugins/monitoring/components/cluster/listing/alerts_indicator';
-import { I18nProvider, FormattedMessage } from '@kbn/i18n/react';
+import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../../common/constants';
@@ -422,45 +422,43 @@ export class Listing extends Component {
const hasStandaloneCluster = !!clusters.find(cluster => cluster.cluster_uuid === STANDALONE_CLUSTER_CLUSTER_UUID);
return (
-
-
-
-
- {hasStandaloneCluster ? this.renderStandaloneClusterCallout(_changeCluster, angular.storage) : null}
- {
- return {
- 'data-test-subj': `clusterRow_${item.cluster_uuid}`
- };
- }}
- sorting={{
- ...sorting,
- sort: {
- ...sorting.sort,
- field: 'cluster_name'
- }
- }}
- pagination={pagination}
- search={{
- box: {
- incremental: true,
- placeholder: angular.scope.filterText
- },
- }}
- onTableChange={onTableChange}
- />
-
-
-
-
+
+
+
+ {hasStandaloneCluster ? this.renderStandaloneClusterCallout(_changeCluster, angular.storage) : null}
+ {
+ return {
+ 'data-test-subj': `clusterRow_${item.cluster_uuid}`
+ };
+ }}
+ sorting={{
+ ...sorting,
+ sort: {
+ ...sorting.sort,
+ field: 'cluster_name'
+ }
+ }}
+ pagination={pagination}
+ search={{
+ box: {
+ incremental: true,
+ placeholder: angular.scope.filterText
+ },
+ }}
+ onTableChange={onTableChange}
+ />
+
+
+
);
}
}
diff --git a/x-pack/plugins/monitoring/public/directives/beats/beat/index.js b/x-pack/plugins/monitoring/public/directives/beats/beat/index.js
index e7f0fc291c68..4532190c942d 100644
--- a/x-pack/plugins/monitoring/public/directives/beats/beat/index.js
+++ b/x-pack/plugins/monitoring/public/directives/beats/beat/index.js
@@ -10,7 +10,7 @@ import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
import { Beat } from 'plugins/monitoring/components/beats/beat';
import { timefilter } from 'ui/timefilter';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const uiModule = uiModules.get('monitoring/directives', []);
uiModule.directive('monitoringBeatsBeat', () => {
@@ -31,13 +31,13 @@ uiModule.directive('monitoringBeatsBeat', () => {
scope.$watch('data', (data = {}) => {
render((
-
+
-
+
), $el[0]);
});
diff --git a/x-pack/plugins/monitoring/public/directives/beats/listing/index.js b/x-pack/plugins/monitoring/public/directives/beats/listing/index.js
index b2964a28574f..64da148f6324 100644
--- a/x-pack/plugins/monitoring/public/directives/beats/listing/index.js
+++ b/x-pack/plugins/monitoring/public/directives/beats/listing/index.js
@@ -7,7 +7,7 @@
import React from 'react';
import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { Listing } from '../../../components/beats/listing/listing';
const uiModule = uiModules.get('monitoring/directives', []);
@@ -23,7 +23,7 @@ uiModule.directive('monitoringBeatsListing', (kbnUrl) => {
link(scope, $el) {
function renderReact(data) {
render((
-
+ {
scope,
}}
/>
-
+
), $el[0]);
}
scope.$watch('data', (data = {}) => {
diff --git a/x-pack/plugins/monitoring/public/directives/beats/overview/index.js b/x-pack/plugins/monitoring/public/directives/beats/overview/index.js
index e99433c741d4..051088e3af7f 100644
--- a/x-pack/plugins/monitoring/public/directives/beats/overview/index.js
+++ b/x-pack/plugins/monitoring/public/directives/beats/overview/index.js
@@ -10,7 +10,7 @@ import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
import { BeatsOverview } from 'plugins/monitoring/components/beats/overview';
import { timefilter } from 'ui/timefilter';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const uiModule = uiModules.get('monitoring/directives', []);
uiModule.directive('monitoringBeatsOverview', () => {
@@ -31,12 +31,12 @@ uiModule.directive('monitoringBeatsOverview', () => {
scope.$watch('data', (data = {}) => {
render((
-
+
-
+
), $el[0]);
});
diff --git a/x-pack/plugins/monitoring/public/directives/chart/index.js b/x-pack/plugins/monitoring/public/directives/chart/index.js
index 48912e7ecba7..713f3d29921c 100644
--- a/x-pack/plugins/monitoring/public/directives/chart/index.js
+++ b/x-pack/plugins/monitoring/public/directives/chart/index.js
@@ -11,7 +11,7 @@ import { uiModules } from 'ui/modules';
import { timefilter } from 'ui/timefilter';
import { MonitoringTimeseriesContainer } from '../../components/chart/monitoring_timeseries_container';
import { EuiSpacer } from '@elastic/eui';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const uiModule = uiModules.get('plugins/monitoring/directives', []);
uiModule.directive('monitoringChart', () => {
@@ -31,7 +31,7 @@ uiModule.directive('monitoringChart', () => {
scope.$watch('series', series => {
render(
-
+ {
/>
- ,
+ ,
$elem[0]
);
});
diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/cluster_status/index.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/cluster_status/index.js
index 7f0d5a665c33..a9a2abea4e85 100644
--- a/x-pack/plugins/monitoring/public/directives/elasticsearch/cluster_status/index.js
+++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/cluster_status/index.js
@@ -8,7 +8,7 @@ import React from 'react';
import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
import { ClusterStatus } from 'plugins/monitoring/components/elasticsearch/cluster_status';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const uiModule = uiModules.get('monitoring/directives', []);
uiModule.directive('monitoringClusterStatusElasticsearch', () => {
@@ -19,7 +19,7 @@ uiModule.directive('monitoringClusterStatusElasticsearch', () => {
},
link(scope, $el) {
scope.$watch('status', status => {
- render(, $el[0]);
+ render(, $el[0]);
});
}
};
diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/index_summary/index.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/index_summary/index.js
index 24e48609c478..234d0753f160 100644
--- a/x-pack/plugins/monitoring/public/directives/elasticsearch/index_summary/index.js
+++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/index_summary/index.js
@@ -8,7 +8,7 @@ import React from 'react';
import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
import { IndexDetailStatus } from 'plugins/monitoring/components/elasticsearch/index_detail_status';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const uiModule = uiModules.get('monitoring/directives', []);
uiModule.directive('monitoringIndexSummary', () => {
@@ -17,7 +17,7 @@ uiModule.directive('monitoringIndexSummary', () => {
scope: { summary: '=' },
link(scope, $el) {
scope.$watch('summary', summary => {
- render(, $el[0]);
+ render(, $el[0]);
});
}
};
diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/ml_job_listing/index.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/ml_job_listing/index.js
index 78a04c8c9f4f..b7d6987163b5 100644
--- a/x-pack/plugins/monitoring/public/directives/elasticsearch/ml_job_listing/index.js
+++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/ml_job_listing/index.js
@@ -8,6 +8,7 @@ import { capitalize } from 'lodash';
import numeral from '@elastic/numeral';
import React from 'react';
import { render } from 'react-dom';
+import { I18nContext } from 'ui/i18n';
import { uiModules } from 'ui/modules';
import { EuiMonitoringTable } from 'plugins/monitoring/components/table';
import { MachineLearningJobStatusIcon } from 'plugins/monitoring/components/elasticsearch/ml_job_listing/status_icon';
@@ -22,7 +23,7 @@ import {
} from '@elastic/eui';
import { ClusterStatus } from '../../../components/elasticsearch/cluster_status';
import { i18n } from '@kbn/i18n';
-import { I18nProvider, FormattedMessage } from '@kbn/i18n/react';
+import { FormattedMessage } from '@kbn/i18n/react';
const getColumns = (kbnUrl, scope) => ([
{
@@ -130,7 +131,7 @@ uiModule.directive('monitoringMlListing', kbnUrl => {
scope.$watch('jobs', (jobs = []) => {
const mlTable = (
-
+
@@ -164,7 +165,7 @@ uiModule.directive('monitoringMlListing', kbnUrl => {
-
+
);
render(mlTable, $el[0]);
});
diff --git a/x-pack/plugins/monitoring/public/directives/elasticsearch/node_summary/index.js b/x-pack/plugins/monitoring/public/directives/elasticsearch/node_summary/index.js
index 81a8a55f58b0..030ba5c62126 100644
--- a/x-pack/plugins/monitoring/public/directives/elasticsearch/node_summary/index.js
+++ b/x-pack/plugins/monitoring/public/directives/elasticsearch/node_summary/index.js
@@ -8,7 +8,7 @@ import React from 'react';
import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
import { NodeDetailStatus } from 'plugins/monitoring/components/elasticsearch/node_detail_status';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const uiModule = uiModules.get('monitoring/directives', []);
uiModule.directive('monitoringNodeSummary', () => {
@@ -19,7 +19,7 @@ uiModule.directive('monitoringNodeSummary', () => {
},
link(scope, $el) {
scope.$watch('node', node => {
- render(, $el[0]);
+ render(, $el[0]);
});
}
};
diff --git a/x-pack/plugins/monitoring/public/directives/kibana/cluster_status/index.js b/x-pack/plugins/monitoring/public/directives/kibana/cluster_status/index.js
index 1fd57f1b5c2c..c1daf984e8f8 100644
--- a/x-pack/plugins/monitoring/public/directives/kibana/cluster_status/index.js
+++ b/x-pack/plugins/monitoring/public/directives/kibana/cluster_status/index.js
@@ -8,7 +8,7 @@ import React from 'react';
import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
import { ClusterStatus } from 'plugins/monitoring/components/kibana/cluster_status';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const uiModule = uiModules.get('monitoring/directives', []);
uiModule.directive('monitoringClusterStatusKibana', () => {
@@ -19,7 +19,7 @@ uiModule.directive('monitoringClusterStatusKibana', () => {
},
link(scope, $el) {
scope.$watch('status', status => {
- render(, $el[0]);
+ render(, $el[0]);
});
},
};
diff --git a/x-pack/plugins/monitoring/public/directives/kibana/listing/index.js b/x-pack/plugins/monitoring/public/directives/kibana/listing/index.js
index 46c2dca3468d..6c71517382dd 100644
--- a/x-pack/plugins/monitoring/public/directives/kibana/listing/index.js
+++ b/x-pack/plugins/monitoring/public/directives/kibana/listing/index.js
@@ -23,7 +23,8 @@ import {
EuiLink,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { FormattedMessage, injectI18n, I18nProvider } from '@kbn/i18n/react';
+import { FormattedMessage, injectI18n } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const filterFields = [ 'kibana.name', 'kibana.host', 'kibana.status', 'kibana.transport_address' ];
const columns = [
@@ -155,7 +156,7 @@ uiModule.directive('monitoringKibanaListing', (kbnUrl, i18n) => {
scope.$watch('instances', (instances = []) => {
const kibanasTable = (
-
+ {
columns={columns}
rowComponent={instanceRowFactory(scope, kbnUrl)}
/>
-
+
);
render(kibanasTable, $el[0]);
});
diff --git a/x-pack/plugins/monitoring/public/directives/kibana/summary/index.js b/x-pack/plugins/monitoring/public/directives/kibana/summary/index.js
index 521fc37a650c..e6411ccf67c4 100644
--- a/x-pack/plugins/monitoring/public/directives/kibana/summary/index.js
+++ b/x-pack/plugins/monitoring/public/directives/kibana/summary/index.js
@@ -8,7 +8,7 @@ import React from 'react';
import { render } from 'react-dom';
import { uiModules } from 'ui/modules';
import { DetailStatus } from 'plugins/monitoring/components/kibana/detail_status';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
const uiModule = uiModules.get('monitoring/directives', []);
uiModule.directive('monitoringKibanaSummary', () => {
@@ -19,7 +19,7 @@ uiModule.directive('monitoringKibanaSummary', () => {
},
link(scope, $el) {
scope.$watch('kibana', kibana => {
- render(, $el[0]);
+ render(, $el[0]);
});
}
};
diff --git a/x-pack/plugins/monitoring/public/views/alerts/index.js b/x-pack/plugins/monitoring/public/views/alerts/index.js
index ab8b57bff072..944df36b2750 100644
--- a/x-pack/plugins/monitoring/public/views/alerts/index.js
+++ b/x-pack/plugins/monitoring/public/views/alerts/index.js
@@ -11,10 +11,11 @@ import uiRoutes from 'ui/routes';
import template from './index.html';
import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import { ajaxErrorHandlersProvider } from 'plugins/monitoring/lib/ajax_error_handler';
+import { I18nContext } from 'ui/i18n';
import { timefilter } from 'ui/timefilter';
import { Alerts } from '../../components/alerts';
import { MonitoringViewBaseEuiTableController } from '../base_eui_table_controller';
-import { I18nProvider, FormattedMessage } from '@kbn/i18n/react';
+import { FormattedMessage } from '@kbn/i18n/react';
import { EuiPage, EuiPageBody, EuiPageContent, EuiSpacer, EuiLink } from '@elastic/eui';
function getPageData($injector) {
@@ -79,7 +80,7 @@ uiRoutes.when('/alerts', {
/>);
render(
-
+
@@ -96,7 +97,7 @@ uiRoutes.when('/alerts', {
- ,
+ ,
document.getElementById('monitoringAlertsApp')
);
};
diff --git a/x-pack/plugins/monitoring/public/views/apm/instance/index.js b/x-pack/plugins/monitoring/public/views/apm/instance/index.js
index a9afb883ae72..ec662d7c96aa 100644
--- a/x-pack/plugins/monitoring/public/views/apm/instance/index.js
+++ b/x-pack/plugins/monitoring/public/views/apm/instance/index.js
@@ -19,7 +19,7 @@ import template from './index.html';
import { MonitoringViewBaseController } from '../../base_controller';
import { ApmServerInstance } from '../../../components/apm/instance';
import { timefilter } from 'ui/timefilter';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
uiRoutes.when('/apm/instances/:uuid', {
template,
@@ -69,13 +69,13 @@ uiRoutes.when('/apm/instances/:uuid', {
renderReact(data, onBrush) {
const component = (
-
+
-
+
);
super.renderReact(component);
}
diff --git a/x-pack/plugins/monitoring/public/views/apm/instances/index.js b/x-pack/plugins/monitoring/public/views/apm/instances/index.js
index 4c6c7ef784f0..3a104452076b 100644
--- a/x-pack/plugins/monitoring/public/views/apm/instances/index.js
+++ b/x-pack/plugins/monitoring/public/views/apm/instances/index.js
@@ -11,7 +11,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import template from './index.html';
import { ApmServerInstances } from '../../../components/apm/instances';
import { MonitoringViewBaseEuiTableController } from '../..';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
uiRoutes.when('/apm/instances', {
template,
@@ -57,7 +57,7 @@ uiRoutes.when('/apm/instances', {
} = this;
const component = (
-
+
-
+
);
super.renderReact(component);
}
diff --git a/x-pack/plugins/monitoring/public/views/apm/overview/index.js b/x-pack/plugins/monitoring/public/views/apm/overview/index.js
index f06a60d43c1d..ccb5ed38fbee 100644
--- a/x-pack/plugins/monitoring/public/views/apm/overview/index.js
+++ b/x-pack/plugins/monitoring/public/views/apm/overview/index.js
@@ -13,7 +13,7 @@ import template from './index.html';
import { MonitoringViewBaseController } from '../../base_controller';
import { ApmOverview } from '../../../components/apm/overview';
import { timefilter } from 'ui/timefilter';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
uiRoutes.when('/apm', {
template,
@@ -55,12 +55,12 @@ uiRoutes.when('/apm', {
renderReact(data, onBrush) {
const component = (
-
+
-
+
);
super.renderReact(component);
}
diff --git a/x-pack/plugins/monitoring/public/views/base_controller.js b/x-pack/plugins/monitoring/public/views/base_controller.js
index ee69d53b8bd1..3c49dfa81f1e 100644
--- a/x-pack/plugins/monitoring/public/views/base_controller.js
+++ b/x-pack/plugins/monitoring/public/views/base_controller.js
@@ -10,7 +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';
+import { I18nContext } from 'ui/i18n';
/**
* Class to manage common instantiation behaviors in a view controller
@@ -142,7 +142,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/cluster/listing/index.js b/x-pack/plugins/monitoring/public/views/cluster/listing/index.js
index a7b59634e200..06250e517395 100644
--- a/x-pack/plugins/monitoring/public/views/cluster/listing/index.js
+++ b/x-pack/plugins/monitoring/public/views/cluster/listing/index.js
@@ -8,7 +8,7 @@ import React from 'react';
import uiRoutes from 'ui/routes';
import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import { MonitoringViewBaseEuiTableController } from '../../';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import template from './index.html';
import { Listing } from '../../../components/cluster/listing';
@@ -59,7 +59,7 @@ uiRoutes.when('/home', {
$scope.$watch(() => this.data, data => {
this.renderReact(
-
+
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/cluster/overview/index.js b/x-pack/plugins/monitoring/public/views/cluster/overview/index.js
index bdfe0d4ec3b4..e8c9e1e067d8 100644
--- a/x-pack/plugins/monitoring/public/views/cluster/overview/index.js
+++ b/x-pack/plugins/monitoring/public/views/cluster/overview/index.js
@@ -9,7 +9,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import template from './index.html';
import { MonitoringViewBaseController } from '../../';
import { Overview } from 'plugins/monitoring/components/cluster/overview';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
uiRoutes.when('/overview', {
template,
@@ -48,13 +48,13 @@ uiRoutes.when('/overview', {
$scope.$watch(() => this.data, data => {
this.renderReact(
-
+
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js
index d4f52621f372..5e8c6d265403 100644
--- a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js
+++ b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/index.js
@@ -11,7 +11,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import template from './index.html';
import { Ccr } from '../../../components/elasticsearch/ccr';
import { MonitoringViewBaseController } from '../../base_controller';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
uiRoutes.when('/elasticsearch/ccr', {
template,
@@ -41,9 +41,9 @@ uiRoutes.when('/elasticsearch/ccr', {
this.renderReact = ({ data }) => {
super.renderReact(
-
+
-
+
);
};
}
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/shard/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/shard/index.js
index 54164b06ce09..aa4f89846eee 100644
--- a/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/shard/index.js
+++ b/x-pack/plugins/monitoring/public/views/elasticsearch/ccr/shard/index.js
@@ -12,7 +12,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import template from './index.html';
import { MonitoringViewBaseController } from '../../../base_controller';
import { CcrShard } from '../../../../components/elasticsearch/ccr_shard';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
uiRoutes.when('/elasticsearch/ccr/:index/shard/:shardId', {
template,
@@ -50,9 +50,9 @@ uiRoutes.when('/elasticsearch/ccr/:index/shard/:shardId', {
this.renderReact = (props) => {
super.renderReact(
-
+
-
+
);
};
}
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.js
index 1a51154beb62..48033b1fe7d5 100644
--- a/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.js
+++ b/x-pack/plugins/monitoring/public/views/elasticsearch/index/advanced/index.js
@@ -14,7 +14,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import template from './index.html';
import { timefilter } from 'ui/timefilter';
import { AdvancedIndex } from '../../../../components/elasticsearch/index/advanced';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { MonitoringViewBaseController } from '../../../base_controller';
function getPageData($injector) {
@@ -73,13 +73,13 @@ uiRoutes.when('/elasticsearch/indices/:index/advanced', {
$scope.$watch(() => this.data, data => {
this.renderReact(
-
+
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js
index ff93c25ce89e..da0cbec0ea08 100644
--- a/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js
+++ b/x-pack/plugins/monitoring/public/views/elasticsearch/index/index.js
@@ -13,7 +13,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import { ajaxErrorHandlersProvider } from 'plugins/monitoring/lib/ajax_error_handler';
import template from './index.html';
import { timefilter } from 'ui/timefilter';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { labels } from '../../../components/elasticsearch/shard_allocation/lib/labels';
import { indicesByNodes } from '../../../components/elasticsearch/shard_allocation/transformers/indices_by_nodes';
import { Index } from '../../../components/elasticsearch/index/index';
@@ -90,14 +90,14 @@ uiRoutes.when('/elasticsearch/indices/:index', {
}
this.renderReact(
-
+
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js
index e91cb07169d3..67ddb7eb06ba 100644
--- a/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js
+++ b/x-pack/plugins/monitoring/public/views/elasticsearch/indices/index.js
@@ -11,7 +11,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import { MonitoringViewBaseEuiTableController } from '../../';
import { ElasticsearchIndices } from '../../../components';
import template from './index.html';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
uiRoutes.when('/elasticsearch/indices', {
template,
@@ -63,7 +63,7 @@ uiRoutes.when('/elasticsearch/indices', {
this.renderReact = ({ clusterStatus, indices }) => {
super.renderReact(
-
+
-
+
);
};
}
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/node/advanced/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/node/advanced/index.js
index 676ea670c67c..f3f6de95956c 100644
--- a/x-pack/plugins/monitoring/public/views/elasticsearch/node/advanced/index.js
+++ b/x-pack/plugins/monitoring/public/views/elasticsearch/node/advanced/index.js
@@ -13,7 +13,7 @@ import { ajaxErrorHandlersProvider } from 'plugins/monitoring/lib/ajax_error_han
import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import template from './index.html';
import { timefilter } from 'ui/timefilter';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { AdvancedNode } from '../../../../components/elasticsearch/node/advanced';
import { MonitoringViewBaseController } from '../../../base_controller';
@@ -72,13 +72,13 @@ uiRoutes.when('/elasticsearch/nodes/:node/advanced', {
}));
this.renderReact(
-
+
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/node/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/node/index.js
index 9c92a525e2a2..9ce4b4cb725d 100644
--- a/x-pack/plugins/monitoring/public/views/elasticsearch/node/index.js
+++ b/x-pack/plugins/monitoring/public/views/elasticsearch/node/index.js
@@ -14,7 +14,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import { getPageData } from './get_page_data';
import template from './index.html';
import { Node } from '../../../components/elasticsearch/node/node';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { labels } from '../../../components/elasticsearch/shard_allocation/lib/labels';
import { nodesByIndices } from '../../../components/elasticsearch/shard_allocation/transformers/nodes_by_indices';
import { MonitoringViewBaseController } from '../../base_controller';
@@ -75,14 +75,14 @@ uiRoutes.when('/elasticsearch/nodes/:node', {
$scope.labels = labels.node;
this.renderReact(
-
+
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/nodes/index.js b/x-pack/plugins/monitoring/public/views/elasticsearch/nodes/index.js
index 472be27a00cb..3a37b0fc3826 100644
--- a/x-pack/plugins/monitoring/public/views/elasticsearch/nodes/index.js
+++ b/x-pack/plugins/monitoring/public/views/elasticsearch/nodes/index.js
@@ -11,7 +11,7 @@ import template from './index.html';
import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import { MonitoringViewBaseEuiTableController } from '../../';
import { ElasticsearchNodes } from '../../../components';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
uiRoutes.when('/elasticsearch/nodes', {
template,
@@ -50,7 +50,7 @@ uiRoutes.when('/elasticsearch/nodes', {
this.renderReact = ({ clusterStatus, nodes }) => {
super.renderReact(
-
+
-
+
);
};
}
diff --git a/x-pack/plugins/monitoring/public/views/elasticsearch/overview/controller.js b/x-pack/plugins/monitoring/public/views/elasticsearch/overview/controller.js
index 6eee4e4cec09..01ef8c131974 100644
--- a/x-pack/plugins/monitoring/public/views/elasticsearch/overview/controller.js
+++ b/x-pack/plugins/monitoring/public/views/elasticsearch/overview/controller.js
@@ -8,7 +8,7 @@ import React from 'react';
import { find } from 'lodash';
import { MonitoringViewBaseController } from '../../';
import { ElasticsearchOverview } from 'plugins/monitoring/components';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
export class ElasticsearchOverviewController extends MonitoringViewBaseController {
constructor($injector, $scope) {
@@ -71,7 +71,7 @@ export class ElasticsearchOverviewController extends MonitoringViewBaseControlle
const { clusterStatus, metrics, shardActivity } = data;
const shardActivityData = shardActivity && this.filterShardActivityData(shardActivity); // no filter on data = null
const component = (
-
+
-
+
);
super.renderReact(component);
diff --git a/x-pack/plugins/monitoring/public/views/kibana/instance/index.js b/x-pack/plugins/monitoring/public/views/kibana/instance/index.js
index 9ca4c02e347c..232f607befaf 100644
--- a/x-pack/plugins/monitoring/public/views/kibana/instance/index.js
+++ b/x-pack/plugins/monitoring/public/views/kibana/instance/index.js
@@ -17,7 +17,7 @@ import { timefilter } from 'ui/timefilter';
import { EuiPage, EuiPageBody, EuiPageContent, EuiSpacer, EuiFlexGrid, EuiFlexItem, EuiPanel } from '@elastic/eui';
import { MonitoringTimeseriesContainer } from '../../../components/chart';
import { DetailStatus } from 'plugins/monitoring/components/kibana/detail_status';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { MonitoringViewBaseController } from '../../base_controller';
function getPageData($injector) {
@@ -71,7 +71,7 @@ uiRoutes.when('/kibana/instances/:uuid', {
this.setTitle(`Kibana - ${get(data, 'kibanaSummary.name')}`);
this.renderReact(
-
+
@@ -126,7 +126,7 @@ uiRoutes.when('/kibana/instances/:uuid', {
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/kibana/instances/index.js b/x-pack/plugins/monitoring/public/views/kibana/instances/index.js
index d2bf3c677f0f..d33fd00680a4 100644
--- a/x-pack/plugins/monitoring/public/views/kibana/instances/index.js
+++ b/x-pack/plugins/monitoring/public/views/kibana/instances/index.js
@@ -6,6 +6,7 @@
import React from 'react';
import { capitalize } from 'lodash';
+import { I18nContext } from 'ui/i18n';
import uiRoutes from'ui/routes';
import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import { MonitoringViewBaseEuiTableController } from '../../';
@@ -17,7 +18,7 @@ import { EuiMonitoringTable } from '../../../components/table';
import { KibanaStatusIcon } from '../../../components/kibana/status_icon';
import { formatMetric, formatNumber } from '../../../lib/format_number';
import { i18n } from '@kbn/i18n';
-import { FormattedMessage, I18nProvider } from '@kbn/i18n/react';
+import { FormattedMessage } from '@kbn/i18n/react';
const getColumns = (kbnUrl, scope) => ([
{
@@ -145,7 +146,7 @@ uiRoutes.when('/kibana/instances', {
}));
this.renderReact(
-
+
@@ -173,7 +174,7 @@ uiRoutes.when('/kibana/instances', {
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/kibana/overview/index.js b/x-pack/plugins/monitoring/public/views/kibana/overview/index.js
index f2c8e636721d..f7d07d472b45 100644
--- a/x-pack/plugins/monitoring/public/views/kibana/overview/index.js
+++ b/x-pack/plugins/monitoring/public/views/kibana/overview/index.js
@@ -16,7 +16,7 @@ import template from './index.html';
import { timefilter } from 'ui/timefilter';
import { EuiPage, EuiPageBody, EuiPageContent, EuiPanel, EuiSpacer, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { ClusterStatus } from '../../../components/kibana/cluster_status';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { MonitoringViewBaseController } from '../../base_controller';
function getPageData($injector) {
@@ -67,7 +67,7 @@ uiRoutes.when('/kibana', {
}
this.renderReact(
-
+
@@ -93,7 +93,7 @@ uiRoutes.when('/kibana', {
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/license/controller.js b/x-pack/plugins/monitoring/public/views/license/controller.js
index 21440ff0b8a1..b87d50a96823 100644
--- a/x-pack/plugins/monitoring/public/views/license/controller.js
+++ b/x-pack/plugins/monitoring/public/views/license/controller.js
@@ -12,7 +12,7 @@ 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';
+import { I18nContext } from 'ui/i18n';
const REACT_NODE_ID = 'licenseReact';
@@ -60,7 +60,7 @@ 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/logstash/node/advanced/index.js b/x-pack/plugins/monitoring/public/views/logstash/node/advanced/index.js
index 5066cd81dae7..4d4e5b4837b3 100644
--- a/x-pack/plugins/monitoring/public/views/logstash/node/advanced/index.js
+++ b/x-pack/plugins/monitoring/public/views/logstash/node/advanced/index.js
@@ -17,7 +17,7 @@ import { MonitoringViewBaseController } from '../../../base_controller';
import { DetailStatus } from 'plugins/monitoring/components/logstash/detail_status';
import { EuiPage, EuiPageBody, EuiPageContent, EuiPanel, EuiSpacer, EuiFlexGrid, EuiFlexItem } from '@elastic/eui';
import { MonitoringTimeseriesContainer } from '../../../../components/chart';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
function getPageData($injector) {
const $http = $injector.get('$http');
@@ -82,7 +82,7 @@ uiRoutes.when('/logstash/node/:uuid/advanced', {
];
this.renderReact(
-
+
@@ -105,7 +105,7 @@ uiRoutes.when('/logstash/node/:uuid/advanced', {
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/logstash/node/index.js b/x-pack/plugins/monitoring/public/views/logstash/node/index.js
index 62820a42ac49..bee3e66e5bfb 100644
--- a/x-pack/plugins/monitoring/public/views/logstash/node/index.js
+++ b/x-pack/plugins/monitoring/public/views/logstash/node/index.js
@@ -16,7 +16,7 @@ import { timefilter } from 'ui/timefilter';
import { DetailStatus } from 'plugins/monitoring/components/logstash/detail_status';
import { EuiPage, EuiPageBody, EuiPageContent, EuiPanel, EuiSpacer, EuiFlexGrid, EuiFlexItem } from '@elastic/eui';
import { MonitoringTimeseriesContainer } from '../../../components/chart';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { MonitoringViewBaseController } from '../../base_controller';
function getPageData($injector) {
@@ -83,7 +83,7 @@ uiRoutes.when('/logstash/node/:uuid', {
];
this.renderReact(
-
+
@@ -106,7 +106,7 @@ uiRoutes.when('/logstash/node/:uuid', {
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js b/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js
index f3adea3ecb75..194ae36a528b 100644
--- a/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js
+++ b/x-pack/plugins/monitoring/public/views/logstash/node/pipelines/index.js
@@ -18,7 +18,7 @@ import {
import template from './index.html';
import { timefilter } from 'ui/timefilter';
import { MonitoringViewBaseEuiTableController } from '../../../';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { PipelineListing } from '../../../../components/logstash/pipeline_listing/pipeline_listing';
const getPageData = ($injector) => {
@@ -95,7 +95,7 @@ uiRoutes
}));
this.renderReact(
-
+
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/logstash/nodes/index.js b/x-pack/plugins/monitoring/public/views/logstash/nodes/index.js
index 867dcd404376..1d17ae7126c0 100644
--- a/x-pack/plugins/monitoring/public/views/logstash/nodes/index.js
+++ b/x-pack/plugins/monitoring/public/views/logstash/nodes/index.js
@@ -9,7 +9,7 @@ import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import { MonitoringViewBaseEuiTableController } from '../../';
import { getPageData } from './get_page_data';
import template from './index.html';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { Listing } from '../../../components/logstash/listing';
uiRoutes.when('/logstash/nodes', {
@@ -38,7 +38,7 @@ uiRoutes.when('/logstash/nodes', {
$scope.$watch(() => this.data, data => {
this.renderReact(
-
+
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/logstash/overview/index.js b/x-pack/plugins/monitoring/public/views/logstash/overview/index.js
index 8da7245b157a..4bf747a16c80 100644
--- a/x-pack/plugins/monitoring/public/views/logstash/overview/index.js
+++ b/x-pack/plugins/monitoring/public/views/logstash/overview/index.js
@@ -13,7 +13,7 @@ import { ajaxErrorHandlersProvider } from 'plugins/monitoring/lib/ajax_error_han
import { routeInitProvider } from 'plugins/monitoring/lib/route_init';
import template from './index.html';
import { timefilter } from 'ui/timefilter';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { Overview } from '../../../components/logstash/overview';
import { MonitoringViewBaseController } from '../../base_controller';
@@ -59,13 +59,13 @@ uiRoutes.when('/logstash', {
$scope.$watch(() => this.data, data => {
this.renderReact(
-
+
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js b/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js
index b6ada2684884..671cdd3a1b60 100644
--- a/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js
+++ b/x-pack/plugins/monitoring/public/views/logstash/pipeline/index.js
@@ -21,7 +21,7 @@ import { PipelineState } from 'plugins/monitoring/components/logstash/pipeline_v
import { PipelineViewer } from 'plugins/monitoring/components/logstash/pipeline_viewer';
import { Pipeline } from 'plugins/monitoring/components/logstash/pipeline_viewer/models/pipeline';
import { MonitoringViewBaseController } from '../../base_controller';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import {
EuiPageBody,
EuiPage,
@@ -113,7 +113,7 @@ uiRoutes.when('/logstash/pipelines/:id/:hash?', {
}
this.pipelineState = new PipelineState(data.pipeline);
this.renderReact(
-
+
@@ -126,7 +126,7 @@ uiRoutes.when('/logstash/pipelines/:id/:hash?', {
-
+
);
});
}
diff --git a/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js b/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js
index d800e565ba50..058b9127c82a 100644
--- a/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js
+++ b/x-pack/plugins/monitoring/public/views/logstash/pipelines/index.js
@@ -16,7 +16,7 @@ import {
} from 'plugins/monitoring/lib/logstash/pipelines';
import template from './index.html';
import { timefilter } from 'ui/timefilter';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { PipelineListing } from '../../../components/logstash/pipeline_listing/pipeline_listing';
import { MonitoringViewBaseEuiTableController } from '../..';
@@ -101,7 +101,7 @@ uiRoutes
: null;
render(
-
+
- ,
+ ,
document.getElementById('monitoringLogstashPipelinesApp')
);
};
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 2f5c4f2cf12d..d108678cb992 100644
--- a/x-pack/plugins/monitoring/public/views/no_data/controller.js
+++ b/x-pack/plugins/monitoring/public/views/no_data/controller.js
@@ -15,7 +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';
+import { I18nContext } from 'ui/i18n';
const REACT_NODE_ID_NO_DATA = 'noDataReact';
@@ -70,9 +70,9 @@ export class NoDataController {
() => model,
props => {
render(
-
+
- ,
+ ,
document.getElementById(REACT_NODE_ID_NO_DATA)
);
},
diff --git a/x-pack/plugins/remote_clusters/public/index.js b/x-pack/plugins/remote_clusters/public/index.js
index 00590d906b30..623c6a8b9266 100644
--- a/x-pack/plugins/remote_clusters/public/index.js
+++ b/x-pack/plugins/remote_clusters/public/index.js
@@ -8,7 +8,7 @@ import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { Provider } from 'react-redux';
import { HashRouter } from 'react-router-dom';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { management } from 'ui/management';
import routes from 'ui/routes';
import chrome from 'ui/chrome';
@@ -33,13 +33,13 @@ if (chrome.getInjected('remoteClustersUiEnabled')) {
const renderReact = async (elem) => {
render(
-
+
- ,
+ ,
elem
);
};
diff --git a/x-pack/plugins/reporting/public/views/management/jobs.js b/x-pack/plugins/reporting/public/views/management/jobs.js
index 3ed5cee088c9..00da4f12e03c 100644
--- a/x-pack/plugins/reporting/public/views/management/jobs.js
+++ b/x-pack/plugins/reporting/public/views/management/jobs.js
@@ -13,7 +13,7 @@ import template from 'plugins/reporting/views/management/jobs.html';
import { ReportListing } from '../../components/report_listing';
import { i18n } from '@kbn/i18n';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { MANAGEMENT_BREADCRUMB } from 'ui/management';
const REACT_ANCHOR_DOM_ELEMENT_ID = 'reportListingAnchor';
@@ -39,14 +39,14 @@ routes.when('/management/kibana/reporting', {
}
render(
-
+
- ,
+ ,
node,
);
});
diff --git a/x-pack/plugins/rollup/public/crud_app/index.js b/x-pack/plugins/rollup/public/crud_app/index.js
index 44edfbbdf885..b2089687b551 100644
--- a/x-pack/plugins/rollup/public/crud_app/index.js
+++ b/x-pack/plugins/rollup/public/crud_app/index.js
@@ -10,7 +10,7 @@ import { render, unmountComponentAtNode } from 'react-dom';
import { Provider } from 'react-redux';
import { HashRouter } from 'react-router-dom';
import { i18n } from '@kbn/i18n';
-import { I18nProvider } from '@kbn/i18n/react';
+import { I18nContext } from 'ui/i18n';
import { management } from 'ui/management';
import routes from 'ui/routes';
@@ -31,13 +31,13 @@ esSection.register('rollup_jobs', {
const renderReact = async (elem) => {
render(
-
+
- ,
+ ,
elem
);
};
diff --git a/x-pack/plugins/security/public/views/logged_out/components/logged_out_page.tsx b/x-pack/plugins/security/public/views/logged_out/components/logged_out_page.tsx
index fbe733f160a2..f73e959dd990 100644
--- a/x-pack/plugins/security/public/views/logged_out/components/logged_out_page.tsx
+++ b/x-pack/plugins/security/public/views/logged_out/components/logged_out_page.tsx
@@ -5,7 +5,7 @@
*/
import { EuiButton, EuiIcon, EuiSpacer, EuiTitle } from '@elastic/eui';
-import { FormattedMessage, I18nProvider } from '@kbn/i18n/react';
+import { FormattedMessage } from '@kbn/i18n/react';
import React, { Component } from 'react';
interface Props {
@@ -15,32 +15,30 @@ interface Props {
export class LoggedOutPage extends Component {
public render() {
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
);
}
}
diff --git a/x-pack/plugins/security/public/views/logged_out/logged_out.tsx b/x-pack/plugins/security/public/views/logged_out/logged_out.tsx
index e1b72f589b13..e7aad5099061 100644
--- a/x-pack/plugins/security/public/views/logged_out/logged_out.tsx
+++ b/x-pack/plugins/security/public/views/logged_out/logged_out.tsx
@@ -10,6 +10,7 @@ import React from 'react';
import { render } from 'react-dom';
import 'ui/autoload/styles';
import chrome from 'ui/chrome';
+import { I18nContext } from 'ui/i18n';
import { LoggedOutPage } from './components';
@@ -19,6 +20,11 @@ chrome
.setRootController('logout', ($scope: any) => {
$scope.$$postDigest(() => {
const domNode = document.getElementById('reactLoggedOutRoot');
- render(, domNode);
+ render(
+
+
+ ,
+ domNode
+ );
});
});
diff --git a/x-pack/plugins/security/public/views/login/components/login_page/__snapshots__/login_page.test.tsx.snap b/x-pack/plugins/security/public/views/login/components/login_page/__snapshots__/login_page.test.tsx.snap
index 52ce28fd9dec..94f4f7e45655 100644
--- a/x-pack/plugins/security/public/views/login/components/login_page/__snapshots__/login_page.test.tsx.snap
+++ b/x-pack/plugins/security/public/views/login/components/login_page/__snapshots__/login_page.test.tsx.snap
@@ -1,468 +1,458 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`LoginPage disabled form states renders as expected when a connection to ES is not available 1`] = `
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
- }
- title={
-
- }
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ title={
+
+ }
+ />
+
+
-
+
`;
exports[`LoginPage disabled form states renders as expected when an unknown loginState layout is provided 1`] = `
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
- }
- title={
-
- }
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ title={
+
+ }
+ />
+
+
-
+
`;
exports[`LoginPage disabled form states renders as expected when secure cookies are required but not present 1`] = `
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
- }
- title={
-
- }
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ title={
+
+ }
+ />
+
+
-
+
`;
exports[`LoginPage disabled form states renders as expected when xpack is not available 1`] = `
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
- }
- title={
-
- }
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ title={
+
+ }
+ />
+
+
-
+
`;
exports[`LoginPage enabled form state renders as expected 1`] = `
-
-