Skip to content

Commit

Permalink
[7.x] Data plugin: Expose setup apis also on start (#44903) (#45127)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored Sep 10, 2019
1 parent e3c08f7 commit 35db65a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/legacy/core_plugins/data/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export class DataPlugin implements Plugin<DataSetup, DataStart, DataPluginSetupD
private readonly query: QueryService = new QueryService();
private readonly search: SearchService = new SearchService();

private setupApi!: DataSetup;

public setup(core: CoreSetup, { __LEGACY }: DataPluginSetupDependencies): DataSetup {
const { uiSettings } = core;
const savedObjectsClient = __LEGACY.savedObjectsClient;
Expand All @@ -87,7 +89,8 @@ export class DataPlugin implements Plugin<DataSetup, DataStart, DataPluginSetupD
uiSettings,
savedObjectsClient,
});
return {

this.setupApi = {
expressions: this.expressions.setup(),
indexPatterns: indexPatternsService,
filter: this.filter.setup({
Expand All @@ -97,10 +100,13 @@ export class DataPlugin implements Plugin<DataSetup, DataStart, DataPluginSetupD
query: this.query.setup(),
search: this.search.setup(savedObjectsClient),
};

return this.setupApi;
}

public start(core: CoreStart, plugins: DataPluginStartDependencies) {
return {
...this.setupApi!,
expressions: this.expressions.start({ inspector: plugins.inspector }),
};
}
Expand Down

0 comments on commit 35db65a

Please sign in to comment.