mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[dashboard] remove unnecessary Providers for dashboard actions (#148650)
Follow up to https://github.com/elastic/kibana/pull/148037. UiComponent has been remove and Actions no longer break react context. This means that wrapping Action components in Providers is no longer needed. This PR removes these uunnecessary Providers for dashboard actions. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
3d843e2875
commit
7764a7514f
2 changed files with 17 additions and 35 deletions
|
@ -10,12 +10,10 @@ import React from 'react';
|
|||
|
||||
import { EditPanelAction, isFilterableEmbeddable, ViewMode } from '@kbn/embeddable-plugin/public';
|
||||
import { type IEmbeddable, isErrorEmbeddable } from '@kbn/embeddable-plugin/public';
|
||||
import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
|
||||
import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public';
|
||||
import type { ApplicationStart } from '@kbn/core/public';
|
||||
import { type AggregateQuery } from '@kbn/es-query';
|
||||
import { I18nProvider } from '@kbn/i18n-react';
|
||||
|
||||
import { FiltersNotificationPopover } from './filters_notification_popover';
|
||||
import { dashboardFilterNotificationActionStrings } from './_dashboard_actions_strings';
|
||||
|
@ -60,19 +58,15 @@ export class FiltersNotificationAction implements Action<FiltersNotificationActi
|
|||
});
|
||||
|
||||
return (
|
||||
<I18nProvider>
|
||||
<KibanaThemeProvider theme$={this.settingsService.theme.theme$}>
|
||||
<KibanaReactContextProvider>
|
||||
<FiltersNotificationPopover
|
||||
editPanelAction={editPanelAction}
|
||||
displayName={this.displayName}
|
||||
context={context}
|
||||
icon={this.getIconType({ embeddable })}
|
||||
id={this.id}
|
||||
/>
|
||||
</KibanaReactContextProvider>
|
||||
</KibanaThemeProvider>
|
||||
</I18nProvider>
|
||||
<KibanaReactContextProvider>
|
||||
<FiltersNotificationPopover
|
||||
editPanelAction={editPanelAction}
|
||||
displayName={this.displayName}
|
||||
context={context}
|
||||
icon={this.getIconType({ embeddable })}
|
||||
id={this.id}
|
||||
/>
|
||||
</KibanaReactContextProvider>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -15,9 +15,7 @@ import {
|
|||
isReferenceOrValueEmbeddable,
|
||||
} from '@kbn/embeddable-plugin/public';
|
||||
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
|
||||
import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public';
|
||||
|
||||
import { pluginServices } from '../services/plugin_services';
|
||||
import { UnlinkFromLibraryAction } from './unlink_from_library_action';
|
||||
import { LibraryNotificationPopover } from './library_notification_popover';
|
||||
import { dashboardLibraryNotificationStrings } from './_dashboard_actions_strings';
|
||||
|
@ -33,15 +31,7 @@ export class LibraryNotificationAction implements Action<LibraryNotificationActi
|
|||
public readonly type = ACTION_LIBRARY_NOTIFICATION;
|
||||
public readonly order = 1;
|
||||
|
||||
private theme$;
|
||||
|
||||
constructor(private unlinkAction: UnlinkFromLibraryAction) {
|
||||
({
|
||||
settings: {
|
||||
theme: { theme$: this.theme$ },
|
||||
},
|
||||
} = pluginServices.getServices());
|
||||
}
|
||||
constructor(private unlinkAction: UnlinkFromLibraryAction) {}
|
||||
|
||||
private displayName = dashboardLibraryNotificationStrings.getDisplayName();
|
||||
|
||||
|
@ -50,15 +40,13 @@ export class LibraryNotificationAction implements Action<LibraryNotificationActi
|
|||
public readonly MenuItem = ({ context }: { context: LibraryNotificationActionContext }) => {
|
||||
const { embeddable } = context;
|
||||
return (
|
||||
<KibanaThemeProvider theme$={this.theme$}>
|
||||
<LibraryNotificationPopover
|
||||
unlinkAction={this.unlinkAction}
|
||||
displayName={this.displayName}
|
||||
context={context}
|
||||
icon={this.getIconType({ embeddable })}
|
||||
id={this.id}
|
||||
/>
|
||||
</KibanaThemeProvider>
|
||||
<LibraryNotificationPopover
|
||||
unlinkAction={this.unlinkAction}
|
||||
displayName={this.displayName}
|
||||
context={context}
|
||||
icon={this.getIconType({ embeddable })}
|
||||
id={this.id}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue