Remove ui/i18n in visualize (#61592)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
dd77dea216
commit
8da46804ac
|
@ -24,7 +24,6 @@
|
|||
* directly where they are needed.
|
||||
*/
|
||||
|
||||
export { wrapInI18nContext } from 'ui/i18n';
|
||||
export { DashboardConstants } from '../dashboard/np_ready/dashboard_constants';
|
||||
export {
|
||||
VisSavedObject,
|
||||
|
|
|
@ -18,19 +18,17 @@
|
|||
*/
|
||||
|
||||
import { addHelpMenuToAppChrome } from '../help_menu/help_menu_util';
|
||||
import { VisualizeListingTable } from './visualize_listing_table';
|
||||
import { withI18nContext } from './visualize_listing_table';
|
||||
|
||||
import { VisualizeConstants } from '../visualize_constants';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { getServices } from '../../kibana_services';
|
||||
import { wrapInI18nContext } from '../../legacy_imports';
|
||||
|
||||
import { syncQueryStateWithUrl } from '../../../../../../../plugins/data/public';
|
||||
|
||||
export function initListingDirective(app) {
|
||||
export function initListingDirective(app, I18nContext) {
|
||||
app.directive('visualizeListingTable', reactDirective =>
|
||||
reactDirective(wrapInI18nContext(VisualizeListingTable))
|
||||
reactDirective(withI18nContext(I18nContext))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -230,4 +230,10 @@ VisualizeListingTable.propTypes = {
|
|||
listingLimit: PropTypes.number.isRequired,
|
||||
};
|
||||
|
||||
export { VisualizeListingTable };
|
||||
const withI18nContext = I18nContext => props => (
|
||||
<I18nContext>
|
||||
<VisualizeListingTable {...props} />
|
||||
</I18nContext>
|
||||
);
|
||||
|
||||
export { withI18nContext };
|
||||
|
|
|
@ -27,5 +27,5 @@ import { initListingDirective } from './listing/visualize_listing';
|
|||
|
||||
export function initVisualizeAppDirective(app: IModule, deps: VisualizeKibanaServices) {
|
||||
initEditorDirective(app, deps);
|
||||
initListingDirective(app);
|
||||
initListingDirective(app, deps.core.i18n.Context);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
import React from 'react';
|
||||
import { render, unmountComponentAtNode } from 'react-dom';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
import { EditorRenderProps } from 'src/legacy/core_plugins/kibana/public/visualize/np_ready/types';
|
||||
|
@ -83,7 +82,7 @@ class DefaultEditorController {
|
|||
|
||||
render({ data, core, ...props }: EditorRenderProps) {
|
||||
render(
|
||||
<I18nProvider>
|
||||
<core.i18n.Context>
|
||||
<KibanaContextProvider
|
||||
services={{
|
||||
appName: 'vis_default_editor',
|
||||
|
@ -94,7 +93,7 @@ class DefaultEditorController {
|
|||
>
|
||||
<DefaultEditor {...this.state} {...props} />
|
||||
</KibanaContextProvider>
|
||||
</I18nProvider>,
|
||||
</core.i18n.Context>,
|
||||
this.el
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue