From 13944fadaea43d050cf68df6d772ff2f71ac1cbb Mon Sep 17 00:00:00 2001 From: Zacqary Adam Xeper Date: Fri, 7 Feb 2020 09:38:51 -0600 Subject: [PATCH] [Logs UI] Set streamLive false in URL state when arriving from link-to (#56329) * [Logs UI] Remove streamLive false from URL state * Force false livestream boolean from link-to * Update type def * Update snapshots * Fix snapshot typo * Fix snapshot again * Fix node test snapshot Co-authored-by: Elastic Machine --- .../logs/log_position/with_log_position_url_state.tsx | 5 +++-- .../infra/public/pages/link_to/redirect_to_logs.test.tsx | 4 ++-- .../public/pages/link_to/redirect_to_node_logs.test.tsx | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/x-pack/legacy/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx b/x-pack/legacy/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx index a877750587be4..221dac95ef5f0 100644 --- a/x-pack/legacy/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx +++ b/x-pack/legacy/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx @@ -16,7 +16,7 @@ import { LogPositionState, LogPositionStateParams } from './log_position_state'; interface LogPositionUrlState { position: LogPositionStateParams['visibleMidpoint'] | undefined; - streamLive?: boolean | undefined; + streamLive: boolean; } export const WithLogPositionUrlState = () => { @@ -81,7 +81,7 @@ const mapToPositionUrlState = (value: any) => ? pickTimeKey(value) : undefined; -const mapToStreamLiveUrlState = (value: any) => (typeof value === 'boolean' ? value : undefined); +const mapToStreamLiveUrlState = (value: any) => (typeof value === 'boolean' ? value : false); export const replaceLogPositionInQueryString = (time: number) => Number.isNaN(time) @@ -91,4 +91,5 @@ export const replaceLogPositionInQueryString = (time: number) => time, tiebreaker: 0, }, + streamLive: false, }); diff --git a/x-pack/legacy/plugins/infra/public/pages/link_to/redirect_to_logs.test.tsx b/x-pack/legacy/plugins/infra/public/pages/link_to/redirect_to_logs.test.tsx index a800b6421c027..a418be01d1ed2 100644 --- a/x-pack/legacy/plugins/infra/public/pages/link_to/redirect_to_logs.test.tsx +++ b/x-pack/legacy/plugins/infra/public/pages/link_to/redirect_to_logs.test.tsx @@ -19,7 +19,7 @@ describe('RedirectToLogs component', () => { expect(component).toMatchInlineSnapshot(` `); }); @@ -33,7 +33,7 @@ describe('RedirectToLogs component', () => { expect(component).toMatchInlineSnapshot(` `); }); diff --git a/x-pack/legacy/plugins/infra/public/pages/link_to/redirect_to_node_logs.test.tsx b/x-pack/legacy/plugins/infra/public/pages/link_to/redirect_to_node_logs.test.tsx index 5fa80c8efee73..2d1f3a32988aa 100644 --- a/x-pack/legacy/plugins/infra/public/pages/link_to/redirect_to_node_logs.test.tsx +++ b/x-pack/legacy/plugins/infra/public/pages/link_to/redirect_to_node_logs.test.tsx @@ -73,7 +73,7 @@ describe('RedirectToNodeLogs component', () => { expect(component).toMatchInlineSnapshot(` `); }); @@ -89,7 +89,7 @@ describe('RedirectToNodeLogs component', () => { expect(component).toMatchInlineSnapshot(` `); });