diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-05-17 12:27:03 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-17 12:27:03 -0400 |
commit | 0fe75cb7826944a3352705d5e78eba1d12cc213a (patch) | |
tree | e7391d4540f42c9dea23631217b8823db43d632e /webapp/components | |
parent | 5580c28e54015b78893c33cc3bf41da75712c4cb (diff) | |
download | chat-0fe75cb7826944a3352705d5e78eba1d12cc213a.tar.gz chat-0fe75cb7826944a3352705d5e78eba1d12cc213a.tar.bz2 chat-0fe75cb7826944a3352705d5e78eba1d12cc213a.zip |
PLT-1909 Removed the ability to edit system posts (#3013)
* Removed the ability to edit system posts
* Added increased timeout to SpinnerButton unit tests
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/post_info.jsx | 3 | ||||
-rw-r--r-- | webapp/components/rhs_comment.jsx | 3 | ||||
-rw-r--r-- | webapp/components/rhs_root_post.jsx | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/webapp/components/post_info.jsx b/webapp/components/post_info.jsx index f86c63fd7..ed316745f 100644 --- a/webapp/components/post_info.jsx +++ b/webapp/components/post_info.jsx @@ -33,6 +33,7 @@ export default class PostInfo extends React.Component { var post = this.props.post; var isOwner = this.props.currentUser.id === post.user_id; var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser(); + const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX); if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING || Utils.isPostEphemeral(post)) { return ''; @@ -108,7 +109,7 @@ export default class PostInfo extends React.Component { ); } - if (isOwner) { + if (isOwner && !isSystemMessage) { dropdownContents.push( <li key='editPost' diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx index 5097e0573..c4b62efcf 100644 --- a/webapp/components/rhs_comment.jsx +++ b/webapp/components/rhs_comment.jsx @@ -85,6 +85,7 @@ export default class RhsComment extends React.Component { const isOwner = this.props.currentUser.id === post.user_id; var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser(); + const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX); var dropdownContents = []; @@ -107,7 +108,7 @@ export default class RhsComment extends React.Component { ); } - if (isOwner) { + if (isOwner && !isSystemMessage) { dropdownContents.push( <li role='presentation' diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx index 849971864..f82948726 100644 --- a/webapp/components/rhs_root_post.jsx +++ b/webapp/components/rhs_root_post.jsx @@ -41,6 +41,7 @@ export default class RhsRootPost extends React.Component { const user = this.props.user; var isOwner = this.props.currentUser.id === post.user_id; var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser(); + const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX); var timestamp = UserStore.getProfile(post.user_id).update_at; var channel = ChannelStore.get(post.channel_id); @@ -94,7 +95,7 @@ export default class RhsRootPost extends React.Component { ); } - if (isOwner) { + if (isOwner && !isSystemMessage) { dropdownContents.push( <li key='rhs-root-edit' |