Skip to content

Commit

Permalink
[8.15] [Security Solution] Fix - Unified Timeline Style fixes (elasti…
Browse files Browse the repository at this point in the history
…c#187937) (elastic#188328)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Security Solution] Fix - Unified Timeline Style fixes
(elastic#187937)](elastic#187937)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Jatin
Kathuria","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-11T10:21:56Z","message":"[Security
Solution] Fix - Unified Timeline Style fixes (elastic#187937)\n\n##
Summary\r\n\r\n## Unified Timeline\r\n\r\n### Before
\r\n![issue_unified_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/d60634b8-3f54-4aab-8264-7d20e269077d)\r\n\r\n\r\n###
After\r\n\r\n![Styles_old_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/aa5eb6eb-511b-421a-abb4-fed7e5c93cd1)\r\n\r\n##
Old Timeline\r\n\r\n###
Before\r\n\r\n![issue_old_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/9719af8d-9485-4673-a9b7-dcc1028e8a66)\r\n\r\n###
After\r\n\r\n![Styles_old_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/1f9b2c76-2dc5-4de4-b1f5-a09fdada550c)\r\n\r\n##
Row Renderers\r\n\r\n###
Before\r\n\r\n![grafik](https://github.com/elastic/kibana/assets/7485038/9ddf057c-2a04-4f7e-9ba7-8940683e059d)\r\n\r\n###
After\r\n\r\n![grafik](https://github.com/elastic/kibana/assets/7485038/c6628a7c-f07e-4a04-843c-7a7e220243dc)\r\n\r\n##
Stripes patterns in row renderer\r\n\r\nNotice the color changes to grow
for the same row when `Row Renderer` is\r\nswitched.\r\n\r\n###
Before\r\n\r\n![styles_row_renderer_switch_stripes_fixed\r\nmov](https://github.com/elastic/kibana/assets/7485038/0d356771-1562-42aa-8256-de29c6879cd4)\r\n\r\n\r\n###
After\r\n\r\n![styles_row_renderer_switch_stripes\r\nmov](https://github.com/elastic/kibana/assets/7485038/95d32feb-9a1f-40f0-9574-db2770980a05)","sha":"092e57408f560be1b4bfdfe7d50ffbc9abe25953","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","Feature:Timeline","Team:Threat
Hunting:Investigations","v8.15.0","v8.16.0"],"number":187937,"url":"https://github.com/elastic/kibana/pull/187937","mergeCommit":{"message":"[Security
Solution] Fix - Unified Timeline Style fixes (elastic#187937)\n\n##
Summary\r\n\r\n## Unified Timeline\r\n\r\n### Before
\r\n![issue_unified_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/d60634b8-3f54-4aab-8264-7d20e269077d)\r\n\r\n\r\n###
After\r\n\r\n![Styles_old_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/aa5eb6eb-511b-421a-abb4-fed7e5c93cd1)\r\n\r\n##
Old Timeline\r\n\r\n###
Before\r\n\r\n![issue_old_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/9719af8d-9485-4673-a9b7-dcc1028e8a66)\r\n\r\n###
After\r\n\r\n![Styles_old_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/1f9b2c76-2dc5-4de4-b1f5-a09fdada550c)\r\n\r\n##
Row Renderers\r\n\r\n###
Before\r\n\r\n![grafik](https://github.com/elastic/kibana/assets/7485038/9ddf057c-2a04-4f7e-9ba7-8940683e059d)\r\n\r\n###
After\r\n\r\n![grafik](https://github.com/elastic/kibana/assets/7485038/c6628a7c-f07e-4a04-843c-7a7e220243dc)\r\n\r\n##
Stripes patterns in row renderer\r\n\r\nNotice the color changes to grow
for the same row when `Row Renderer` is\r\nswitched.\r\n\r\n###
Before\r\n\r\n![styles_row_renderer_switch_stripes_fixed\r\nmov](https://github.com/elastic/kibana/assets/7485038/0d356771-1562-42aa-8256-de29c6879cd4)\r\n\r\n\r\n###
After\r\n\r\n![styles_row_renderer_switch_stripes\r\nmov](https://github.com/elastic/kibana/assets/7485038/95d32feb-9a1f-40f0-9574-db2770980a05)","sha":"092e57408f560be1b4bfdfe7d50ffbc9abe25953"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187937","number":187937,"mergeCommit":{"message":"[Security
Solution] Fix - Unified Timeline Style fixes (elastic#187937)\n\n##
Summary\r\n\r\n## Unified Timeline\r\n\r\n### Before
\r\n![issue_unified_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/d60634b8-3f54-4aab-8264-7d20e269077d)\r\n\r\n\r\n###
After\r\n\r\n![Styles_old_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/aa5eb6eb-511b-421a-abb4-fed7e5c93cd1)\r\n\r\n##
Old Timeline\r\n\r\n###
Before\r\n\r\n![issue_old_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/9719af8d-9485-4673-a9b7-dcc1028e8a66)\r\n\r\n###
After\r\n\r\n![Styles_old_timeline\r\nmov](https://github.com/elastic/kibana/assets/7485038/1f9b2c76-2dc5-4de4-b1f5-a09fdada550c)\r\n\r\n##
Row Renderers\r\n\r\n###
Before\r\n\r\n![grafik](https://github.com/elastic/kibana/assets/7485038/9ddf057c-2a04-4f7e-9ba7-8940683e059d)\r\n\r\n###
After\r\n\r\n![grafik](https://github.com/elastic/kibana/assets/7485038/c6628a7c-f07e-4a04-843c-7a7e220243dc)\r\n\r\n##
Stripes patterns in row renderer\r\n\r\nNotice the color changes to grow
for the same row when `Row Renderer` is\r\nswitched.\r\n\r\n###
Before\r\n\r\n![styles_row_renderer_switch_stripes_fixed\r\nmov](https://github.com/elastic/kibana/assets/7485038/0d356771-1562-42aa-8256-de29c6879cd4)\r\n\r\n\r\n###
After\r\n\r\n![styles_row_renderer_switch_stripes\r\nmov](https://github.com/elastic/kibana/assets/7485038/95d32feb-9a1f-40f0-9574-db2770980a05)","sha":"092e57408f560be1b4bfdfe7d50ffbc9abe25953"}}]}]
BACKPORT-->
  • Loading branch information
logeekal authored Jul 15, 2024
1 parent b29d62e commit 1fadaaf
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
*/

import { noop } from 'lodash/fp';
import { EuiFocusTrap, EuiOutsideClickDetector, EuiScreenReaderOnly } from '@elastic/eui';
import {
EuiFlexGroup,
EuiFocusTrap,
EuiOutsideClickDetector,
EuiScreenReaderOnly,
EuiFlexItem,
} from '@elastic/eui';
import React, { useMemo } from 'react';

import {
Expand Down Expand Up @@ -73,13 +79,15 @@ export const StatefulRowRenderer = ({
<EuiScreenReaderOnly data-test-subj="eventRendererScreenReaderOnly">
<p>{i18n.YOU_ARE_IN_AN_EVENT_RENDERER(ariaRowindex)}</p>
</EuiScreenReaderOnly>
<div onKeyDown={onKeyDown}>
{rowRenderer.renderRow({
data: event.ecs,
isDraggable: true,
scopeId: timelineId,
})}
</div>
<EuiFlexGroup direction="column" onKeyDown={onKeyDown}>
<EuiFlexItem grow={true}>
{rowRenderer.renderRow({
data: event.ecs,
isDraggable: true,
scopeId: timelineId,
})}
</EuiFlexItem>
</EuiFlexGroup>
</EuiFocusTrap>
</EuiOutsideClickDetector>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { ComponentProps, ReactElement } from 'react';
import React, { useEffect, useState, useMemo } from 'react';
import { RootDragDropProvider } from '@kbn/dom-drag-drop';
import { isEmpty } from 'lodash';
import { StyledTableFlexGroup, StyledTableFlexItem } from '../unified_components/styles';
import { StyledTableFlexGroup, StyledUnifiedTableFlexItem } from '../unified_components/styles';
import { UnifiedTimeline } from '../unified_components';
import { defaultUdtHeaders } from '../unified_components/default_headers';
import type { PaginationInputPaginated, TimelineItem } from '../../../../../common/search_strategy';
Expand Down Expand Up @@ -65,8 +65,11 @@ export const UnifiedTimelineBody = (props: UnifiedTimelineBodyProps) => {

return (
<StyledTableFlexGroup direction="column" gutterSize="s">
<StyledTableFlexItem grow={false}>{header}</StyledTableFlexItem>
<StyledTableFlexItem className="unifiedTimelineBody" data-test-subj="unifiedTimelineBody">
<StyledUnifiedTableFlexItem grow={false}>{header}</StyledUnifiedTableFlexItem>
<StyledUnifiedTableFlexItem
className="unifiedTimelineBody"
data-test-subj="unifiedTimelineBody"
>
<RootDragDropProvider>
<UnifiedTimeline
columns={columnsHeader}
Expand All @@ -91,7 +94,7 @@ export const UnifiedTimelineBody = (props: UnifiedTimelineBodyProps) => {
leadingControlColumns={leadingControlColumns}
/>
</RootDragDropProvider>
</StyledTableFlexItem>
</StyledUnifiedTableFlexItem>
</StyledTableFlexGroup>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -285,31 +285,29 @@ export const EqlTabContentComponent: React.FC<Props> = ({
</InPortal>
{NotesFlyoutMemo}
<FullWidthFlexGroup>
<ScrollableFlexItem grow={2}>
<UnifiedTimelineBody
header={unifiedHeader}
columns={augmentedColumnHeaders}
isSortEnabled={false}
rowRenderers={rowRenderers}
timelineId={timelineId}
itemsPerPage={itemsPerPage}
itemsPerPageOptions={itemsPerPageOptions}
sort={TIMELINE_NO_SORTING}
events={events}
refetch={refetch}
dataLoadingState={dataLoadingState}
totalCount={isBlankTimeline ? 0 : totalCount}
onEventClosed={onEventClosed}
expandedDetail={expandedDetail}
showExpandedDetails={showExpandedDetails}
onChangePage={loadPage}
activeTab={activeTab}
updatedAt={refreshedAt}
isTextBasedQuery={false}
pageInfo={pageInfo}
leadingControlColumns={leadingControlColumns as EuiDataGridControlColumn[]}
/>
</ScrollableFlexItem>
<UnifiedTimelineBody
header={unifiedHeader}
columns={augmentedColumnHeaders}
isSortEnabled={false}
rowRenderers={rowRenderers}
timelineId={timelineId}
itemsPerPage={itemsPerPage}
itemsPerPageOptions={itemsPerPageOptions}
sort={TIMELINE_NO_SORTING}
events={events}
refetch={refetch}
dataLoadingState={dataLoadingState}
totalCount={isBlankTimeline ? 0 : totalCount}
onEventClosed={onEventClosed}
expandedDetail={expandedDetail}
showExpandedDetails={showExpandedDetails}
onChangePage={loadPage}
activeTab={activeTab}
updatedAt={refreshedAt}
isTextBasedQuery={false}
pageInfo={pageInfo}
leadingControlColumns={leadingControlColumns as EuiDataGridControlColumn[]}
/>
</FullWidthFlexGroup>
</>
) : (
Expand All @@ -325,14 +323,9 @@ export const EqlTabContentComponent: React.FC<Props> = ({
loading={isQueryLoading}
refetch={refetch}
/>
<FullWidthFlexGroup>
<ScrollableFlexItem grow={2}>
<EqlTabHeader
activeTab={activeTab}
setTimelineFullScreen={setTimelineFullScreen}
timelineFullScreen={timelineFullScreen}
timelineId={timelineId}
/>
<FullWidthFlexGroup gutterSize="s" direction="column">
<ScrollableFlexItem grow={false}>{unifiedHeader}</ScrollableFlexItem>
<ScrollableFlexItem grow={true}>
<EventDetailsWidthProvider>
<StyledEuiFlyoutBody
data-test-subj={`${TimelineTabs.eql}-tab-flyout-body`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import styled from 'styled-components';

export const TabHeaderContainer = styled.div`
margin-top: ${(props) => props.theme.eui.euiSizeS};
width: 100%;
`;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const CustomDataGridSingleRow = memo(function CustomDataGridSingleRow(

return (
<CustomGridRow
className={`${rowIndex % 2 === 0 ? 'euiDataGridRow--striped' : ''}`}
className={`${rowIndex % 2 !== 0 ? 'euiDataGridRow--striped' : ''}`}
$cssRowHeight={cssRowHeight}
key={rowIndex}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const StyledTableFlexGroup = styled(EuiFlexGroup).attrs(({ className = ''
}
`;

export const StyledTableFlexItem = styled(EuiFlexItem).attrs(({ className = '' }) => ({
export const StyledUnifiedTableFlexItem = styled(EuiFlexItem).attrs(({ className = '' }) => ({
className: `${className}`,
}))`
${({ theme }) => `margin: 0 ${theme.eui.euiSizeM};`}
Expand Down

0 comments on commit 1fadaaf

Please sign in to comment.