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 (