From 63c122bc028198704485e00cc47c7ba2218e9708 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Fri, 7 Apr 2017 14:21:58 -0400 Subject: PLT-6201/PLT-6220 Don't show pin or reaction options for system messages (#6010) * PLT-6220 Removed ability to react to system messages * PLT-6201 Removed ability to pin system messages --- webapp/components/rhs_root_post.jsx | 97 ++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 49 deletions(-) (limited to 'webapp/components/rhs_root_post.jsx') diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx index b298853d8..9a9f83f0c 100644 --- a/webapp/components/rhs_root_post.jsx +++ b/webapp/components/rhs_root_post.jsx @@ -182,18 +182,15 @@ export default class RhsRootPost extends React.Component { const mattermostLogo = Constants.MATTERMOST_ICON_SVG; var timestamp = user ? user.last_picture_update : 0; var channel = ChannelStore.get(post.channel_id); - let canReact = false; const flagIcon = Constants.FLAG_ICON_SVG; - if (post.state !== Constants.POST_FAILED && - post.state !== Constants.POST_LOADING && - !Utils.isPostEphemeral(post) && - Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMOJI_PICKER_PREVIEW)) { - canReact = true; - } this.canDelete = PostUtils.canDeletePost(post); this.canEdit = PostUtils.canEditPost(post, this.editDisableAction); + const isEphemeral = Utils.isPostEphemeral(post); + const isPending = post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING; + const isSystemMessage = PostUtils.isSystemMessage(post); + var type = 'Post'; if (post.root_id.length > 0) { type = 'Comment'; @@ -205,7 +202,7 @@ export default class RhsRootPost extends React.Component { } var systemMessageClass = ''; - if (PostUtils.isSystemMessage(post)) { + if (isSystemMessage) { systemMessageClass = 'post--system'; } @@ -226,7 +223,7 @@ export default class RhsRootPost extends React.Component { let react; let reactOverlay; - if (canReact) { + if (!isEphemeral && !isPending && !isSystemMessage && Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMOJI_PICKER_PREVIEW)) { react = ( - - - - - ); - - if (post.is_pinned) { + if (!isSystemMessage) { dropdownContents.push(
  • ); - } else { - dropdownContents.push( -
  • - - - -
  • - ); + + + + + ); + } else { + dropdownContents.push( +
  • + + + +
  • + ); + } } if (this.canDelete) { @@ -443,7 +442,7 @@ export default class RhsRootPost extends React.Component { } botIndicator =
  • {'BOT'}
  • ; - } else if (PostUtils.isSystemMessage(post)) { + } else if (isSystemMessage) { userProfile = (