Skip to content

Commit

Permalink
[8.7] [Fleet] Fix logs useless rerender (#155305) (#155310)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.7`:
- [[Fleet] Fix logs useless rerender
(#155305)](#155305)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-04-19T19:02:51Z","message":"[Fleet]
Fix logs useless rerender
(#155305)","sha":"befd429f4f70eb332b52e0a331b8e167ba0369f4","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Fleet","backport:prev-minor","v8.8.0"],"number":155305,"url":"https://github.com/elastic/kibana/pull/155305","mergeCommit":{"message":"[Fleet]
Fix logs useless rerender
(#155305)","sha":"befd429f4f70eb332b52e0a331b8e167ba0369f4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155305","number":155305,"mergeCommit":{"message":"[Fleet]
Fix logs useless rerender
(#155305)","sha":"befd429f4f70eb332b52e0a331b8e167ba0369f4"}}]}]
BACKPORT-->

Co-authored-by: Nicolas Chaulet <[email protected]>
  • Loading branch information
kibanamachine and nchaulet authored Apr 19, 2023
1 parent 598b3ef commit 5b805ac
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import semverCoerce from 'semver/functions/coerce';
import { createStateContainerReactHelpers } from '@kbn/kibana-utils-plugin/public';
import { RedirectAppLinks } from '@kbn/kibana-react-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import { LogStream } from '@kbn/infra-plugin/public';
import { LogStream, type LogStreamProps } from '@kbn/infra-plugin/public';

import type { Agent, AgentPolicy } from '../../../../../types';
import { useLink, useStartServices } from '../../../../../hooks';
Expand All @@ -50,6 +50,11 @@ const DatePickerFlexItem = styled(EuiFlexItem)`
max-width: 312px;
`;

const LOG_VIEW_SETTINGS: LogStreamProps['logView'] = {
type: 'log-view-reference',
logViewId: 'default',
};

export interface AgentLogsProps {
agent: Agent;
agentPolicy?: AgentPolicy;
Expand Down Expand Up @@ -350,7 +355,7 @@ export const AgentLogsUI: React.FunctionComponent<AgentLogsProps> = memo(
<EuiFlexItem>
<EuiPanel paddingSize="none" panelRef={logsPanelRef} grow={false}>
<LogStream
logView={{ type: 'log-view-reference', logViewId: 'default' }}
logView={LOG_VIEW_SETTINGS}
height={logPanelHeight}
startTimestamp={dateRangeTimestamps.start}
endTimestamp={dateRangeTimestamps.end}
Expand Down

0 comments on commit 5b805ac

Please sign in to comment.