mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Security Solution][Alert Details] - fix some UI issues related to emotion/css vs emotion/react (#205664)
## Summary This recent [PR](https://github.com/elastic/kibana/pull/205011) slightly broke the UI in a couple of small places in the alert details flyout. Strangely, I did review the PR by pulling down the branch, but only looked at the places that were impacted by the files modified. The couple of places where the UI broke were completely different... My guess it is is related to the fact that in those place we were still using `@emotion/css` and this might not play nice with some `styled_components`... Updating those places to use `@emotion/react` fixed the issues! | Before fix | After fix | | ------------- | ------------- | |  |  | | Before fix | After fix | | ------------- | ------------- | |  |  | | Before fix | After fix | | ------------- | ------------- | |  |  | In a follow work, we need to remove completely all the `styled_components` we have.
This commit is contained in:
parent
3fd987caa8
commit
a8e1bf46a3
6 changed files with 14 additions and 10 deletions
|
@ -15,7 +15,7 @@ import {
|
|||
useEuiFontSize,
|
||||
EuiSkeletonText,
|
||||
} from '@elastic/eui';
|
||||
import { css } from '@emotion/css';
|
||||
import { css } from '@emotion/react';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { HOST_NAME_FIELD_NAME } from '../../../../timelines/components/timeline/body/renderers/constants';
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
useEuiFontSize,
|
||||
EuiSkeletonText,
|
||||
} from '@elastic/eui';
|
||||
import { css } from '@emotion/css';
|
||||
import { css } from '@emotion/react';
|
||||
import { getOr } from 'lodash/fp';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { useDocumentDetailsContext } from '../../shared/context';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, { useMemo } from 'react';
|
||||
import { css } from '@emotion/css';
|
||||
import { css } from '@emotion/react';
|
||||
import {
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React, { useEffect, useMemo } from 'react';
|
||||
import { EuiFlexItem, type EuiFlexGroupProps, useEuiTheme } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { css } from '@emotion/css';
|
||||
import { css } from '@emotion/react';
|
||||
import { useMisconfigurationPreview } from '@kbn/cloud-security-posture/src/hooks/use_misconfiguration_preview';
|
||||
import { buildGenericEntityFlyoutPreviewQuery } from '@kbn/cloud-security-posture-common';
|
||||
import {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React, { useEffect, useMemo } from 'react';
|
||||
import { EuiFlexItem, type EuiFlexGroupProps, useEuiTheme } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { css } from '@emotion/css';
|
||||
import { css } from '@emotion/react';
|
||||
import { useVulnerabilitiesPreview } from '@kbn/cloud-security-posture/src/hooks/use_vulnerabilities_preview';
|
||||
import { buildGenericEntityFlyoutPreviewQuery } from '@kbn/cloud-security-posture-common';
|
||||
import { getVulnerabilityStats, hasVulnerabilitiesData } from '@kbn/cloud-security-posture';
|
||||
|
|
|
@ -20,6 +20,7 @@ import {
|
|||
useEuiTheme,
|
||||
EuiToolTip,
|
||||
EuiSkeletonText,
|
||||
useEuiFontSize,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type { EuiPanelProps, IconType } from '@elastic/eui';
|
||||
|
@ -126,6 +127,7 @@ export const ExpandablePanel: FC<PropsWithChildren<ExpandablePanelPanelProps>> =
|
|||
);
|
||||
|
||||
const { euiTheme } = useEuiTheme();
|
||||
const xsFontSize = useEuiFontSize('xs').fontSize;
|
||||
|
||||
const headerLeftSection = useMemo(
|
||||
() => (
|
||||
|
@ -159,8 +161,8 @@ export const ExpandablePanel: FC<PropsWithChildren<ExpandablePanelPanelProps>> =
|
|||
<EuiToolTip content={link?.tooltip}>
|
||||
<EuiLink
|
||||
css={css`
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
font-size: ${xsFontSize};
|
||||
font-weight: ${euiTheme.font.weight.bold};
|
||||
`}
|
||||
data-test-subj={`${dataTestSubj}TitleLink`}
|
||||
onClick={link?.callback}
|
||||
|
@ -178,15 +180,17 @@ export const ExpandablePanel: FC<PropsWithChildren<ExpandablePanelPanelProps>> =
|
|||
</EuiFlexItem>
|
||||
),
|
||||
[
|
||||
euiTheme.size.xl,
|
||||
euiTheme.size.s,
|
||||
euiTheme.font.weight.bold,
|
||||
dataTestSubj,
|
||||
expandable,
|
||||
children,
|
||||
toggleIcon,
|
||||
link?.callback,
|
||||
iconType,
|
||||
euiTheme.size.s,
|
||||
euiTheme.size.xl,
|
||||
link?.callback,
|
||||
link?.tooltip,
|
||||
xsFontSize,
|
||||
title,
|
||||
]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue