[Security Solution][Endpoint][Host Isolation] Removes empty comment box for host isolation (#105642)
This commit is contained in:
parent
404337514e
commit
47c30c35cd
|
@ -22,9 +22,8 @@ import { parseString } from '../../containers/utils';
|
||||||
import { Tags } from '../tag_list/tags';
|
import { Tags } from '../tag_list/tags';
|
||||||
import { UserActionUsernameWithAvatar } from './user_action_username_with_avatar';
|
import { UserActionUsernameWithAvatar } from './user_action_username_with_avatar';
|
||||||
import { UserActionTimestamp } from './user_action_timestamp';
|
import { UserActionTimestamp } from './user_action_timestamp';
|
||||||
import { UserActionContentToolbar } from './user_action_content_toolbar';
|
|
||||||
import { UserActionCopyLink } from './user_action_copy_link';
|
import { UserActionCopyLink } from './user_action_copy_link';
|
||||||
import { UserActionMarkdown } from './user_action_markdown';
|
import { ContentWrapper } from './user_action_markdown';
|
||||||
import { UserActionMoveToReference } from './user_action_move_to_reference';
|
import { UserActionMoveToReference } from './user_action_move_to_reference';
|
||||||
import { Status, statuses } from '../status';
|
import { Status, statuses } from '../status';
|
||||||
import { UserActionShowAlert } from './user_action_show_alert';
|
import { UserActionShowAlert } from './user_action_show_alert';
|
||||||
|
@ -32,6 +31,7 @@ import * as i18n from './translations';
|
||||||
import { AlertCommentEvent } from './user_action_alert_comment_event';
|
import { AlertCommentEvent } from './user_action_alert_comment_event';
|
||||||
import { CasesNavigation } from '../links';
|
import { CasesNavigation } from '../links';
|
||||||
import { HostIsolationCommentEvent } from './user_action_host_isolation_comment_event';
|
import { HostIsolationCommentEvent } from './user_action_host_isolation_comment_event';
|
||||||
|
import { MarkdownRenderer } from '../markdown_editor';
|
||||||
|
|
||||||
interface LabelTitle {
|
interface LabelTitle {
|
||||||
action: CaseUserActions;
|
action: CaseUserActions;
|
||||||
|
@ -371,10 +371,6 @@ export const getActionAttachment = ({
|
||||||
isLoadingIds,
|
isLoadingIds,
|
||||||
getCaseDetailHrefWithCommentId,
|
getCaseDetailHrefWithCommentId,
|
||||||
actionsNavigation,
|
actionsNavigation,
|
||||||
manageMarkdownEditIds,
|
|
||||||
handleManageMarkdownEditId,
|
|
||||||
handleManageQuote,
|
|
||||||
handleSaveComment,
|
|
||||||
action,
|
action,
|
||||||
}: {
|
}: {
|
||||||
comment: Comment & CommentRequestActionsType;
|
comment: Comment & CommentRequestActionsType;
|
||||||
|
@ -382,10 +378,6 @@ export const getActionAttachment = ({
|
||||||
isLoadingIds: string[];
|
isLoadingIds: string[];
|
||||||
getCaseDetailHrefWithCommentId: (commentId: string) => string;
|
getCaseDetailHrefWithCommentId: (commentId: string) => string;
|
||||||
actionsNavigation?: ActionsNavigation;
|
actionsNavigation?: ActionsNavigation;
|
||||||
manageMarkdownEditIds: string[];
|
|
||||||
handleManageMarkdownEditId: (id: string) => void;
|
|
||||||
handleManageQuote: (id: string) => void;
|
|
||||||
handleSaveComment: ({ id, version }: { id: string; version: string }, content: string) => void;
|
|
||||||
action: CaseUserActions;
|
action: CaseUserActions;
|
||||||
}): EuiCommentProps => ({
|
}): EuiCommentProps => ({
|
||||||
username: (
|
username: (
|
||||||
|
@ -394,9 +386,7 @@ export const getActionAttachment = ({
|
||||||
fullName={comment.createdBy.fullName}
|
fullName={comment.createdBy.fullName}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
className: classNames({
|
className: classNames('comment-action', { 'empty-comment': comment.comment.trim().length === 0 }),
|
||||||
isEdit: manageMarkdownEditIds.includes(comment.id),
|
|
||||||
}),
|
|
||||||
event: (
|
event: (
|
||||||
<HostIsolationCommentEvent
|
<HostIsolationCommentEvent
|
||||||
type={comment.actions.type}
|
type={comment.actions.type}
|
||||||
|
@ -409,28 +399,15 @@ export const getActionAttachment = ({
|
||||||
timestamp: <UserActionTimestamp createdAt={action.actionAt} />,
|
timestamp: <UserActionTimestamp createdAt={action.actionAt} />,
|
||||||
timelineIcon: comment.actions.type === 'isolate' ? 'lock' : 'lockOpen',
|
timelineIcon: comment.actions.type === 'isolate' ? 'lock' : 'lockOpen',
|
||||||
actions: (
|
actions: (
|
||||||
<UserActionContentToolbar
|
<UserActionCopyLink
|
||||||
getCaseDetailHrefWithCommentId={getCaseDetailHrefWithCommentId}
|
|
||||||
id={comment.id}
|
id={comment.id}
|
||||||
editLabel={i18n.EDIT_COMMENT}
|
getCaseDetailHrefWithCommentId={getCaseDetailHrefWithCommentId}
|
||||||
quoteLabel={i18n.QUOTE}
|
|
||||||
userCanCrud={userCanCrud}
|
|
||||||
isLoading={isLoadingIds.includes(comment.id)}
|
|
||||||
onEdit={handleManageMarkdownEditId.bind(null, comment.id)}
|
|
||||||
onQuote={handleManageQuote.bind(null, comment.comment)}
|
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
children: (
|
children: comment.comment.trim().length > 0 && (
|
||||||
<UserActionMarkdown
|
<ContentWrapper data-test-subj="user-action-markdown">
|
||||||
id={comment.id}
|
<MarkdownRenderer>{comment.comment}</MarkdownRenderer>
|
||||||
content={comment.comment}
|
</ContentWrapper>
|
||||||
isEditable={manageMarkdownEditIds.includes(comment.id)}
|
|
||||||
onChangeEditable={handleManageMarkdownEditId}
|
|
||||||
onSaveContent={handleSaveComment.bind(null, {
|
|
||||||
id: comment.id,
|
|
||||||
version: comment.version,
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -107,13 +107,21 @@ const MyEuiCommentList = styled(EuiCommentList)`
|
||||||
& .comment-alert .euiCommentEvent {
|
& .comment-alert .euiCommentEvent {
|
||||||
background-color: ${theme.eui.euiColorLightestShade};
|
background-color: ${theme.eui.euiColorLightestShade};
|
||||||
border: ${theme.eui.euiFlyoutBorder};
|
border: ${theme.eui.euiFlyoutBorder};
|
||||||
padding: 10px;
|
padding: ${theme.eui.paddingSizes.s};
|
||||||
border-radius: ${theme.eui.paddingSizes.xs};
|
border-radius: ${theme.eui.paddingSizes.xs};
|
||||||
}
|
}
|
||||||
|
|
||||||
& .comment-alert .euiCommentEvent__headerData {
|
& .comment-alert .euiCommentEvent__headerData {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
& .comment-action.empty-comment .euiCommentEvent--regular {
|
||||||
|
box-shadow: none;
|
||||||
|
.euiCommentEvent__header {
|
||||||
|
padding: ${theme.eui.euiSizeM} ${theme.eui.paddingSizes.s};
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
`}
|
`}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -467,10 +475,6 @@ export const UserActionTree = React.memo(
|
||||||
isLoadingIds,
|
isLoadingIds,
|
||||||
getCaseDetailHrefWithCommentId,
|
getCaseDetailHrefWithCommentId,
|
||||||
actionsNavigation,
|
actionsNavigation,
|
||||||
manageMarkdownEditIds,
|
|
||||||
handleManageMarkdownEditId,
|
|
||||||
handleManageQuote,
|
|
||||||
handleSaveComment,
|
|
||||||
action,
|
action,
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { Form, useForm, UseField } from '../../common/shared_imports';
|
||||||
import { schema, Content } from './schema';
|
import { schema, Content } from './schema';
|
||||||
import { MarkdownRenderer, MarkdownEditorForm } from '../markdown_editor';
|
import { MarkdownRenderer, MarkdownEditorForm } from '../markdown_editor';
|
||||||
|
|
||||||
const ContentWrapper = styled.div`
|
export const ContentWrapper = styled.div`
|
||||||
padding: ${({ theme }) => `${theme.eui.euiSizeM} ${theme.eui.euiSizeL}`};
|
padding: ${({ theme }) => `${theme.eui.euiSizeM} ${theme.eui.euiSizeL}`};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue