From 47c30c35cd1e37cc045ac6c3f5fbfabb4a925e94 Mon Sep 17 00:00:00 2001 From: Candace Park <56409205+parkiino@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:13:56 -0400 Subject: [PATCH] [Security Solution][Endpoint][Host Isolation] Removes empty comment box for host isolation (#105642) --- .../components/user_action_tree/helpers.tsx | 41 ++++--------------- .../components/user_action_tree/index.tsx | 14 ++++--- .../user_action_tree/user_action_markdown.tsx | 2 +- 3 files changed, 19 insertions(+), 38 deletions(-) diff --git a/x-pack/plugins/cases/public/components/user_action_tree/helpers.tsx b/x-pack/plugins/cases/public/components/user_action_tree/helpers.tsx index 338b8577458e..422fb8ee581b 100644 --- a/x-pack/plugins/cases/public/components/user_action_tree/helpers.tsx +++ b/x-pack/plugins/cases/public/components/user_action_tree/helpers.tsx @@ -22,9 +22,8 @@ import { parseString } from '../../containers/utils'; import { Tags } from '../tag_list/tags'; import { UserActionUsernameWithAvatar } from './user_action_username_with_avatar'; import { UserActionTimestamp } from './user_action_timestamp'; -import { UserActionContentToolbar } from './user_action_content_toolbar'; 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 { Status, statuses } from '../status'; 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 { CasesNavigation } from '../links'; import { HostIsolationCommentEvent } from './user_action_host_isolation_comment_event'; +import { MarkdownRenderer } from '../markdown_editor'; interface LabelTitle { action: CaseUserActions; @@ -371,10 +371,6 @@ export const getActionAttachment = ({ isLoadingIds, getCaseDetailHrefWithCommentId, actionsNavigation, - manageMarkdownEditIds, - handleManageMarkdownEditId, - handleManageQuote, - handleSaveComment, action, }: { comment: Comment & CommentRequestActionsType; @@ -382,10 +378,6 @@ export const getActionAttachment = ({ isLoadingIds: string[]; getCaseDetailHrefWithCommentId: (commentId: string) => string; actionsNavigation?: ActionsNavigation; - manageMarkdownEditIds: string[]; - handleManageMarkdownEditId: (id: string) => void; - handleManageQuote: (id: string) => void; - handleSaveComment: ({ id, version }: { id: string; version: string }, content: string) => void; action: CaseUserActions; }): EuiCommentProps => ({ username: ( @@ -394,9 +386,7 @@ export const getActionAttachment = ({ fullName={comment.createdBy.fullName} /> ), - className: classNames({ - isEdit: manageMarkdownEditIds.includes(comment.id), - }), + className: classNames('comment-action', { 'empty-comment': comment.comment.trim().length === 0 }), event: ( , timelineIcon: comment.actions.type === 'isolate' ? 'lock' : 'lockOpen', actions: ( - ), - children: ( - + children: comment.comment.trim().length > 0 && ( + + {comment.comment} + ), }); diff --git a/x-pack/plugins/cases/public/components/user_action_tree/index.tsx b/x-pack/plugins/cases/public/components/user_action_tree/index.tsx index eb74eb2bd643..86247b503dff 100644 --- a/x-pack/plugins/cases/public/components/user_action_tree/index.tsx +++ b/x-pack/plugins/cases/public/components/user_action_tree/index.tsx @@ -107,13 +107,21 @@ const MyEuiCommentList = styled(EuiCommentList)` & .comment-alert .euiCommentEvent { background-color: ${theme.eui.euiColorLightestShade}; border: ${theme.eui.euiFlyoutBorder}; - padding: 10px; + padding: ${theme.eui.paddingSizes.s}; border-radius: ${theme.eui.paddingSizes.xs}; } & .comment-alert .euiCommentEvent__headerData { 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, getCaseDetailHrefWithCommentId, actionsNavigation, - manageMarkdownEditIds, - handleManageMarkdownEditId, - handleManageQuote, - handleSaveComment, action, }), ] diff --git a/x-pack/plugins/cases/public/components/user_action_tree/user_action_markdown.tsx b/x-pack/plugins/cases/public/components/user_action_tree/user_action_markdown.tsx index 1522527468fc..cf0d6e3ea50d 100644 --- a/x-pack/plugins/cases/public/components/user_action_tree/user_action_markdown.tsx +++ b/x-pack/plugins/cases/public/components/user_action_tree/user_action_markdown.tsx @@ -14,7 +14,7 @@ import { Form, useForm, UseField } from '../../common/shared_imports'; import { schema, Content } from './schema'; import { MarkdownRenderer, MarkdownEditorForm } from '../markdown_editor'; -const ContentWrapper = styled.div` +export const ContentWrapper = styled.div` padding: ${({ theme }) => `${theme.eui.euiSizeM} ${theme.eui.euiSizeL}`}; `;