Skip to content

Commit

Permalink
Fix logs stream link-to
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Mar 24, 2020
1 parent 1ce87d8 commit 2613bdd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,7 @@ export const replaceLogPositionInQueryString = (time: number) =>
time,
tiebreaker: 0,
},
end: new Date(time + ONE_HOUR).toISOString(),
start: new Date(time - ONE_HOUR).toISOString(),
streamLive: false,
});
3 changes: 1 addition & 2 deletions x-pack/plugins/infra/public/pages/link_to/link_to_logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export const LinkToLogsPage: React.FC<LinkToPageProps> = props => {
path={`${props.match.url}/:sourceId?/:nodeType(${ITEM_TYPES})-logs/:nodeId`}
component={RedirectToNodeLogs}
/>
<Route path={`${props.match.url}/:sourceId?/stream`} component={RedirectToLogs} />
<Redirect from={`${props.match.url}/logs`} to={`/link-to/stream?${props.location.search}`} />
<Route path={`${props.match.url}/:sourceId?`} component={RedirectToLogs} />
<Redirect to="/" />
</Switch>
);
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/infra/link_to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
it('redirects to the logs app and parses URL search params correctly', async () => {
const location = {
hash: '',
pathname: '/link-to/logs',
pathname: '/link-to',
search: `time=${timestamp}&filter=trace.id:${traceId}`,
state: undefined,
};
Expand Down

0 comments on commit 2613bdd

Please sign in to comment.