Skip to content

Commit

Permalink
[Trigger Actions UI] Properly unmount app (#81436)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
shahzad31 and kibanamachine authored Oct 26, 2020
1 parent 378a4cb commit a9d53f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ export const boot = (bootDeps: BootDeps) => {
</I18nContext>,
element
);
return () => unmountComponentAtNode(element);
return () => {
unmountComponentAtNode(element);
};
};
19 changes: 9 additions & 10 deletions x-pack/plugins/triggers_actions_ui/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/

import {
CoreStart,
CoreSetup,
PluginInitializerContext,
CoreStart,
Plugin as CorePlugin,
PluginInitializerContext,
} from 'src/core/public';

import { i18n } from '@kbn/i18n';
Expand All @@ -17,10 +17,9 @@ import { registerBuiltInAlertTypes } from './application/components/builtin_aler
import { ActionTypeModel, AlertTypeModel } from './types';
import { TypeRegistry } from './application/type_registry';
import {
ManagementSetup,
ManagementAppMountParams,
ManagementSetup,
} from '../../../../src/plugins/management/public';
import { boot } from './application/boot';
import { ChartsPluginStart } from '../../../../src/plugins/charts/public';
import { PluginStartContract as AlertingStart } from '../../alerts/public';
import { DataPublicPluginStart } from '../../../../src/plugins/data/public';
Expand Down Expand Up @@ -63,11 +62,9 @@ export class Plugin
private initializerContext: PluginInitializerContext;

constructor(initializerContext: PluginInitializerContext) {
const actionTypeRegistry = new TypeRegistry<ActionTypeModel>();
this.actionTypeRegistry = actionTypeRegistry;
this.actionTypeRegistry = new TypeRegistry<ActionTypeModel>();

const alertTypeRegistry = new TypeRegistry<AlertTypeModel>();
this.alertTypeRegistry = alertTypeRegistry;
this.alertTypeRegistry = new TypeRegistry<AlertTypeModel>();

this.initializerContext = initializerContext;
}
Expand All @@ -88,7 +85,10 @@ export class Plugin
PluginsStart,
unknown
];
boot({

const { boot } = await import('./application/boot');

return boot({
dataPlugin: pluginsStart.data,
charts: pluginsStart.charts,
alerts: pluginsStart.alerts,
Expand All @@ -107,7 +107,6 @@ export class Plugin
actionTypeRegistry,
alertTypeRegistry,
});
return () => {};
},
});

Expand Down

0 comments on commit a9d53f2

Please sign in to comment.