Skip to content

Commit

Permalink
Revert "just async import presentation container"
Browse files Browse the repository at this point in the history
This reverts commit 2a8781d.
  • Loading branch information
nreese committed Jul 30, 2024
1 parent 2a8781d commit 1a567d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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);
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ export function createStatusOverviewPanelAction(): UiActionsActionDefinition<Emb
order: 30,
getIconType: () => 'online',
isCompatible: async ({ embeddable }) => {
const { apiIsPresentationContainer } = await import('@kbn/presentation-containers');
return apiIsPresentationContainer(embeddable);
const { compatibilityCheck } = await import('./compatibility_check');
return compatibilityCheck(embeddable);
},
execute: async ({ embeddable }) => {
const { apiIsPresentationContainer } = await import('@kbn/presentation-containers');
if (!apiIsPresentationContainer(embeddable)) throw new IncompatibleActionError();
const { compatibilityCheck } = await import('./compatibility_check');
if (!compatibilityCheck(embeddable)) throw new IncompatibleActionError();
try {
embeddable.addNewPanel({
panelType: SYNTHETICS_OVERVIEW_EMBEDDABLE,
Expand Down

0 comments on commit 1a567d0

Please sign in to comment.