{entries.map((entry, index) => {
- const {
- field,
- type
- } = entry;
- const value = "value" in entry ? entry.value : '';
- const nestedEntries = "entries" in entry ? entry.entries : [];
- const operator = "operator" in entry ? entry.operator : '';
+ const { field, type } = entry;
+ const value = 'value' in entry ? entry.value : '';
+ const nestedEntries = 'entries' in entry ? entry.entries : [];
+ const operator = 'operator' in entry ? entry.operator : '';
return (
@@ -121,7 +110,7 @@ export const ExceptionItemCardConditions = memo(
{
key: 'edit',
icon: 'pencil',
label: i18n.EXCEPTION_ITEM_EDIT_BUTTON,
- onClick: jest.fn()
+ onClick: jest.fn(),
},
{
key: 'delete',
icon: 'trash',
label: i18n.EXCEPTION_ITEM_DELETE_BUTTON,
- onClick: jest.fn()
+ onClick: jest.fn(),
},
]}
/>
);
- expect(
- wrapper.find('[data-test-subj="exceptionItemHeader-title"]').at(0).text()
- ).toEqual('some name');
+ expect(wrapper.find('[data-test-subj="exceptionItemHeader-title"]').at(0).text()).toEqual(
+ 'some name'
+ );
});
it('it displays actions', () => {
@@ -59,29 +59,32 @@ describe('ExceptionItemCardHeader', () => {
);
-
+
// click on popover
- wrapper.find('button[data-test-subj="exceptionItemHeader-actionButton"]').at(0).simulate('click');
+ wrapper
+ .find('button[data-test-subj="exceptionItemHeader-actionButton"]')
+ .at(0)
+ .simulate('click');
expect(wrapper.find('button[data-test-subj="exceptionItemHeader-actionItem"]')).toHaveLength(2);
-
+
wrapper.find('button[data-test-subj="exceptionItemHeader-actionItem"]').at(0).simulate('click');
expect(handleEdit).toHaveBeenCalled();
@@ -96,26 +99,29 @@ describe('ExceptionItemCardHeader', () => {
);
-
- expect(wrapper.find('button[data-test-subj="exceptionItemHeader-actionButton"]').at(0).props().disabled).toBeTruthy();
+
+ expect(
+ wrapper.find('button[data-test-subj="exceptionItemHeader-actionButton"]').at(0).props()
+ .disabled
+ ).toBeTruthy();
});
});
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_header.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_header.tsx
index 7a93a0b9258ca..ea69fb36068be 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_header.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_header.tsx
@@ -6,12 +6,21 @@
*/
import React, { memo, useMemo, useState } from 'react';
-import { EuiButtonIcon, EuiContextMenuPanelProps, EuiContextMenuPanel, EuiFlexGroup, EuiFlexItem, EuiPopover, EuiTitle, EuiContextMenuItem } from '@elastic/eui';
+import {
+ EuiButtonIcon,
+ EuiContextMenuPanelProps,
+ EuiContextMenuPanel,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiPopover,
+ EuiTitle,
+ EuiContextMenuItem,
+} from '@elastic/eui';
import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
export interface ExceptionItemCardHeaderProps {
item: ExceptionListItemSchema;
- actions: Array<{ key: string; icon: string; label: string; onClick: () => void; }>;
+ actions: Array<{ key: string; icon: string; label: string; onClick: () => void }>;
disableActions?: boolean;
dataTestSubj: string;
}
@@ -36,9 +45,9 @@ export const ExceptionItemCardHeader = memo(
>
{action.label}
- ))
+ ));
}, []);
-
+
return (
@@ -48,7 +57,7 @@ export const ExceptionItemCardHeader = memo(
(
onClick={onItemActionsClick}
data-test-subj={`${dataTestSubj}-actionButton`}
/>
- )}
+ }
panelPaddingSize="none"
isOpen={isPopoverOpen}
closePopover={onClosePopover}
data-test-subj={`${dataTestSubj}-items`}
>
-
+
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_meta.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_meta.tsx
index 1153f49ae6088..8a1d8c00a1aec 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_meta.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/exception_item_card_meta.tsx
@@ -19,7 +19,6 @@ export interface ExceptionItemCardMetaInfoProps {
export const ExceptionItemCardMetaInfo = memo(
({ item, dataTestSubj }) => {
-
return (
(
data-test-subj={dataTestSubj}
>
-
- )}
+
+ }
value2={item.created_by}
dataTestSubj={`${dataTestSubj}-createdBy`}
/>
@@ -43,13 +41,13 @@ export const ExceptionItemCardMetaInfo = memo(
- )}
+ }
value2={item.updated_by}
dataTestSubj={`${dataTestSubj}-updatedBy`}
/>
@@ -70,36 +68,33 @@ interface MetaInfoDetailsProps {
const MetaInfoDetails = memo(({ label, value1, value2, dataTestSubj }) => {
return (
-
+
-
+
- {value1}
+
+ {value1}
+
- {i18n.EXCEPTION_ITEM_META_BY}
+
+ {i18n.EXCEPTION_ITEM_META_BY}
+
-
- {value2}
+
+
+ {value2}
+
diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/index.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/index.tsx
index c65fca36e5b7d..c520d4f59fb43 100644
--- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/index.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exception_item_card/index.tsx
@@ -66,7 +66,7 @@ const ExceptionItemCardComponent = ({
return (
-
+
@@ -95,20 +95,20 @@ const ExceptionItemCardComponent = ({
/>
-
+
{formattedComments.length > 0 && (