mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
remove @kbn/presentation-containers from links page load bundle (#189595)
Same as https://github.com/elastic/kibana/pull/189533 but for links plugin
This commit is contained in:
parent
8a60cd4e68
commit
817b320584
2 changed files with 20 additions and 5 deletions
16
src/plugins/links/public/actions/compatibility_check.ts
Normal file
16
src/plugins/links/public/actions/compatibility_check.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { apiIsPresentationContainer, PresentationContainer } from '@kbn/presentation-containers';
|
||||
import { EmbeddableApiContext } from '@kbn/presentation-publishing';
|
||||
|
||||
export const compatibilityCheck = (
|
||||
api: EmbeddableApiContext['embeddable']
|
||||
): api is PresentationContainer => {
|
||||
return apiIsPresentationContainer(api);
|
||||
};
|
|
@ -6,7 +6,6 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { apiIsPresentationContainer } from '@kbn/presentation-containers';
|
||||
import { EmbeddableApiContext } from '@kbn/presentation-publishing';
|
||||
import { ADD_PANEL_TRIGGER, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
|
||||
import { COMMON_EMBEDDABLE_GROUPING } from '@kbn/embeddable-plugin/public';
|
||||
|
@ -21,12 +20,12 @@ export const registerCreateLinksPanelAction = () => {
|
|||
getIconType: () => APP_ICON,
|
||||
order: 10,
|
||||
isCompatible: async ({ embeddable }) => {
|
||||
return apiIsPresentationContainer(embeddable);
|
||||
const { compatibilityCheck } = await import('./compatibility_check');
|
||||
return compatibilityCheck(embeddable);
|
||||
},
|
||||
execute: async ({ embeddable }) => {
|
||||
if (!apiIsPresentationContainer(embeddable)) {
|
||||
throw new IncompatibleActionError();
|
||||
}
|
||||
const { compatibilityCheck } = await import('./compatibility_check');
|
||||
if (!compatibilityCheck(embeddable)) throw new IncompatibleActionError();
|
||||
const { openEditorFlyout } = await import('../editor/open_editor_flyout');
|
||||
const runtimeState = await openEditorFlyout({
|
||||
parentDashboard: embeddable,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue