@@ -23,7 +23,11 @@ import { UiStatsMetricType } from '@kbn/analytics';
2323import { DataPublicPluginStart } from 'src/plugins/data/public' ;
2424import { setServices } from './kibana_services' ;
2525import { KibanaLegacySetup } from '../../../../../plugins/kibana_legacy/public' ;
26- import { FeatureCatalogueEntry } from '../../../../../plugins/home/public' ;
26+ import {
27+ Environment ,
28+ FeatureCatalogueEntry ,
29+ HomePublicPluginStart ,
30+ } from '../../../../../plugins/home/public' ;
2731
2832export interface LegacyAngularInjectedDependencies {
2933 telemetryOptInProvider : any ;
@@ -32,6 +36,7 @@ export interface LegacyAngularInjectedDependencies {
3236
3337export interface HomePluginStartDependencies {
3438 data : DataPublicPluginStart ;
39+ home : HomePublicPluginStart ;
3540}
3641
3742export interface HomePluginSetupDependencies {
@@ -60,6 +65,7 @@ export interface HomePluginSetupDependencies {
6065export class HomePlugin implements Plugin {
6166 private dataStart : DataPublicPluginStart | null = null ;
6267 private savedObjectsClient : any = null ;
68+ private environment : Environment | null = null ;
6369
6470 setup (
6571 core : CoreSetup ,
@@ -86,6 +92,7 @@ export class HomePlugin implements Plugin {
8692 addBasePath : core . http . basePath . prepend ,
8793 getBasePath : core . http . basePath . get ,
8894 indexPatternService : this . dataStart ! . indexPatterns ,
95+ environment : this . environment ! ,
8996 ...angularDependencies ,
9097 } ) ;
9198 const { renderApp } = await import ( './np_ready/application' ) ;
@@ -94,8 +101,8 @@ export class HomePlugin implements Plugin {
94101 } ) ;
95102 }
96103
97- start ( core : CoreStart , { data } : HomePluginStartDependencies ) {
98- // TODO is this really the right way? I though the app context would give us those
104+ start ( core : CoreStart , { data, home } : HomePluginStartDependencies ) {
105+ this . environment = home . environment . get ( ) ;
99106 this . dataStart = data ;
100107 this . savedObjectsClient = core . savedObjects . client ;
101108 }
0 commit comments