Skip to content

Commit

Permalink
[7.x] [ML] Fix registerUrlGenerator broken on basic licensing (#77832) (
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 authored Sep 18, 2020
1 parent c1724a6 commit 6ced05b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x-pack/plugins/ml/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,17 @@ export class MlPlugin implements Plugin<MlPluginSetup, MlPluginStart> {
const licensing = pluginsSetup.licensing.license$.pipe(take(1));
licensing.subscribe(async (license) => {
const [coreStart] = await core.getStartServices();

if (isMlEnabled(license)) {
// add ML to home page
if (pluginsSetup.home) {
registerFeature(pluginsSetup.home);
}

// the mlUrlGenerator should be registered even without full license
// for other plugins to access ML links
registerUrlGenerator(pluginsSetup.share, core);

const { capabilities } = coreStart.application;

// register ML for the index pattern management no data screen.
Expand All @@ -129,7 +134,6 @@ export class MlPlugin implements Plugin<MlPluginSetup, MlPluginStart> {
}
registerEmbeddables(pluginsSetup.embeddable, core);
registerMlUiActions(pluginsSetup.uiActions, core);
registerUrlGenerator(pluginsSetup.share, core);
} else if (managementApp) {
managementApp.disable();
}
Expand Down

0 comments on commit 6ced05b

Please sign in to comment.