From e76c295205a7f48429b13186b31320340385c57f Mon Sep 17 00:00:00 2001 From: Catherine Liu Date: Thu, 14 Nov 2024 13:57:24 -0600 Subject: [PATCH] Ensure defined dynamicActions object --- .../actions/flyout_edit_drilldown/flyout_edit_drilldown.tsx | 2 +- x-pack/plugins/embeddable_enhanced/public/plugin.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_edit_drilldown/flyout_edit_drilldown.tsx b/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_edit_drilldown/flyout_edit_drilldown.tsx index 3de141c0a7ed7..26f5311d5b325 100644 --- a/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_edit_drilldown/flyout_edit_drilldown.tsx +++ b/x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_edit_drilldown/flyout_edit_drilldown.tsx @@ -74,7 +74,7 @@ export class FlyoutEditDrilldownAction implements Action { public async isCompatible({ embeddable }: EmbeddableApiContext) { if (!isApiCompatible(embeddable) || getInheritedViewMode(embeddable) !== 'edit') return false; - return (embeddable.dynamicActionsState$.getValue()?.dynamicActions?.events ?? []).length > 0; + return (embeddable.dynamicActionsState$.getValue()?.dynamicActions.events ?? []).length > 0; } public async execute({ embeddable }: EmbeddableApiContext) { diff --git a/x-pack/plugins/embeddable_enhanced/public/plugin.ts b/x-pack/plugins/embeddable_enhanced/public/plugin.ts index f05982af78947..a76f33f095951 100644 --- a/x-pack/plugins/embeddable_enhanced/public/plugin.ts +++ b/x-pack/plugins/embeddable_enhanced/public/plugin.ts @@ -148,8 +148,8 @@ export class EmbeddableEnhancedPlugin ); const api: DynamicActionStorageApi = { dynamicActionsState$, - setDynamicActions: (newState) => { - dynamicActionsState$.next(newState); + setDynamicActions: (enhancements) => { + dynamicActionsState$.next(getDynamicActionsState(enhancements)); }, }; const storage = new DynamicActionStorage(uuid, getTitle, api);