Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
11f529f
Fix incorrect DOM nesting on ExceptionListHeader component
rylnd Jan 18, 2025
89a7dfb
Remove euiThemeVars from Empty View component
rylnd Jan 24, 2025
8cd40c4
Make styles Exception Item Expression in dynamic to EUI theme
rylnd Jan 24, 2025
708a32f
Make font-family styles dynamic with theme
rylnd Jan 24, 2025
eff6045
Remove unnecessary manual styles from Shared Exception Details
rylnd Jan 24, 2025
b729007
Replace custom CSS with appropriate `gutterSize` prop
rylnd Jan 28, 2025
901eb1e
Replace padding style with another `gutterSize` prop
rylnd Jan 28, 2025
85935a6
Update snapshots
rylnd Jan 28, 2025
dce42a8
Fix DOM nesting issue by using span for flexgroup
rylnd Jan 28, 2025
c325a0c
Remove unnecessary styles
rylnd Jan 28, 2025
134bc93
Convert MlJobItem to use @emotion and dynamic vars
rylnd Jan 28, 2025
f52586f
Replace use of styled-components/euiThemevars with @emotion/styled
rylnd Jan 29, 2025
67e9cff
Remove usage of styled-components and EuiThemeVars from ExceptionsLis…
rylnd Jan 29, 2025
114b07c
Replace use of static theme vars via @emotion/styled
rylnd Jan 29, 2025
528d968
Remove use of static theme vars in ValueListModal body
rylnd Jan 29, 2025
9299dda
Remove static theme vars from Threshold Rule Creation components
rylnd Jan 29, 2025
738ebe3
[CI] Auto-commit changed files from 'node scripts/styled_components_m…
kibanamachine Jan 29, 2025
b95cf8f
Fix styles on "Linked Rules" link in Rule Exceptions Tab
rylnd Jan 29, 2025
42e9dcb
Add EuiTheme to @emotion types in exception-list package
rylnd Jan 31, 2025
9222919
Port Exception Menu Link styles to be dynamic
rylnd Jan 25, 2025
eb60210
Fix/update tests following new use of EuiTheme
rylnd Jan 31, 2025
d2faf9b
Use clarifying testing syntax
rylnd Feb 1, 2025
eca40cd
Merge branch 'main' into rylnd/eui_tech_debt
rylnd Feb 1, 2025
7684a34
Merge branch 'main' into rylnd/eui_tech_debt
rylnd Feb 1, 2025
3df4d2d
Merge branch 'main' into rylnd/eui_tech_debt
rylnd Feb 4, 2025
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
3 changes: 0 additions & 3 deletions packages/kbn-babel-preset/styled_components_files.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
} from '@elastic/eui';
import type { ExpressionColor } from '@elastic/eui/src/components/expression/expression';
import type { EuiFacetGroupLayout } from '@elastic/eui/src/components/facet/facet_group';
import { euiThemeVars } from '@kbn/ui-theme';
import { ListTypeText, ViewerStatus } from '../types';
import * as i18n from '../translations';
import illustration from '../assets/images/illustration_product_no_results_magnifying_glass.svg';
Expand All @@ -33,10 +32,6 @@ interface EmptyViewerStateProps {
onEmptyButtonStateClick?: () => void | null;
}

const panelCss = css`
margin: ${euiThemeVars.euiSizeL} 0;
padding: ${euiThemeVars.euiSizeL} 0;
`;
const EmptyViewerStateComponent: FC<EmptyViewerStateProps> = ({
title,
body,
Expand All @@ -47,6 +42,10 @@ const EmptyViewerStateComponent: FC<EmptyViewerStateProps> = ({
onEmptyButtonStateClick,
}) => {
const { euiTheme } = useEuiTheme();
const panelCss = css`
margin: ${euiTheme.size.l} 0;
padding: ${euiTheme.size.l} 0;
`;

const euiEmptyPromptProps = useMemo(() => {
switch (viewerStatus) {
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
*/

import React, { ElementType, FC, memo } from 'react';
import { EuiExpression, EuiToken, EuiFlexGroup } from '@elastic/eui';
import { EuiExpression, EuiToken, EuiFlexGroup, useEuiTheme, EuiFlexItem } from '@elastic/eui';
import { css } from '@emotion/react';
import { ListOperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types';
import {
nestedGroupSpaceCss,
valueContainerCss,
expressionContainerCss,
} from '../conditions.styles';
import type { Entry } from '../types';
import * as i18n from '../../translations';
import { getValue, getValueExpression } from './entry_content.helper';
Expand All @@ -31,49 +27,49 @@ export const EntryContent: FC<EntryContentProps> = memo(
const value = getValue(entry);
const operator = 'operator' in entry ? entry.operator : '';

const { euiTheme } = useEuiTheme();
const nestedGroupSpaceStyles = css`
margin-left: ${euiTheme.size.l};
margin-bottom: ${euiTheme.size.xs};
padding-top: ${euiTheme.size.xs};
`;
const valueContainerStyles = css`
flex-direction: row;
`;

const entryKey = `${field}${type}${value}${index}`;
return (
<div data-test-subj={`${dataTestSubj || ''}${entryKey}EntryContent`} key={entryKey}>
<div css={expressionContainerCss}>
{isNestedEntry ? (
<EuiFlexGroup
responsive
css={nestedGroupSpaceCss}
direction="row"
alignItems="center"
gutterSize="m"
data-test-subj={`${dataTestSubj || ''}NestedEntry`}
>
<EuiToken data-test-subj="nstedEntryIcon" iconType="tokenNested" size="s" />

<div css={valueContainerCss}>
<EuiExpression description="" value={field} color="subdued" />
{getValueExpression(
type as ListOperatorTypeEnum,
operator,
value,
showValueListModal
)}
</div>
</EuiFlexGroup>
) : (
<>
<EuiExpression
description={index === 0 ? '' : i18n.CONDITION_AND}
value={field}
color={index === 0 ? 'primary' : 'subdued'}
data-test-subj={`${dataTestSubj || ''}SingleEntry`}
/>

{isNestedEntry ? (
<EuiFlexGroup
css={nestedGroupSpaceStyles}
responsive={false}
alignItems="center"
gutterSize="l"
data-test-subj={`${dataTestSubj || ''}NestedEntry`}
>
<EuiToken data-test-subj="nstedEntryIcon" iconType="tokenNested" size="s" />
<EuiFlexItem css={valueContainerStyles}>
<EuiExpression description="" value={field} color="subdued" />
{getValueExpression(
type as ListOperatorTypeEnum,
operator,
value,
showValueListModal
)}
</>
)}
</div>
</EuiFlexItem>
</EuiFlexGroup>
) : (
<>
<EuiExpression
description={index === 0 ? '' : i18n.CONDITION_AND}
value={field}
color={index === 0 ? 'primary' : 'subdued'}
data-test-subj={`${dataTestSubj || ''}SingleEntry`}
/>
{getValueExpression(type as ListOperatorTypeEnum, operator, value, showValueListModal)}
</>
)}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
*/

import React, { memo } from 'react';
import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';
import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiText, useEuiTheme } from '@elastic/eui';
import { css } from '@emotion/react';
import { euiThemeVars } from '@kbn/ui-theme';
import * as i18n from '../../translations';

interface MetaInfoDetailsProps {
Expand All @@ -18,11 +17,13 @@ interface MetaInfoDetailsProps {
dataTestSubj?: string;
}

const euiBadgeFontFamily = css`
font-family: ${euiThemeVars.euiFontFamily};
`;
export const MetaInfoDetails = memo<MetaInfoDetailsProps>(
({ label, lastUpdate, lastUpdateValue, dataTestSubj }) => {
const { euiTheme } = useEuiTheme();
const euiBadgeFontFamily = css`
font-family: ${euiTheme.font.family};
`;

return (
<EuiFlexGroup
data-test-subj={`${dataTestSubj || ''}metaInfoDetails`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import React from 'react';

import { EuiThemeProvider, Pagination } from '@elastic/eui';
import { getExceptionListItemSchemaMock } from '../mocks/exception_list_item_schema.mock';
import { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types';

Expand All @@ -15,7 +16,6 @@ import { ExceptionItems } from '.';
import { ViewerStatus } from '../types';
import { fireEvent, render } from '@testing-library/react';
import { ruleReferences } from '../mocks/rule_references.mock';
import { Pagination } from '@elastic/eui';
import { mockGetFormattedComments } from '../mocks/comments.mock';
import { securityLinkAnchorComponentMock } from '../mocks/security_link_component.mock';
import { MockedShowValueListModal } from '../mocks/value_list_modal.mock';
Expand Down Expand Up @@ -156,7 +156,8 @@ describe('ExceptionsViewerItems', () => {
exceptionsUtilityComponent={() => null}
getFormattedComments={() => []}
showValueListModal={MockedShowValueListModal}
/>
/>,
{ wrapper: EuiThemeProvider }
);
expect(wrapper.getByTestId('exceptionsContainer')).toBeInTheDocument();
fireEvent.click(wrapper.getByTestId('exceptionItemCardMetaInfoEmptyButton'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import React, { ElementType } from 'react';
import { css } from '@emotion/react';
import type { FC } from 'react';
import { EuiCommentProps, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';

Expand All @@ -16,7 +15,6 @@ import type {
ExceptionListTypeEnum,
} from '@kbn/securitysolution-io-ts-list-types';

import { euiThemeVars } from '@kbn/ui-theme';
import { EmptyViewerState, ExceptionItemCard, Pagination, PaginationProps } from '../..';

import type {
Expand All @@ -26,13 +24,6 @@ import type {
GetExceptionItemProps,
} from '../types';

const exceptionItemCss = css`
margin: ${euiThemeVars.euiSize} 0;
&div:first-child {
margin: ${euiThemeVars.euiSizeXS} 0 ${euiThemeVars.euiSize};
}
`;

interface ExceptionItemsProps {
lastUpdated: string | number | null;
viewerStatus: ViewerStatus;
Expand Down Expand Up @@ -98,13 +89,12 @@ const ExceptionItemsComponent: FC<ExceptionItemsProps> = ({
return (
<>
<ExceptionsUtility pagination={pagination} lastUpdated={lastUpdated} />
<EuiFlexGroup direction="column" gutterSize="none" className="eui-yScrollWithShadows">
<EuiFlexGroup direction="column" gutterSize="none">
<EuiFlexItem grow={false}>
<EuiFlexGroup
css={exceptionItemCss}
data-test-subj={`${dataTestSubj || ''}exceptionsContainer`}
direction="column"
gutterSize="s"
gutterSize="m"
>
{exceptions.map((exception) => (
<EuiFlexItem
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import { render } from '@testing-library/react';
import { EuiThemeProvider } from '@elastic/eui';
import { ReactElement, ElementType } from 'react';
import { generateLinkedRulesMenuItems } from '.';
import { rules } from '../mocks/rule_references.mock';
Expand Down Expand Up @@ -43,7 +44,9 @@ describe('generateLinedRulesMenuItems', () => {
}) as ReactElement[];

result.forEach((link) => {
const wrapper = render(link);
const wrapper = render(link, {
wrapper: EuiThemeProvider,
});
expect(wrapper.container).toMatchSnapshot();
expect(wrapper.getByTestId('generateLinedRulesMenuItemsTestActionItem1a2b3c'));
expect(wrapper.getByTestId('generateLinedRulesMenuItemsTestLeftIcon'));
Expand All @@ -52,7 +55,7 @@ describe('generateLinedRulesMenuItems', () => {
it('should render the second linked rule and apply the css when the length is > 1', () => {
const result: ReactElement[] = getSecurityLinkAction(dataTestSubj);

const wrapper = render(result[1]);
const wrapper = render(result[1], { wrapper: EuiThemeProvider });
expect(wrapper.container).toMatchSnapshot();
expect(wrapper.getByTestId('generateLinedRulesMenuItemsTestActionItem2a2b3c'));
});
Expand Down
Loading