Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIEM] Fix Timeline footer styling #59587

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
47e1d66
[SIEM] Timeline foot styles
patrykkopycinski Mar 6, 2020
70a89b3
Merge branch 'master' of github.com:elastic/kibana into fix/siem-time…
patrykkopycinski Mar 6, 2020
9112822
use euiflyoutfooter
patrykkopycinski Mar 6, 2020
555e261
cleanup
patrykkopycinski Mar 6, 2020
04efb97
Merge branch 'master' of github.com:elastic/kibana into fix/siem-time…
patrykkopycinski Mar 7, 2020
d169380
cleanup
patrykkopycinski Mar 8, 2020
316b4e4
fix tests
patrykkopycinski Mar 9, 2020
01f843e
cleanup
patrykkopycinski Mar 9, 2020
6baefc0
styling
patrykkopycinski Mar 9, 2020
f07ad6a
fix types
patrykkopycinski Mar 9, 2020
f49e250
callback
patrykkopycinski Mar 9, 2020
500239c
snapshot
patrykkopycinski Mar 9, 2020
b343cac
fix translation file
patrykkopycinski Mar 9, 2020
67780cc
cleanup
patrykkopycinski Mar 9, 2020
ccbafc2
Merge branch 'master' of github.com:elastic/kibana into fix/siem-time…
patrykkopycinski Mar 9, 2020
2b3562c
WIP
patrykkopycinski Mar 10, 2020
3f018d6
Merge branch 'master' of github.com:elastic/kibana into fix/siem-time…
patrykkopycinski Mar 10, 2020
58a4024
cleanup
patrykkopycinski Mar 10, 2020
283a79e
Merge branch 'master' of github.com:elastic/kibana into fix/siem-time…
patrykkopycinski Mar 10, 2020
72d49f7
cleanup
patrykkopycinski Mar 10, 2020
a0bec9a
Merge branch 'master' of github.com:elastic/kibana into fix/siem-time…
patrykkopycinski Mar 10, 2020
b52d55f
fix for FF and Safari
patrykkopycinski Mar 10, 2020
6478f6d
WIP
patrykkopycinski Mar 11, 2020
d1445d9
fix FF
patrykkopycinski Mar 11, 2020
bff2029
remove unnecessary changes from yarn.lock
patrykkopycinski Mar 11, 2020
9843a1f
update snapshot
patrykkopycinski Mar 11, 2020
97a73e2
PR comments
patrykkopycinski Mar 11, 2020
129bb4e
fix unnecessary rerenders
patrykkopycinski Mar 11, 2020
b62f127
Merge branch 'master' of github.com:elastic/kibana into fix/siem-time…
patrykkopycinski Mar 11, 2020
79c4874
Merge branch 'master' of github.com:elastic/kibana into fix/siem-time…
patrykkopycinski Mar 12, 2020
ff46c1f
Fix Events load more
patrykkopycinski Mar 12, 2020
5e269d4
Merge branch 'master' of github.com:elastic/kibana into fix/siem-time…
patrykkopycinski Mar 13, 2020
581952d
Fix resize issue on FF
patrykkopycinski Mar 13, 2020
b2dd107
FIx Timeline event note size
patrykkopycinski Mar 14, 2020
b86ca0e
Fix types
patrykkopycinski Mar 14, 2020
415dcf6
Merge branch 'master' into fix/siem-timeline-footer-styles
elasticmachine Mar 15, 2020
fde205c
Merge branch 'master' into fix/siem-timeline-footer-styles
elasticmachine Mar 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ const EventsViewerComponent: React.FC<Props> = ({
getUpdatedAt={getUpdatedAt}
hasNextPage={getOr(false, 'hasNextPage', pageInfo)!}
height={footerHeight}
isEventViewer={true}
isLive={isLive}
isLoading={loading}
itemsCount={events.length}
Expand Down
37 changes: 29 additions & 8 deletions x-pack/legacy/plugins/siem/public/components/flyout/pane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { EuiButtonIcon, EuiFlyout, EuiFlyoutBody, EuiFlyoutHeader, EuiToolTip } from '@elastic/eui';
import { EuiButtonIcon, EuiFlyout, EuiFlyoutHeader, EuiToolTip } from '@elastic/eui';
import React, { useCallback, useState } from 'react';
import { connect, ConnectedProps } from 'react-redux';
import styled from 'styled-components';
Expand Down Expand Up @@ -46,13 +46,31 @@ const EuiFlyoutContainer = styled.div<{ headerHeight: number }>`
overflow: hidden;
padding: 5px 0 0 10px;
}

.timeline-flyout-body {
overflow-y: hidden;
padding: 0;
padding: 0 10px 0 12px;

.euiFlyoutBody__overflow {
overflow: hidden;
}

.euiFlyoutBody__overflowContent {
padding: 0;
height: 100%;
display: flex;
flex-direction: column;

> div:first-child {
flex: 0;
}
}
}

.timeline-flyout-footer {
background: none;
padding: 0 10px 0 12px;
}
`;

const FlyoutHeaderContainer = styled.div`
Expand All @@ -68,6 +86,11 @@ const WrappedCloseButton = styled.div`
margin-right: 5px;
`;

const StyledResizable = styled(Resizable)`
display: flex;
flex-direction: column;
`;

const FlyoutHeaderWithCloseButtonComponent: React.FC<{
onClose: () => void;
timelineId: string;
Expand Down Expand Up @@ -136,11 +159,11 @@ const FlyoutPaneComponent: React.FC<Props> = ({
onClose={onClose}
size="l"
>
<Resizable
<StyledResizable
enable={{ left: true }}
defaultSize={{
width,
height: 'auto',
height: '100%',
}}
minWidth={minWidthPixels}
maxWidth={`${maxWidthPercent}vw`}
Expand All @@ -163,10 +186,8 @@ const FlyoutPaneComponent: React.FC<Props> = ({
usersViewing={usersViewing}
/>
</EuiFlyoutHeader>
<EuiFlyoutBody data-test-subj="eui-flyout-body" className="timeline-flyout-body">
{children}
</EuiFlyoutBody>
</Resizable>
{children}
</StyledResizable>
</EuiFlyout>
</EuiFlyoutContainer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export const PageHeader = styled.div`
PageHeader.displayName = 'PageHeader';

export const FooterContainer = styled.div`
flex: 0;
bottom: 0;
color: #666;
left: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export interface BodyProps {
columnRenderers: ColumnRenderer[];
data: TimelineItem[];
getNotesByIds: (noteIds: string[]) => Note[];
height: number;
id: string;
isEventViewer?: boolean;
isSelectAllChecked: boolean;
Expand Down Expand Up @@ -72,7 +71,6 @@ export const Body = React.memo<BodyProps>(
data,
eventIdToNoteIds,
getNotesByIds,
height,
id,
isEventViewer = false,
isSelectAllChecked,
Expand Down Expand Up @@ -112,7 +110,7 @@ export const Body = React.memo<BodyProps>(

return (
<>
<TimelineBody data-test-subj="timeline-body" bodyHeight={height} ref={containerElementRef}>
<TimelineBody data-test-subj="timeline-body" ref={containerElementRef}>
<EventsTable
data-test-subj="events-table"
// Passing the styles directly to the component because the width is being calculated and is recommended by Styled Components for performance: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ interface OwnProps {
data: TimelineItem[];
id: string;
isEventViewer?: boolean;
height: number;
sort: Sort;
toggleColumn: (column: ColumnHeaderOptions) => void;
}
Expand All @@ -57,7 +56,6 @@ const StatefulBodyComponent = React.memo<StatefulBodyComponentProps>(
columnHeaders,
data,
eventIdToNoteIds,
height,
id,
isEventViewer = false,
isSelectAllChecked,
Expand Down Expand Up @@ -165,7 +163,6 @@ const StatefulBodyComponent = React.memo<StatefulBodyComponentProps>(
data={data}
eventIdToNoteIds={eventIdToNoteIds}
getNotesByIds={getNotesByIds}
height={height}
id={id}
isEventViewer={isEventViewer}
isSelectAllChecked={isSelectAllChecked}
Expand Down Expand Up @@ -196,7 +193,6 @@ const StatefulBodyComponent = React.memo<StatefulBodyComponentProps>(
prevProps.data === nextProps.data &&
prevProps.eventIdToNoteIds === nextProps.eventIdToNoteIds &&
prevProps.notesById === nextProps.notesById &&
prevProps.height === nextProps.height &&
prevProps.id === nextProps.id &&
prevProps.isEventViewer === nextProps.isEventViewer &&
prevProps.isSelectAllChecked === nextProps.isSelectAllChecked &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ const FixedWidthLastUpdated = styled.div<{ compact: boolean }>`
FixedWidthLastUpdated.displayName = 'FixedWidthLastUpdated';

const FooterContainer = styled(EuiFlexGroup)<{ height: number }>`
height: ${({ height }) => height}px;
/* height: ${({ height }) => height}px; */
flex: 0;
height: 40px;
`;

FooterContainer.displayName = 'FooterContainer';

const FooterFlexGroup = styled(EuiFlexGroup)`
height: 35px;
padding-bottom: 5px;
width: 100%;
`;

Expand Down Expand Up @@ -177,7 +180,6 @@ interface FooterProps {
getUpdatedAt: () => number;
hasNextPage: boolean;
height: number;
isEventViewer?: boolean;
isLive: boolean;
isLoading: boolean;
itemsCount: number;
Expand All @@ -196,7 +198,6 @@ export const FooterComponent = ({
getUpdatedAt,
hasNextPage,
height,
isEventViewer,
isLive,
isLoading,
itemsCount,
Expand Down Expand Up @@ -345,7 +346,6 @@ export const Footer = React.memo(
prevProps.compact === nextProps.compact &&
prevProps.hasNextPage === nextProps.hasNextPage &&
prevProps.height === nextProps.height &&
prevProps.isEventViewer === nextProps.isEventViewer &&
prevProps.isLive === nextProps.isLive &&
prevProps.isLoading === nextProps.isLoading &&
prevProps.itemsCount === nextProps.itemsCount &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ export const combineQueries = ({
interface CalculateBodyHeightParams {
/** The the height of the flyout container, which is typically the entire "page", not including the standard Kibana navigation */
flyoutHeight?: number;
/** The flyout header typically contains a title and a close button */
flyoutHeaderHeight?: number;
/** All non-body timeline content (i.e. the providers drag and drop area, and the column headers) */
timelineHeaderHeight?: number;
/** Footer content that appears below the body (i.e. paging controls) */
Expand All @@ -166,11 +164,10 @@ interface CalculateBodyHeightParams {

export const calculateBodyHeight = ({
flyoutHeight = 0,
flyoutHeaderHeight = 0,
timelineHeaderHeight = 0,
timelineFooterHeight = 0,
}: CalculateBodyHeightParams): number =>
flyoutHeight - (flyoutHeaderHeight + timelineHeaderHeight + timelineFooterHeight);
flyoutHeight - (timelineHeaderHeight + timelineFooterHeight);

/**
* The CSS class name of a "stateful event", which appears in both
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export const TimelineBodyGlobalStyle = createGlobalStyle`

export const TimelineBody = styled.div.attrs(({ className = '' }) => ({
className: `siemTimeline__body ${className}`,
}))<{ bodyHeight: number }>`
height: ${({ bodyHeight }) => `${bodyHeight}px`};
}))`
overflow: auto;
scrollbar-width: thin;
flex: 1;

&::-webkit-scrollbar {
height: ${({ theme }) => theme.eui.euiScrollBar};
Expand Down
Loading