Skip to content
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

[Logs UI] Use the Unified Search Bar for date range selection #144351

Merged
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3f919b7
Introduce provider for shared KbnUrlStateStorage
weltenwort Nov 1, 2022
8d313da
Introduce a timefilter state storage
weltenwort Nov 1, 2022
12d2ac7
Express TimeKey as a runtime type
weltenwort Nov 1, 2022
7b7dca0
Move out utility function
weltenwort Nov 1, 2022
b3a9437
Refactor log position state to use state container
weltenwort Nov 1, 2022
4215b32
Remove unused files
weltenwort Nov 1, 2022
e2b1a9c
Remove the custom date picker
weltenwort Nov 1, 2022
280b1b1
Throttle update of timestamp for "now" date
weltenwort Nov 1, 2022
e35620f
Remove unused styled component
weltenwort Nov 1, 2022
bf8520d
Fix linter warning about type-only export
weltenwort Nov 2, 2022
a731f88
Relax url state parsing and add some tests
weltenwort Nov 2, 2022
94dab45
Only log state changes in development
weltenwort Nov 3, 2022
7f58b73
Move visible positions into state container
weltenwort Nov 3, 2022
3f3ff76
Add some log position state unit tests
weltenwort Nov 3, 2022
e3a78df
Avoid creating a new history entry on scrolling
weltenwort Nov 3, 2022
2c5e0a9
Merge branch 'main' into logs-unified-search-bar-datepicker
weltenwort Nov 3, 2022
f7998ae
Merge branch 'main' into logs-unified-search-bar-datepicker
weltenwort Nov 4, 2022
0087179
Make page title test more reliable
weltenwort Nov 4, 2022
5bbfdfe
Decouple alerts page tests from log stream state
weltenwort Nov 4, 2022
34242ea
Avoid resetting the refresh interval
weltenwort Nov 4, 2022
325103c
Use redux devtools instead of redux-logger
weltenwort Nov 4, 2022
5dfe7de
Merge branch 'main' into logs-unified-search-bar-datepicker
weltenwort Nov 8, 2022
b8ba64f
Avoid serialization errors with SyntheticEvents
weltenwort Nov 8, 2022
e1ebdb9
Disable redux devtools features requiring dispatch
weltenwort Nov 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/plugins/kibana_utils/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export {
replaceUrlHashQuery,
} from './state_management/url';
export type {
IStateStorage,
IStateSyncConfig,
ISyncStateRef,
IKbnUrlStateStorage,
Expand Down
18 changes: 12 additions & 6 deletions x-pack/plugins/infra/common/time/time_key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@
*/

import { ascending, bisector } from 'd3-array';
import * as rt from 'io-ts';
import { pick } from 'lodash';

export interface TimeKey {
time: number;
tiebreaker: number;
gid?: string;
fromAutoReload?: boolean;
}
export const timeKeyRT = rt.intersection([
rt.type({
time: rt.number,
tiebreaker: rt.number,
}),
rt.partial({
gid: rt.string,
fromAutoReload: rt.boolean,
}),
]);
export type TimeKey = rt.TypeOf<typeof timeKeyRT>;

export interface UniqueTimeKey extends TimeKey {
gid: string;
Expand Down
16 changes: 11 additions & 5 deletions x-pack/plugins/infra/public/apps/logs_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { LogsPage } from '../pages/logs';
import { InfraClientStartDeps, InfraClientStartExports } from '../types';
import { CommonInfraProviders, CoreProviders } from './common_providers';
import { prepareMountElement } from './common_styles';
import { KbnUrlStateStorageFromRouterProvider } from '../utils/kbn_url_state_context';

export const renderApp = (
core: CoreStart,
Expand Down Expand Up @@ -69,11 +70,16 @@ const LogsApp: React.FC<{
triggersActionsUI={plugins.triggersActionsUi}
>
<Router history={history}>
<Switch>
<Route path="/link-to" component={LinkToLogsPage} />
{uiCapabilities?.logs?.show && <Route path="/" component={LogsPage} />}
<Route component={NotFoundPage} />
</Switch>
<KbnUrlStateStorageFromRouterProvider
history={history}
toastsService={core.notifications.toasts}
>
<Switch>
<Route path="/link-to" component={LinkToLogsPage} />
{uiCapabilities?.logs?.show && <Route path="/" component={LogsPage} />}
<Route component={NotFoundPage} />
</Switch>
</KbnUrlStateStorageFromRouterProvider>
</Router>
</CommonInfraProviders>
</CoreProviders>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
*/

export * from './log_position_state';
export * from './with_log_position_url_state';
export * from './replace_log_position_in_query_string';
export * from './use_log_position';
export { LogPositionUrlState } from './use_log_position_url_state_sync';
Loading