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:
Nathan Reese 2024-07-31 17:58:50 -06:00 committed by GitHub
parent 8a60cd4e68
commit 817b320584
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 5 deletions

View 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);
};

View file

@ -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,