Skip to content

Commit

Permalink
Enable ML embeddables in Canvas
Browse files Browse the repository at this point in the history
Fixed conditional
  • Loading branch information
cqliu1 committed Oct 13, 2021
1 parent b632ae7 commit ac9aa93
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/canvas/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { PluginInitializerContext } from 'kibana/public';
import { CoreStart } from '../../../../src/core/public';
import { CanvasServices } from './services';
import { CanvasSetup, CanvasStart, CanvasStartDeps, CanvasPlugin } from './plugin';
export { CANVAS_APP } from '../common/lib/constants';

export { CanvasSetup, CanvasStart };

export interface WithKibanaProps {
kibana: {
services: CoreStart & CanvasStartDeps & { canvas: CanvasServices };
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/ml/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"server": true,
"ui": true,
"requiredBundles": [
"canvas",
"esUiShared",
"kibanaUtils",
"kibanaReact",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '../../../../../../src/plugins/kibana_react/public';
import { getMlGlobalServices } from '../../application/app';
import { DashboardConstants } from '../../../../../../src/plugins/dashboard/public';
import { CANVAS_APP } from '../../../../../../x-pack/plugins/canvas/public';
import { JobId } from '../../../common/types/anomaly_detection_jobs';
import { JobSelectorFlyout } from './components/job_selector_flyout';

Expand Down Expand Up @@ -90,8 +91,8 @@ export async function resolveJobSelection(
}
); // Close the flyout when user navigates out of the dashboard plugin

currentAppId$.pipe(takeUntil(from(flyoutSession.onClose))).subscribe((appId) => {
if (appId !== DashboardConstants.DASHBOARDS_ID) {
currentAppId$.pipe(takeUntil(from(flyoutSession.onClose))).subscribe((appId = '') => {
if (![DashboardConstants.DASHBOARDS_ID, CANVAS_APP].includes(appId)) {
flyoutSession.close();
}
});
Expand Down

0 comments on commit ac9aa93

Please sign in to comment.