Skip to content

Commit

Permalink
fixing vis eligibility
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
  • Loading branch information
amitgalitz committed Jun 28, 2023
1 parent 01883d2 commit fb3f590
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion public/action/ad_dashboard_action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,13 @@ function AssociatedDetectors({ embeddable, closeFlyout, setMode }) {
};
return (
<div className="associated-detectors">
<EuiFlyout style={{ maxWidth: '740px' }} ownFocus size="m" paddingSize="m" onClose={closeFlyout}>
<EuiFlyout
style={{ maxWidth: '740px' }}
ownFocus
size="m"
paddingSize="m"
onClose={closeFlyout}
>
<EuiFlyoutHeader hasBorder>
<EuiTitle>
<h2 id="associated-detectors__title">
Expand Down
6 changes: 1 addition & 5 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb3f590

Please sign in to comment.