diff --git a/x-pack/plugins/uptime/public/apps/plugin.ts b/x-pack/plugins/uptime/public/apps/plugin.ts index 812108d4c6c2a..78f3dd1623a81 100644 --- a/x-pack/plugins/uptime/public/apps/plugin.ts +++ b/x-pack/plugins/uptime/public/apps/plugin.ts @@ -30,8 +30,6 @@ export interface ClientPluginsStart { export class UptimePlugin implements Plugin { private _store: Store; - private _data: DataPublicPluginSetup | undefined; - private _triggersActionsUI: TriggersAndActionsUIPublicPluginSetup | undefined; constructor(_context: PluginInitializerContext) { this._store = initializeStore(); @@ -41,9 +39,6 @@ export class UptimePlugin implements Plugin, plugins: ClientPluginsSetup ): Promise { - this._data = plugins.data; - this._triggersActionsUI = plugins.triggers_actions_ui; - if (plugins.home) { plugins.home.featureCatalogue.register({ id: PLUGIN.ID, @@ -56,6 +51,19 @@ export class UptimePlugin implements Plugin { + const alertInitializer = init({ + autocomplete: plugins.data.autocomplete, + store: this._store, + }); + if ( + plugins.triggers_actions_ui && + !plugins.triggers_actions_ui.alertTypeRegistry.has(alertInitializer.id) + ) { + plugins.triggers_actions_ui.alertTypeRegistry.register(alertInitializer); + } + }); + const self = this; core.application.register({ appRoute: '/app/uptime#/', @@ -83,19 +91,6 @@ export class UptimePlugin implements Plugin { - const alertInitializer = init({ - autocomplete: this._data!.autocomplete, - store: this._store, - }); - if ( - this._triggersActionsUI && - !this._triggersActionsUI.alertTypeRegistry.has(alertInitializer.id) - ) { - this._triggersActionsUI.alertTypeRegistry.register(alertInitializer); - } - }); } public stop(): void {}