mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* Injects all required plugins into our context provider (not just data) * Sets defaults for two UI settings that the client doesn't know about (and blow up when trying to retrieve).
This commit is contained in:
parent
2bef93fb1f
commit
a7b7a24b45
3 changed files with 10 additions and 2 deletions
|
@ -8,8 +8,11 @@ import chrome from 'ui/chrome';
|
|||
import { npStart } from 'ui/new_platform';
|
||||
import { Plugin } from './plugin';
|
||||
|
||||
const { data, embeddable, inspector, uiActions } = npStart.plugins;
|
||||
const startPlugins = { data, embeddable, inspector, uiActions };
|
||||
|
||||
new Plugin(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
{ opaqueId: Symbol('siem'), env: {} as any, config: { get: () => ({} as any) } },
|
||||
chrome
|
||||
).start(npStart.core, npStart.plugins);
|
||||
).start(npStart.core, startPlugins);
|
||||
|
|
|
@ -10,6 +10,7 @@ import { LegacyCoreStart, PluginInitializerContext } from 'src/core/public';
|
|||
import { PluginsStart } from 'ui/new_platform/new_platform';
|
||||
import { Chrome } from 'ui/chrome';
|
||||
|
||||
import { DEFAULT_KBN_VERSION, DEFAULT_TIMEZONE_BROWSER } from '../../common/constants';
|
||||
import { SiemApp } from './start_app';
|
||||
import template from './template.html';
|
||||
|
||||
|
@ -32,6 +33,10 @@ export class Plugin {
|
|||
}
|
||||
|
||||
public start(core: StartCore, plugins: StartPlugins) {
|
||||
// TODO(rylnd): These are unknown by uiSettings by default
|
||||
core.uiSettings.set(DEFAULT_KBN_VERSION, '8.0.0');
|
||||
core.uiSettings.set(DEFAULT_TIMEZONE_BROWSER, 'UTC');
|
||||
|
||||
// @ts-ignore improper type description
|
||||
this.chrome.setRootTemplate(template);
|
||||
const checkForRoot = () => {
|
||||
|
|
|
@ -77,9 +77,9 @@ export const SiemApp = memo<{ core: StartCore; plugins: StartPlugins }>(({ core,
|
|||
<KibanaContextProvider
|
||||
services={{
|
||||
appName: 'siem',
|
||||
data: plugins.data,
|
||||
storage: new Storage(localStorage),
|
||||
...core,
|
||||
...plugins,
|
||||
}}
|
||||
>
|
||||
<StartApp {...compose()} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue