[ML] Fix registerUrlGenerator broken on basic licensing (#77832)

This commit is contained in:
Quynh Nguyen 2020-09-18 11:33:15 -05:00 committed by GitHub
parent 9f3992f6c2
commit 4980af7565
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.
@ -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();
}