Skip to content

Commit

Permalink
[Security Solution][Timeline] Minor side panel fixes (#91691)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelolo24 authored Feb 17, 2021
1 parent a2cd366 commit e095a6a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export const ENDPOINT_POLICY = i18n.translate(
export const POLICY_STATUS = i18n.translate(
'xpack.securitySolution.host.details.endpoint.policyStatus',
{
defaultMessage: 'Configuration Status',
defaultMessage: 'Policy Status',
}
);

export const SENSORVERSION = i18n.translate(
'xpack.securitySolution.host.details.endpoint.sensorversion',
{
defaultMessage: 'Sensorversion',
defaultMessage: 'Sensor Version',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import React from 'react';
import styled from 'styled-components';
import { i18n } from '@kbn/i18n';
import { EuiTitle } from '@elastic/eui';
import { HostDetailsLink } from '../../../../common/components/links';
Expand All @@ -23,14 +24,20 @@ interface ExpandableHostProps {
hostName: string;
}

const StyledTitle = styled.h4`
word-break: break-all;
word-wrap: break-word;
white-space: pre-wrap;
`;

export const ExpandableHostDetailsTitle = ({ hostName }: ExpandableHostProps) => (
<EuiTitle size="s">
<h4>
<StyledTitle>
{i18n.translate('xpack.securitySolution.timeline.sidePanel.hostDetails.title', {
defaultMessage: 'Host details',
})}
{`: ${hostName}`}
</h4>
</StyledTitle>
</EuiTitle>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import { EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import styled from 'styled-components';
import React, { useCallback, useMemo } from 'react';
import { useDispatch } from 'react-redux';
import { FlowTarget } from '../../../../../common/search_strategy';
Expand All @@ -31,14 +32,20 @@ interface ExpandableNetworkProps {
expandedNetwork: { ip: string; flowTarget: FlowTarget };
}

const StyledTitle = styled.h4`
word-break: break-all;
word-wrap: break-word;
white-space: pre-wrap;
`;

export const ExpandableNetworkDetailsTitle = ({ ip }: { ip: string }) => (
<EuiTitle size="s">
<h4>
<StyledTitle>
{i18n.translate('xpack.securitySolution.timeline.sidePanel.networkDetails.title', {
defaultMessage: 'Network details',
})}
{`: ${ip}`}
</h4>
</StyledTitle>
</EuiTitle>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,14 @@ const StatefulEventComponent: React.FC<Props> = ({
}, [event?.data]);

const hostIPAddresses = useMemo(() => {
const ipList = getMappedNonEcsValue({ data: event?.data, fieldName: 'host.ip' });
return ipList;
const hostIpList = getMappedNonEcsValue({ data: event?.data, fieldName: 'host.ip' }) ?? [];
const sourceIpList = getMappedNonEcsValue({ data: event?.data, fieldName: 'source.ip' }) ?? [];
const destinationIpList =
getMappedNonEcsValue({
data: event?.data,
fieldName: 'destination.ip',
}) ?? [];
return new Set([...hostIpList, ...sourceIpList, ...destinationIpList]);
}, [event?.data]);

const activeTab = tabType ?? TimelineTabs.query;
Expand All @@ -123,7 +129,7 @@ const StatefulEventComponent: React.FC<Props> = ({
activeExpandedDetail?.params?.hostName === hostName) ||
(activeExpandedDetail?.panelView === 'networkDetail' &&
activeExpandedDetail?.params?.ip &&
hostIPAddresses?.includes(activeExpandedDetail?.params?.ip)) ||
hostIPAddresses?.has(activeExpandedDetail?.params?.ip)) ||
false;

const getNotesByIds = useMemo(() => appSelectors.notesByIdsSelector(), []);
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -18875,8 +18875,6 @@
"xpack.securitySolution.hooks.useAddToTimeline.addedFieldMessage": "{fieldOrValue}をタイムラインに追加しました",
"xpack.securitySolution.host.details.architectureLabel": "アーキテクチャー",
"xpack.securitySolution.host.details.endpoint.endpointPolicy": "統合",
"xpack.securitySolution.host.details.endpoint.policyStatus": "構成ステータス",
"xpack.securitySolution.host.details.endpoint.sensorversion": "センサーバージョン",
"xpack.securitySolution.host.details.firstSeenTitle": "初回の認識",
"xpack.securitySolution.host.details.lastSeenTitle": "前回の認識",
"xpack.securitySolution.host.details.overview.cloudProviderTitle": "クラウドプロバイダー",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -18921,8 +18921,6 @@
"xpack.securitySolution.hooks.useAddToTimeline.addedFieldMessage": "已将 {fieldOrValue} 添加到时间线",
"xpack.securitySolution.host.details.architectureLabel": "架构",
"xpack.securitySolution.host.details.endpoint.endpointPolicy": "集成",
"xpack.securitySolution.host.details.endpoint.policyStatus": "配置状态",
"xpack.securitySolution.host.details.endpoint.sensorversion": "感应器版本",
"xpack.securitySolution.host.details.firstSeenTitle": "首次看到时间",
"xpack.securitySolution.host.details.lastSeenTitle": "最后看到时间",
"xpack.securitySolution.host.details.overview.cloudProviderTitle": "云服务提供商",
Expand Down

0 comments on commit e095a6a

Please sign in to comment.