diff --git a/src/elements/content-sidebar/activity-feed/activity-feed/ActivityItem.scss b/src/elements/content-sidebar/activity-feed/activity-feed/ActivityItem.scss index cd0d6dc876..370ce1e4a9 100644 --- a/src/elements/content-sidebar/activity-feed/activity-feed/ActivityItem.scss +++ b/src/elements/content-sidebar/activity-feed/activity-feed/ActivityItem.scss @@ -6,7 +6,7 @@ // This brittle selector is here in order to only select the parent BaseComment and not the BaseComments which constitute its replies. & > div { - padding: $bdl-grid-unit * 3 $bdl-grid-unit * 3 $bdl-grid-unit * 5; + padding: $bdl-grid-unit * 3 $bdl-grid-unit * 3 $bdl-grid-unit; } &.bcs-is-hoverable:hover { diff --git a/src/elements/content-sidebar/activity-feed/comment/BaseComment.js b/src/elements/content-sidebar/activity-feed/comment/BaseComment.js index a09213703f..352de2afe3 100644 --- a/src/elements/content-sidebar/activity-feed/comment/BaseComment.js +++ b/src/elements/content-sidebar/activity-feed/comment/BaseComment.js @@ -234,6 +234,7 @@ export const BaseComment = ({ onReplyDelete={onReplyDelete} onReplySelect={onSelect} onShowReplies={onShowReplies} + parentStatus={status} replies={replies} repliesTotalCount={repliesTotalCount} /> @@ -257,6 +258,7 @@ type RepliesProps = { onReplyDelete?: ({ id: string, permissions?: BoxCommentPermission }) => void, onReplySelect?: (isSelected: boolean) => void, onShowReplies?: () => void, + parentStatus?: string, replies: CommentType[], repliesTotalCount?: number, translations?: Translations, @@ -276,6 +278,7 @@ export const Replies = ({ onReplySelect = noop, onShowReplies, onHideReplies, + parentStatus, replies, repliesTotalCount = 0, translations, @@ -346,7 +349,7 @@ export const Replies = ({ })} - {!!onReplyCreate && ( + {parentStatus !== COMMENT_STATUS_RESOLVED && !!onReplyCreate && ( () => 'Avatar'); jest.mock('react-intl', () => ({ @@ -221,6 +222,18 @@ describe('elements/content-sidebar/ActivityFeed/comment/Replies', () => { expect(hideReplies).not.toBeCalled(); }); + test('should hide reply button for resolved parent comments', () => { + getWrapper({ parentStatus: COMMENT_STATUS_RESOLVED }); + + expect(screen.queryByRole('button', { name: 'Reply' })).not.toBeInTheDocument(); + }); + + test('should show reply button for unresolved parent comments', () => { + getWrapper({ parentStatus: COMMENT_STATUS_OPEN }); + + expect(screen.queryByRole('button', { name: 'Reply' })).toBeInTheDocument(); + }); + test.each` onShowReplies | onHideReplies ${showReplies} | ${undefined}