forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick security/timelines changes
- Loading branch information
1 parent
36c614a
commit 86aa348
Showing
28 changed files
with
317 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...gins/security_solution/public/timelines/components/timeline/session_tab_content/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
import React, { useMemo } from 'react'; | ||
import styled from 'styled-components'; | ||
import { timelineSelectors } from '../../../store/timeline'; | ||
import { useKibana } from '../../../../common/lib/kibana'; | ||
import { TimelineId } from '../../../../../common/types/timeline'; | ||
import { timelineDefaults } from '../../../../timelines/store/timeline/defaults'; | ||
import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; | ||
|
||
const FullWidthFlexGroup = styled(EuiFlexGroup)` | ||
margin: 0; | ||
width: 100%; | ||
overflow: hidden; | ||
`; | ||
|
||
const ScrollableFlexItem = styled(EuiFlexItem)` | ||
${({ theme }) => `margin: 0 ${theme.eui.euiSizeM};`} | ||
overflow: hidden; | ||
`; | ||
|
||
interface Props { | ||
timelineId: TimelineId; | ||
} | ||
|
||
const SessionTabContent: React.FC<Props> = ({ timelineId }) => { | ||
const { sessionView } = useKibana().services; | ||
|
||
const getTimeline = useMemo(() => timelineSelectors.getTimelineByIdSelector(), []); | ||
|
||
const sessionViewId = useDeepEqualSelector( | ||
(state) => (getTimeline(state, timelineId) ?? timelineDefaults).sessionViewId | ||
); | ||
const sessionViewMain = useMemo(() => { | ||
return sessionViewId !== null ? sessionView.getSessionView(sessionViewId) : null; | ||
}, [sessionView, sessionViewId]); | ||
|
||
return <ScrollableFlexItem grow={2}>{sessionViewMain}</ScrollableFlexItem>; | ||
}; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default SessionTabContent; |
Oops, something went wrong.