Skip to content

Commit 5064f95

Browse files
[Trigger Actions UI] Properly unmount app (#81436)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
1 parent 608a8f8 commit 5064f95

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

x-pack/plugins/triggers_actions_ui/public/application/boot.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@ export const boot = (bootDeps: BootDeps) => {
2828
</I18nContext>,
2929
element
3030
);
31-
return () => unmountComponentAtNode(element);
31+
return () => {
32+
unmountComponentAtNode(element);
33+
};
3234
};

x-pack/plugins/triggers_actions_ui/public/plugin.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
*/
66

77
import {
8-
CoreStart,
98
CoreSetup,
10-
PluginInitializerContext,
9+
CoreStart,
1110
Plugin as CorePlugin,
11+
PluginInitializerContext,
1212
} from 'src/core/public';
1313

1414
import { i18n } from '@kbn/i18n';
@@ -17,10 +17,9 @@ import { registerBuiltInAlertTypes } from './application/components/builtin_aler
1717
import { ActionTypeModel, AlertTypeModel } from './types';
1818
import { TypeRegistry } from './application/type_registry';
1919
import {
20-
ManagementSetup,
2120
ManagementAppMountParams,
21+
ManagementSetup,
2222
} from '../../../../src/plugins/management/public';
23-
import { boot } from './application/boot';
2423
import { ChartsPluginStart } from '../../../../src/plugins/charts/public';
2524
import { PluginStartContract as AlertingStart } from '../../alerts/public';
2625
import { DataPublicPluginStart } from '../../../../src/plugins/data/public';
@@ -63,11 +62,9 @@ export class Plugin
6362
private initializerContext: PluginInitializerContext;
6463

6564
constructor(initializerContext: PluginInitializerContext) {
66-
const actionTypeRegistry = new TypeRegistry<ActionTypeModel>();
67-
this.actionTypeRegistry = actionTypeRegistry;
65+
this.actionTypeRegistry = new TypeRegistry<ActionTypeModel>();
6866

69-
const alertTypeRegistry = new TypeRegistry<AlertTypeModel>();
70-
this.alertTypeRegistry = alertTypeRegistry;
67+
this.alertTypeRegistry = new TypeRegistry<AlertTypeModel>();
7168

7269
this.initializerContext = initializerContext;
7370
}
@@ -88,7 +85,10 @@ export class Plugin
8885
PluginsStart,
8986
unknown
9087
];
91-
boot({
88+
89+
const { boot } = await import('./application/boot');
90+
91+
return boot({
9292
dataPlugin: pluginsStart.data,
9393
charts: pluginsStart.charts,
9494
alerts: pluginsStart.alerts,
@@ -107,7 +107,6 @@ export class Plugin
107107
actionTypeRegistry,
108108
alertTypeRegistry,
109109
});
110-
return () => {};
111110
},
112111
});
113112

0 commit comments

Comments
 (0)