From 9911883ba4af3a109700a74f6096192c6ed6336e Mon Sep 17 00:00:00 2001 From: Andrew Goldstein Date: Tue, 26 Oct 2021 09:46:01 -0600 Subject: [PATCH] [Security Solution] Prevents the `Status` badge from stretching in the Alert Details flyout (#116237) ## [Security Solution] Prevents the `Status` badge from stretching in the Alert Details flyout This PR fixes to prevent the `Status` badge from stretching in the Alert Details flyout. ### Screenshots **Before:** ![before](https://user-images.githubusercontent.com/4459398/138806049-895317b6-2990-43f6-b978-dab1711494a5.png) After Chrome `95.0.4638.54`: ![after-chrome](https://user-images.githubusercontent.com/4459398/138806164-ce802982-5c5a-4a30-a906-1583e2ba9939.png) After Firefox `93.0`: ![after-firefox](https://user-images.githubusercontent.com/4459398/138806249-152a6b33-f1b9-4a5b-8607-8da29689d599.png) After Safari `15.0`: ![after-safari](https://user-images.githubusercontent.com/4459398/138806320-45202b3a-1f84-4a4f-8fd0-107523597a22.png) ### Details The fix overrides the default value of `EuiFlexGroup`'s `alignItems` prop, which has a default value of `stretch`, per the image below: ![EuiFlexGroup_alignItems](https://user-images.githubusercontent.com/4459398/138805941-96e06533-8df7-447c-bb74-9278a06d39db.png) --- .../alert_summary_view.test.tsx.snap | 32 +++++++++---------- .../table/field_value_cell.test.tsx | 6 ++++ .../event_details/table/field_value_cell.tsx | 1 + 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/__snapshots__/alert_summary_view.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/event_details/__snapshots__/alert_summary_view.test.tsx.snap index 772badd80ce53..d97208a500714 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/__snapshots__/alert_summary_view.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/event_details/__snapshots__/alert_summary_view.test.tsx.snap @@ -136,7 +136,7 @@ exports[`AlertSummaryView Behavior event code renders additional summary rows 1` class="euiTableCellContent flyoutOverviewDescription euiTableCellContent--overflowingContent" >
{ ); }); + test('it aligns items at the start of the group to prevent content from stretching (by default)', () => { + expect(screen.getByTestId(`event-field-${hostIpData.field}`)).toHaveClass( + 'euiFlexGroup--alignItemsFlexStart' + ); + }); + test('it renders link buttons for each of the host ip addresses', () => { expect(screen.getAllByRole('button').length).toBe(hostIpValues.length); }); diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx index dc6c84b8138fe..0685582b33882 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/table/field_value_cell.tsx @@ -37,6 +37,7 @@ export const FieldValueCell = React.memo( }: FieldValueCellProps) => { return (