Skip to content

Commit 233da45

Browse files
[8.x] [Security Solution][Alert Details] - fix some UI issues related to emotion/css vs emotion/react (#205664) (#205928)
# Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution][Alert Details] - fix some UI issues related to emotion/css vs emotion/react (#205664)](#205664) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Philippe Oberti","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-08T16:00:28Z","message":"[Security Solution][Alert Details] - fix some UI issues related to emotion/css vs emotion/react (#205664)\n\n## Summary\r\n\r\nThis recent [PR](#205011) slightly\r\nbroke the UI in a couple of small places in the alert details flyout.\r\nStrangely, I did review the PR by pulling down the branch, but only\r\nlooked at the places that were impacted by the files modified. The\r\ncouple of places where the UI broke were completely different...\r\nMy guess it is is related to the fact that in those place we were still\r\nusing `@emotion/css` and this might not play nice with some\r\n`styled_components`...\r\n\r\nUpdating those places to use `@emotion/react` fixed the issues!\r\n\r\n| Before fix | After fix |\r\n| ------------- | ------------- |\r\n|\r\n![broken-1](https://github.com/user-attachments/assets/839760db-da3c-4031-b4be-18645b37c089)\r\n|\r\n![fix-1](https://github.com/user-attachments/assets/cdfae85c-0e63-45be-94dd-5e0f9a698d8a)\r\n|\r\n\r\n| Before fix | After fix |\r\n| ------------- | ------------- |\r\n|\r\n![broken-2](https://github.com/user-attachments/assets/22588529-5afd-491d-ab00-6e07593fb6f7)\r\n|\r\n![fix-2](https://github.com/user-attachments/assets/c078d814-1a33-49dc-aa0d-25dcff555de2)\r\n|\r\n\r\n| Before fix | After fix |\r\n| ------------- | ------------- |\r\n|\r\n![broken-3](https://github.com/user-attachments/assets/082d306c-8866-4e4f-ab18-db7c649101fe)\r\n|\r\n![fix-3](https://github.com/user-attachments/assets/5da76c44-934b-4a2a-a98e-2de34973d02e)\r\n|\r\n\r\nIn a follow work, we need to remove completely all the\r\n`styled_components` we have.","sha":"a8e1bf46a3dc111e37caf19b19897081ed2a8078","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat Hunting:Investigations","backport:version","v8.18.0"],"title":"[Security Solution][Alert Details] - fix some UI issues related to emotion/css vs emotion/react","number":205664,"url":"https://github.com/elastic/kibana/pull/205664","mergeCommit":{"message":"[Security Solution][Alert Details] - fix some UI issues related to emotion/css vs emotion/react (#205664)\n\n## Summary\r\n\r\nThis recent [PR](#205011) slightly\r\nbroke the UI in a couple of small places in the alert details flyout.\r\nStrangely, I did review the PR by pulling down the branch, but only\r\nlooked at the places that were impacted by the files modified. The\r\ncouple of places where the UI broke were completely different...\r\nMy guess it is is related to the fact that in those place we were still\r\nusing `@emotion/css` and this might not play nice with some\r\n`styled_components`...\r\n\r\nUpdating those places to use `@emotion/react` fixed the issues!\r\n\r\n| Before fix | After fix |\r\n| ------------- | ------------- |\r\n|\r\n![broken-1](https://github.com/user-attachments/assets/839760db-da3c-4031-b4be-18645b37c089)\r\n|\r\n![fix-1](https://github.com/user-attachments/assets/cdfae85c-0e63-45be-94dd-5e0f9a698d8a)\r\n|\r\n\r\n| Before fix | After fix |\r\n| ------------- | ------------- |\r\n|\r\n![broken-2](https://github.com/user-attachments/assets/22588529-5afd-491d-ab00-6e07593fb6f7)\r\n|\r\n![fix-2](https://github.com/user-attachments/assets/c078d814-1a33-49dc-aa0d-25dcff555de2)\r\n|\r\n\r\n| Before fix | After fix |\r\n| ------------- | ------------- |\r\n|\r\n![broken-3](https://github.com/user-attachments/assets/082d306c-8866-4e4f-ab18-db7c649101fe)\r\n|\r\n![fix-3](https://github.com/user-attachments/assets/5da76c44-934b-4a2a-a98e-2de34973d02e)\r\n|\r\n\r\nIn a follow work, we need to remove completely all the\r\n`styled_components` we have.","sha":"a8e1bf46a3dc111e37caf19b19897081ed2a8078"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205664","number":205664,"mergeCommit":{"message":"[Security Solution][Alert Details] - fix some UI issues related to emotion/css vs emotion/react (#205664)\n\n## Summary\r\n\r\nThis recent [PR](#205011) slightly\r\nbroke the UI in a couple of small places in the alert details flyout.\r\nStrangely, I did review the PR by pulling down the branch, but only\r\nlooked at the places that were impacted by the files modified. The\r\ncouple of places where the UI broke were completely different...\r\nMy guess it is is related to the fact that in those place we were still\r\nusing `@emotion/css` and this might not play nice with some\r\n`styled_components`...\r\n\r\nUpdating those places to use `@emotion/react` fixed the issues!\r\n\r\n| Before fix | After fix |\r\n| ------------- | ------------- |\r\n|\r\n![broken-1](https://github.com/user-attachments/assets/839760db-da3c-4031-b4be-18645b37c089)\r\n|\r\n![fix-1](https://github.com/user-attachments/assets/cdfae85c-0e63-45be-94dd-5e0f9a698d8a)\r\n|\r\n\r\n| Before fix | After fix |\r\n| ------------- | ------------- |\r\n|\r\n![broken-2](https://github.com/user-attachments/assets/22588529-5afd-491d-ab00-6e07593fb6f7)\r\n|\r\n![fix-2](https://github.com/user-attachments/assets/c078d814-1a33-49dc-aa0d-25dcff555de2)\r\n|\r\n\r\n| Before fix | After fix |\r\n| ------------- | ------------- |\r\n|\r\n![broken-3](https://github.com/user-attachments/assets/082d306c-8866-4e4f-ab18-db7c649101fe)\r\n|\r\n![fix-3](https://github.com/user-attachments/assets/5da76c44-934b-4a2a-a98e-2de34973d02e)\r\n|\r\n\r\nIn a follow work, we need to remove completely all the\r\n`styled_components` we have.","sha":"a8e1bf46a3dc111e37caf19b19897081ed2a8078"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Philippe Oberti <[email protected]>
1 parent 1429560 commit 233da45

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
useEuiFontSize,
1616
EuiSkeletonText,
1717
} from '@elastic/eui';
18-
import { css } from '@emotion/css';
18+
import { css } from '@emotion/react';
1919
import { getOr } from 'lodash/fp';
2020
import { i18n } from '@kbn/i18n';
2121
import { HOST_NAME_FIELD_NAME } from '../../../../timelines/components/timeline/body/renderers/constants';

x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
useEuiFontSize,
1616
EuiSkeletonText,
1717
} from '@elastic/eui';
18-
import { css } from '@emotion/css';
18+
import { css } from '@emotion/react';
1919
import { getOr } from 'lodash/fp';
2020
import { i18n } from '@kbn/i18n';
2121
import { useDocumentDetailsContext } from '../../shared/context';

x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/insight_distribution_bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import React, { useMemo } from 'react';
9-
import { css } from '@emotion/css';
9+
import { css } from '@emotion/react';
1010
import {
1111
EuiFlexGroup,
1212
EuiFlexItem,

x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import React, { useEffect, useMemo } from 'react';
99
import { EuiFlexItem, type EuiFlexGroupProps, useEuiTheme } from '@elastic/eui';
1010
import { FormattedMessage } from '@kbn/i18n-react';
11-
import { css } from '@emotion/css';
11+
import { css } from '@emotion/react';
1212
import { useMisconfigurationPreview } from '@kbn/cloud-security-posture/src/hooks/use_misconfiguration_preview';
1313
import { buildGenericEntityFlyoutPreviewQuery } from '@kbn/cloud-security-posture-common';
1414
import {

x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import React, { useEffect, useMemo } from 'react';
99
import { EuiFlexItem, type EuiFlexGroupProps, useEuiTheme } from '@elastic/eui';
1010
import { FormattedMessage } from '@kbn/i18n-react';
11-
import { css } from '@emotion/css';
11+
import { css } from '@emotion/react';
1212
import { useVulnerabilitiesPreview } from '@kbn/cloud-security-posture/src/hooks/use_vulnerabilities_preview';
1313
import { buildGenericEntityFlyoutPreviewQuery } from '@kbn/cloud-security-posture-common';
1414
import { getVulnerabilityStats, hasVulnerabilitiesData } from '@kbn/cloud-security-posture';

x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/expandable_panel.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
useEuiTheme,
2121
EuiToolTip,
2222
EuiSkeletonText,
23+
useEuiFontSize,
2324
} from '@elastic/eui';
2425
import { i18n } from '@kbn/i18n';
2526
import type { EuiPanelProps, IconType } from '@elastic/eui';
@@ -126,6 +127,7 @@ export const ExpandablePanel: FC<PropsWithChildren<ExpandablePanelPanelProps>> =
126127
);
127128

128129
const { euiTheme } = useEuiTheme();
130+
const xsFontSize = useEuiFontSize('xs').fontSize;
129131

130132
const headerLeftSection = useMemo(
131133
() => (
@@ -159,8 +161,8 @@ export const ExpandablePanel: FC<PropsWithChildren<ExpandablePanelPanelProps>> =
159161
<EuiToolTip content={link?.tooltip}>
160162
<EuiLink
161163
css={css`
162-
font-size: 12px;
163-
font-weight: 700;
164+
font-size: ${xsFontSize};
165+
font-weight: ${euiTheme.font.weight.bold};
164166
`}
165167
data-test-subj={`${dataTestSubj}TitleLink`}
166168
onClick={link?.callback}
@@ -178,15 +180,17 @@ export const ExpandablePanel: FC<PropsWithChildren<ExpandablePanelPanelProps>> =
178180
</EuiFlexItem>
179181
),
180182
[
183+
euiTheme.size.xl,
184+
euiTheme.size.s,
185+
euiTheme.font.weight.bold,
181186
dataTestSubj,
182187
expandable,
183188
children,
184189
toggleIcon,
185-
link?.callback,
186190
iconType,
187-
euiTheme.size.s,
188-
euiTheme.size.xl,
191+
link?.callback,
189192
link?.tooltip,
193+
xsFontSize,
190194
title,
191195
]
192196
);

0 commit comments

Comments
 (0)