Skip to content

Commit

Permalink
Move alert initialization back to start.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed May 14, 2020
1 parent 03ec299 commit bf16f6a
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions x-pack/plugins/uptime/public/apps/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,6 @@ export class UptimePlugin implements Plugin<void, void, ClientPluginsSetup, Clie
});
}

alertTypeInitializers.forEach(init => {
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#/',
Expand All @@ -89,8 +76,22 @@ export class UptimePlugin implements Plugin<void, void, ClientPluginsSetup, Clie
});
}

public start(start: CoreStart, _plugins: {}): void {
public start(start: CoreStart, plugins: any): void {
kibanaService.core = start;
alertTypeInitializers.forEach(init => {
const alertInitializer = init({
autocomplete: plugins.data.autocomplete,
store: this._store,
core: start,
plugins,
});
if (
plugins.triggers_actions_ui &&
!plugins.triggers_actions_ui.alertTypeRegistry.has(alertInitializer.id)
) {
plugins.triggers_actions_ui.alertTypeRegistry.register(alertInitializer);
}
});
}

public stop(): void {}
Expand Down

0 comments on commit bf16f6a

Please sign in to comment.