Skip to content

Commit

Permalink
[Security Solution] UX fixes for Policy page and Case Host Isolation …
Browse files Browse the repository at this point in the history
…comment (elastic#106027) (elastic#106135)

* [Security Solution] UX fixes for Policy page and Case Host Isolation comment
# Conflicts:
#	x-pack/plugins/cases/public/components/user_action_tree/index.test.tsx
  • Loading branch information
kevinlog committed Jul 19, 2021
1 parent 768c49f commit 1005170
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@
* 2.0.
*/

import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLink, EuiCommentProps } from '@elastic/eui';
import React from 'react';
import {
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
EuiLink,
EuiCommentProps,
EuiToken,
} from '@elastic/eui';
import React, { useContext } from 'react';
import classNames from 'classnames';
import { ThemeContext } from 'styled-components';
import {
CaseFullExternalService,
ActionConnector,
Expand Down Expand Up @@ -37,6 +45,7 @@ interface LabelTitle {
action: CaseUserActions;
field: string;
}

export type RuleDetailsNavigation = CasesNavigation<string | null | undefined, 'configurable'>;

export type ActionsNavigation = CasesNavigation<string, 'configurable'>;
Expand Down Expand Up @@ -365,6 +374,22 @@ export const getGeneratedAlertsAttachment = ({
),
});

const ActionIcon = React.memo<{
actionType: string;
}>(({ actionType }) => {
const theme = useContext(ThemeContext);
return (
<EuiToken
style={{ marginTop: '8px' }}
iconType={actionType === 'isolate' ? 'lock' : 'lockOpen'}
size="m"
shape="circle"
color={theme.eui.euiColorLightestShade}
data-test-subj="endpoint-action-icon"
/>
);
});

export const getActionAttachment = ({
comment,
userCanCrud,
Expand Down Expand Up @@ -397,7 +422,7 @@ export const getActionAttachment = ({
),
'data-test-subj': 'endpoint-action',
timestamp: <UserActionTimestamp createdAt={action.actionAt} />,
timelineIcon: comment.actions.type === 'isolate' ? 'lock' : 'lockOpen',
timelineIcon: <ActionIcon actionType={comment.actions.type} />,
actions: (
<UserActionCopyLink
id={comment.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import { PolicyDetailsForm } from './policy_details_form';
const maxFormWidth = '770px';
const PolicyDetailsHeader = styled.div`
padding: ${(props) => props.theme.eui.paddingSizes.xl} 0;
background-color: #fafbfd;
border-bottom: 1px solid #d3dae6;
.securitySolutionHeaderPage {
max-width: ${maxFormWidth};
Expand Down

0 comments on commit 1005170

Please sign in to comment.