mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fix missing Overlays service. (#60474)
This commit is contained in:
parent
afae0da83a
commit
2eb7208d5e
2 changed files with 26 additions and 8 deletions
|
@ -23,8 +23,10 @@ import { DataPublicPluginStart } from '../../../../plugins/data/public';
|
|||
|
||||
import {
|
||||
setFieldFormats,
|
||||
setNotifications,
|
||||
setHttp,
|
||||
setIndexPatterns,
|
||||
setNotifications,
|
||||
setOverlays,
|
||||
setQueryService,
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
} from '../../../../plugins/data/public/services';
|
||||
|
@ -60,12 +62,17 @@ export class DataPlugin implements Plugin<void, DataStart, {}, DataPluginStartDe
|
|||
public setup(core: CoreSetup) {}
|
||||
|
||||
public start(core: CoreStart, { data }: DataPluginStartDependencies): DataStart {
|
||||
// This is required for when Angular code uses Field and FieldList.
|
||||
setFieldFormats(data.fieldFormats);
|
||||
setQueryService(data.query);
|
||||
setIndexPatterns(data.indexPatterns);
|
||||
setFieldFormats(data.fieldFormats);
|
||||
/**
|
||||
* We need to call all of the same setters in the legacy world, because instances
|
||||
* set in the new platform `data/public/services` are not accessible in legacy.
|
||||
* This can cause legacy code which relies on services utilizing these to fail.
|
||||
*/
|
||||
setHttp(core.http);
|
||||
setNotifications(core.notifications);
|
||||
setOverlays(core.overlays);
|
||||
setFieldFormats(data.fieldFormats);
|
||||
setIndexPatterns(data.indexPatterns);
|
||||
setQueryService(data.query);
|
||||
|
||||
return {
|
||||
search: this.search.start(core),
|
||||
|
|
|
@ -32,7 +32,14 @@ import { FieldFormatsService } from './field_formats_provider';
|
|||
import { QueryService } from './query';
|
||||
import { createIndexPatternSelect } from './ui/index_pattern_select';
|
||||
import { IndexPatterns } from './index_patterns';
|
||||
import { setNotifications, setFieldFormats, setOverlays, setIndexPatterns } from './services';
|
||||
import {
|
||||
setFieldFormats,
|
||||
setHttp,
|
||||
setIndexPatterns,
|
||||
setNotifications,
|
||||
setOverlays,
|
||||
setQueryService,
|
||||
} from './services';
|
||||
import { createFilterAction, GLOBAL_APPLY_FILTER_ACTION } from './actions';
|
||||
import { APPLY_FILTER_TRIGGER } from '../../embeddable/public';
|
||||
import { createSearchBar } from './ui/search_bar/create_search_bar';
|
||||
|
@ -72,6 +79,7 @@ export class DataPublicPlugin implements Plugin<DataPublicPluginSetup, DataPubli
|
|||
public start(core: CoreStart, { uiActions }: DataStartDependencies): DataPublicPluginStart {
|
||||
const { uiSettings, http, notifications, savedObjects, overlays } = core;
|
||||
const fieldFormats = this.fieldFormatsService.start();
|
||||
setHttp(http);
|
||||
setNotifications(notifications);
|
||||
setFieldFormats(fieldFormats);
|
||||
setOverlays(overlays);
|
||||
|
@ -79,6 +87,9 @@ export class DataPublicPlugin implements Plugin<DataPublicPluginSetup, DataPubli
|
|||
const indexPatternsService = new IndexPatterns(uiSettings, savedObjects.client, http);
|
||||
setIndexPatterns(indexPatternsService);
|
||||
|
||||
const queryService = this.queryService.start(core.savedObjects);
|
||||
setQueryService(queryService);
|
||||
|
||||
uiActions.attachAction(APPLY_FILTER_TRIGGER, GLOBAL_APPLY_FILTER_ACTION);
|
||||
|
||||
const dataServices = {
|
||||
|
@ -86,7 +97,7 @@ export class DataPublicPlugin implements Plugin<DataPublicPluginSetup, DataPubli
|
|||
getSuggestions: getSuggestionsProvider(core.uiSettings, core.http),
|
||||
search: this.searchService.start(core),
|
||||
fieldFormats,
|
||||
query: this.queryService.start(core.savedObjects),
|
||||
query: queryService,
|
||||
indexPatterns: indexPatternsService,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue