diff --git a/public/action/ad_dashboard_action.tsx b/public/action/ad_dashboard_action.tsx index f8bfbb1db..2cde952bd 100644 --- a/public/action/ad_dashboard_action.tsx +++ b/public/action/ad_dashboard_action.tsx @@ -16,6 +16,7 @@ import { isReferenceOrValueEmbeddable } from '../../../../src/plugins/embeddable import { EuiIconType } from '@elastic/eui/src/components/icon/icon'; import { VisualizeEmbeddable } from '../../../../src/plugins/visualizations/public'; import { isEligibleForVisLayers } from '../../../../src/plugins/vis_augmenter/public'; +import { getUISettings } from '../services'; export const ACTION_AD = 'ad'; @@ -62,9 +63,10 @@ export const createADAction = ({ const vis = (embeddable as VisualizeEmbeddable).vis; return Boolean( embeddable.parent && + embeddable.getInput()?.viewMode === 'view' && isDashboard(embeddable.parent) && vis !== undefined && - isEligibleForVisLayers(vis) + isEligibleForVisLayers(vis, getUISettings()) ); }, execute: async ({ embeddable }: ActionContext) => { diff --git a/public/components/FeatureAnywhereContextMenu/AssociatedDetectors/containers/AssociatedDetectors.tsx b/public/components/FeatureAnywhereContextMenu/AssociatedDetectors/containers/AssociatedDetectors.tsx index 6421f863a..8ab93c76c 100644 --- a/public/components/FeatureAnywhereContextMenu/AssociatedDetectors/containers/AssociatedDetectors.tsx +++ b/public/components/FeatureAnywhereContextMenu/AssociatedDetectors/containers/AssociatedDetectors.tsx @@ -281,7 +281,13 @@ function AssociatedDetectors({ embeddable, closeFlyout, setMode }) { }; return (
- +

diff --git a/public/plugin.ts b/public/plugin.ts index 86aeb1494..53b9aa9ac 100644 --- a/public/plugin.ts +++ b/public/plugin.ts @@ -83,11 +83,7 @@ export class AnomalyDetectionOpenSearchDashboardsPlugin }, }); - // // set embeddable plugin for feature anywhere create flyout - // setEmbeddable(embeddable); - - // // set vis argumenter loader for feature anywhere associated flyout - // setSavedFeatureAnywhereLoader(visAugmenter.savedAugmentVisLoader); + setUISettings(core.uiSettings); // Set the HTTP client so it can be pulled into expression fns to make // direct server-side calls