-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Logs] Use central log sources setting in Logs Explorer as the default data source #190438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
aba77bb
be04649
b3888fc
e3ec958
4bd8618
c46cb1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,12 @@ import { getDevToolsOptions } from '@kbn/xstate-utils'; | |
| import equal from 'fast-deep-equal'; | ||
| import { distinctUntilChanged, from, map, shareReplay, Subject } from 'rxjs'; | ||
| import { interpret } from 'xstate'; | ||
| import { AllDatasetSelection } from '../../common'; | ||
| import { DatasetsService } from '../services/datasets'; | ||
| import { createLogsExplorerControllerStateMachine } from '../state_machines/logs_explorer_controller'; | ||
| import { | ||
| createLogsExplorerControllerStateMachine, | ||
| DEFAULT_CONTEXT, | ||
| } from '../state_machines/logs_explorer_controller'; | ||
| import { LogsExplorerStartDeps } from '../types'; | ||
| import { LogsExplorerCustomizations } from '../customizations/types'; | ||
| import { createDataServiceProxy } from './custom_data_service'; | ||
|
|
@@ -33,7 +37,7 @@ interface Dependencies { | |
| plugins: LogsExplorerStartDeps; | ||
| } | ||
|
|
||
| type InitialState = LogsExplorerPublicStateUpdate; | ||
| type InitialState = LogsExplorerPublicStateUpdate & { allSelection?: AllDatasetSelection }; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intersection here so that |
||
|
|
||
| export const createLogsExplorerControllerFactory = | ||
| ({ core, plugins }: Dependencies) => | ||
|
|
@@ -66,15 +70,19 @@ export const createLogsExplorerControllerFactory = | |
| timefilter: customData.query.timefilter.timefilter, | ||
| urlStateStorage: customMemoryUrlStateStorage, | ||
| }; | ||
| const allSelection = initialState?.allSelection ?? DEFAULT_CONTEXT.allSelection; | ||
|
|
||
| const initialContext = getContextFromPublicState(initialState ?? {}); | ||
| const initialContext = getContextFromPublicState(initialState ?? {}, allSelection); | ||
| const publicEvents$ = new Subject<LogsExplorerPublicEvent>(); | ||
|
|
||
| const machine = createLogsExplorerControllerStateMachine({ | ||
| datasetsClient, | ||
| dataViews, | ||
| events: customizations.events, | ||
| initialContext, | ||
| initialContext: { | ||
| ...initialContext, | ||
| allSelection, | ||
| }, | ||
| query: discoverServices.data.query, | ||
| toasts: core.notifications.toasts, | ||
| uiSettings: customUiSettings, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import { AllDatasetSelection } from '../../../../common'; | ||
|
|
||
| export const DEFAULT_ALL_SELECTION = AllDatasetSelection.create({ indices: 'logs-*-*' }); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is in it's own file to make sure there aren't bundle size explosions from |
||
Uh oh!
There was an error while loading. Please reload this page.