forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SIEM] Move public to new platform (elastic#48840)
* shim public new platform * fix import * fix ml api with kbn version * review I * fix bad coding with the hooks
- Loading branch information
Showing
50 changed files
with
679 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
import { LegacyCoreStart, PluginInitializerContext } from 'src/core/public'; | ||
import { PluginsStart } from 'ui/new_platform/new_platform'; | ||
import { Chrome } from 'ui/chrome'; | ||
|
||
import { SiemApp } from './start_app'; | ||
import template from './template.html'; | ||
|
||
export const ROOT_ELEMENT_ID = 'react-siem-root'; | ||
|
||
export interface StartObject { | ||
core: LegacyCoreStart; | ||
plugins: PluginsStart; | ||
} | ||
|
||
export class Plugin { | ||
constructor( | ||
// @ts-ignore this is added to satisfy the New Platform typing constraint, | ||
// but we're not leveraging any of its functionality yet. | ||
private readonly initializerContext: PluginInitializerContext, | ||
private readonly chrome: Chrome | ||
) { | ||
this.chrome = chrome; | ||
} | ||
|
||
public start(start: StartObject): void { | ||
const { core, plugins } = start; | ||
// @ts-ignore improper type description | ||
this.chrome.setRootTemplate(template); | ||
const checkForRoot = () => { | ||
return new Promise(resolve => { | ||
const ready = !!document.getElementById(ROOT_ELEMENT_ID); | ||
if (ready) { | ||
resolve(); | ||
} else { | ||
setTimeout(() => resolve(checkForRoot()), 10); | ||
} | ||
}); | ||
}; | ||
checkForRoot().then(() => { | ||
const node = document.getElementById(ROOT_ELEMENT_ID); | ||
if (node) { | ||
render(<SiemApp core={core} plugins={plugins} />, node); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div id="react-siem-root"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.