@@ -8,39 +8,27 @@ import React from 'react';
88import ReactDOM from 'react-dom' ;
99import { BrowserRouter as Router , Route , RouteComponentProps } from 'react-router-dom' ;
1010import { EuiPage } from '@elastic/eui' ;
11- import {
12- AppMountParameters ,
13- CoreStart ,
14- IUiSettingsClient ,
15- DocLinksStart ,
16- ToastsSetup ,
17- ApplicationStart ,
18- } from '../../../../src/core/public' ;
19- import { DataPublicPluginStart } from '../../../../src/plugins/data/public' ;
20- import { ChartsPluginStart } from '../../../../src/plugins/charts/public' ;
11+ import { AppMountParameters , CoreStart } from '../../../../src/core/public' ;
2112
2213import { Page } from './components/page' ;
2314import { DocumentationPage } from './components/documentation' ;
2415import { ViewAlertPage } from './components/view_alert' ;
2516import { TriggersAndActionsUIPublicPluginStart } from '../../../plugins/triggers_actions_ui/public' ;
2617import { AlertingExamplePublicStartDeps } from './plugin' ;
2718import { ViewPeopleInSpaceAlertPage } from './components/view_astros_alert' ;
19+ import { KibanaContextProvider } from '../../../../src/plugins/kibana_react/public' ;
2820
2921export interface AlertingExampleComponentParams {
30- application : CoreStart [ 'application' ] ;
3122 http : CoreStart [ 'http' ] ;
3223 basename : string ;
3324 triggersActionsUi : TriggersAndActionsUIPublicPluginStart ;
34- data : DataPublicPluginStart ;
35- charts : ChartsPluginStart ;
36- uiSettings : IUiSettingsClient ;
37- docLinks : DocLinksStart ;
38- toastNotifications : ToastsSetup ;
39- capabilities : ApplicationStart [ 'capabilities' ] ;
4025}
4126
42- const AlertingExampleApp = ( deps : AlertingExampleComponentParams ) => {
43- const { basename, http } = deps ;
27+ const AlertingExampleApp = ( {
28+ basename,
29+ http,
30+ triggersActionsUi,
31+ } : AlertingExampleComponentParams ) => {
4432 return (
4533 < Router basename = { basename } >
4634 < EuiPage >
@@ -49,7 +37,7 @@ const AlertingExampleApp = (deps: AlertingExampleComponentParams) => {
4937 exact = { true }
5038 render = { ( ) => (
5139 < Page title = { `Home` } isHome = { true } >
52- < DocumentationPage { ... deps } />
40+ < DocumentationPage triggersActionsUi = { triggersActionsUi } />
5341 </ Page >
5442 ) }
5543 />
@@ -79,21 +67,19 @@ const AlertingExampleApp = (deps: AlertingExampleComponentParams) => {
7967} ;
8068
8169export const renderApp = (
82- { application , notifications , http , uiSettings , docLinks } : CoreStart ,
70+ core : CoreStart ,
8371 deps : AlertingExamplePublicStartDeps ,
8472 { appBasePath, element } : AppMountParameters
8573) => {
74+ const { http } = core ;
8675 ReactDOM . render (
87- < AlertingExampleApp
88- basename = { appBasePath }
89- application = { application }
90- toastNotifications = { notifications . toasts }
91- http = { http }
92- uiSettings = { uiSettings }
93- docLinks = { docLinks }
94- capabilities = { application . capabilities }
95- { ...deps }
96- /> ,
76+ < KibanaContextProvider services = { { ...core , ...deps } } >
77+ < AlertingExampleApp
78+ basename = { appBasePath }
79+ http = { http }
80+ triggersActionsUi = { deps . triggersActionsUi }
81+ />
82+ </ KibanaContextProvider > ,
9783 element
9884 ) ;
9985
0 commit comments