From 6340339d1b667e5b6c94093eb0b675ff308058c5 Mon Sep 17 00:00:00 2001 From: Michael Olorunnisola Date: Tue, 12 Apr 2022 09:09:40 -0400 Subject: [PATCH 1/5] fix error referring to rule --- .../public/timelines/components/open_timeline/translations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/translations.ts b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/translations.ts index b14177b066feb..9c540f54c3824 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/translations.ts +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/translations.ts @@ -379,7 +379,7 @@ export const IMPORT_FAILED = (totalTimelines: number) => { values: { totalTimelines }, defaultMessage: - 'Failed to import {totalTimelines} {totalTimelines, plural, =1 {rule} other {rules}}', + 'Failed to import {totalTimelines} {totalTimelines, plural, =1 {timeline} other {timelines}}', } ); From fd3f837da9016420f7b9e67631400ea94f76c5c2 Mon Sep 17 00:00:00 2001 From: Michael Olorunnisola Date: Tue, 12 Apr 2022 10:44:29 -0400 Subject: [PATCH 2/5] remove stack by x --- .../detections/components/alerts_kpis/common/components.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/components.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/components.tsx index 27f33409ae1a5..a72746f729ad5 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/components.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/components.tsx @@ -64,6 +64,7 @@ export const StackByComboBox: React.FC = ({ selected, onSe placeholder={i18n.STACK_BY_PLACEHOLDER} prepend={i18n.STACK_BY_LABEL} singleSelection={singleSelection} + isClearable={false} sortMatchesBy="startsWith" options={stackOptions} selectedOptions={selectedOptions} From e797f9d6a76f3b3ef3e17e40a7a87597df698a93 Mon Sep 17 00:00:00 2001 From: Michael Olorunnisola Date: Tue, 12 Apr 2022 15:23:21 -0400 Subject: [PATCH 3/5] fix hover actions --- .../event_details/overview/overview_card.tsx | 41 ++++++++++++++++--- .../event_details/table/action_cell.tsx | 5 ++- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/overview/overview_card.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/overview/overview_card.tsx index d3cf8c3840497..34890fab71145 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/overview/overview_card.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/overview/overview_card.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiPanel, EuiSpacer, EuiText } from '@elastic/eui'; -import React from 'react'; +import React, { useState } from 'react'; import { ActionCell } from '../table/action_cell'; import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; @@ -19,7 +19,9 @@ const ActionWrapper = euiStyled.div` margin-left: ${({ theme }) => theme.eui.paddingSizes.s}; `; -const OverviewPanel = euiStyled(EuiPanel)` +const OverviewPanel = euiStyled(EuiPanel)<{ + $isPopoverVisible: boolean; +}>` &&& { background-color: ${({ theme }) => theme.eui.euiColorLightestShade}; padding: ${({ theme }) => theme.eui.paddingSizes.s}; @@ -45,15 +47,35 @@ const OverviewPanel = euiStyled(EuiPanel)` transform: translate(0); } } + + ${(props) => + props.$isPopoverVisible && + ` + & ${ActionWrapper} { + width: auto; + transform: translate(0); + } + `} } `; interface OverviewCardProps { + isPopoverVisible: boolean; // Prevent the hover actions from collapsing on each other when not directly hovered on title: string; } -export const OverviewCard: React.FC = ({ title, children }) => ( - +export const OverviewCard: React.FC = ({ + title, + children, + isPopoverVisible, +}) => ( + {title} {children} @@ -85,13 +107,20 @@ export const OverviewCardWithActions: React.FC = ( dataTestSubj, enrichedFieldInfo, }) => { + const [isPopoverVisisble, setIsPopoverVisible] = useState(false); + return ( - + {children} - + diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/table/action_cell.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/table/action_cell.tsx index 523b56e9ecf76..a223b49b5558c 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/table/action_cell.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/table/action_cell.tsx @@ -18,6 +18,7 @@ interface Props extends EnrichedFieldInfo { disabled?: boolean; getLinkValue?: (field: string) => string | null; onFilterAdded?: () => void; + setIsPopoverVisible?: (isVisible: boolean) => void; toggleColumn?: (column: ColumnHeaderOptions) => void; hideAddToTimeline?: boolean; } @@ -32,6 +33,7 @@ export const ActionCell: React.FC = React.memo( getLinkValue, linkValue, onFilterAdded, + setIsPopoverVisible, timelineId, toggleColumn, values, @@ -55,9 +57,10 @@ export const ActionCell: React.FC = React.memo( const toggleTopN = useCallback(() => { setShowTopN((prevShowTopN) => { const newShowTopN = !prevShowTopN; + if (setIsPopoverVisible) setIsPopoverVisible(newShowTopN); return newShowTopN; }); - }, []); + }, [setIsPopoverVisible]); const closeTopN = useCallback(() => { setShowTopN(false); From fd1d4fb5296727ebf8c266cbbc266fa6532269d4 Mon Sep 17 00:00:00 2001 From: Michael Olorunnisola Date: Tue, 12 Apr 2022 15:37:04 -0400 Subject: [PATCH 4/5] fix hover actions legend --- .../security_solution/public/resolver/view/graph_controls.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/resolver/view/graph_controls.tsx b/x-pack/plugins/security_solution/public/resolver/view/graph_controls.tsx index 570f444814d7f..68222ce8cd9e7 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/graph_controls.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/graph_controls.tsx @@ -370,7 +370,7 @@ const SchemaInformation = ({
Date: Tue, 12 Apr 2022 16:18:44 -0400 Subject: [PATCH 5/5] make prop optional --- .../components/event_details/overview/overview_card.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/overview/overview_card.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/overview/overview_card.tsx index 34890fab71145..0d0803f41c34b 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/overview/overview_card.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/overview/overview_card.tsx @@ -60,14 +60,14 @@ const OverviewPanel = euiStyled(EuiPanel)<{ `; interface OverviewCardProps { - isPopoverVisible: boolean; // Prevent the hover actions from collapsing on each other when not directly hovered on + isPopoverVisible?: boolean; // Prevent the hover actions from collapsing on each other when not directly hovered on title: string; } export const OverviewCard: React.FC = ({ title, children, - isPopoverVisible, + isPopoverVisible = false, // default to false as this behavior is only really necessary in the situation without an overflow }) => (