Skip to content

Commit 4114f3a

Browse files
author
Vikas Agarwal
committed
Github issue #572, Messaging: Owner response post missing from status update
-- Reverted previous changes. Found the root cause of the problem. Actually the flag, to prevent non team member from commenting on posts, was wrongly being used to render the feed's comments section on dashboard. It is used correctly on Discussions page.
1 parent dd08081 commit 4114f3a

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/components/Feed/Feed.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const Feed = (props) => {
3636
<div className="card-body draftjs-post" dangerouslySetInnerHTML={{__html: html}} />
3737
</div>
3838
</Panel.Body>
39-
{allowComments &&
4039
<FeedComments
40+
allowComments={ allowComments }
4141
totalComments={totalComments}
4242
hasMoreComments={hasMoreComments}
4343
onLoadMoreComments={onLoadMoreComments}
@@ -49,7 +49,7 @@ const Feed = (props) => {
4949
avatarUrl={currentUser.photoURL}
5050
comments={comments}
5151
isAddingComment={ isAddingComment }
52-
/>}
52+
/>
5353
{children}
5454
</ActionCard>
5555
)

src/components/Feed/FeedComments.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class FeedComments extends React.Component {
2525
render() {
2626
const {
2727
comments, currentUser, totalComments, onLoadMoreComments, isLoadingComments, hasMoreComments, onAdd,
28-
onChange, content, avatarUrl, isAddingComment
28+
onChange, content, avatarUrl, isAddingComment, allowComments
2929
} = this.props
3030
let authorName = currentUser.firstName
3131
if (authorName && currentUser.lastName) {
@@ -77,6 +77,7 @@ class FeedComments extends React.Component {
7777
<div dangerouslySetInnerHTML={{__html: item.content}} />
7878
</Comment>
7979
)}
80+
{allowComments &&
8081
<AddComment
8182
placeholder="Create a new comment..."
8283
onAdd={onAdd}
@@ -85,7 +86,7 @@ class FeedComments extends React.Component {
8586
avatarUrl={avatarUrl}
8687
authorName={ authorName }
8788
isAdding={ isAddingComment }
88-
/>
89+
/>}
8990
</div>
9091
)
9192
}

src/projects/detail/containers/FeedContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class FeedView extends React.Component {
212212
<div className="feed-action-card" key={item.id}>
213213
<Feed
214214
{...item}
215-
allowComments={ item.allowComments }
215+
allowComments={ item.allowComments && !!currentMemberRole}
216216
currentUser={currentUser}
217217
onNewCommentChange={this.onNewCommentChange.bind(this, item.id)}
218218
onAddNewComment={this.onAddNewComment.bind(this, item.id)}

src/projects/detail/containers/MessagesContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class MessagesView extends React.Component {
299299
return (
300300
<MessageDetails
301301
{...activeThread}
302-
allowAddingComment={ activeThread.allowComments }
302+
allowAddingComment={ activeThread.allowComments && !!currentMemberRole }
303303
onLoadMoreMessages={this.onShowAllComments.bind(this, activeThread.id)}
304304
onNewMessageChange={this.onNewMessageChange}
305305
onAddNewMessage={ this.onAddNewMessage.bind(this, activeThread.id) }

0 commit comments

Comments
 (0)