diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-06-18 14:42:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-18 14:42:32 -0400 |
commit | ab67f6e257f6e8f08145a02a7b93550f99641be4 (patch) | |
tree | d33d1c58a3d229f7e37db58bc2c397ac3806c503 /webapp/components/rhs_root_post.jsx | |
parent | 0231e95f1c5a8c42ba97875f0d2301815f552974 (diff) | |
download | chat-ab67f6e257f6e8f08145a02a7b93550f99641be4.tar.gz chat-ab67f6e257f6e8f08145a02a7b93550f99641be4.tar.bz2 chat-ab67f6e257f6e8f08145a02a7b93550f99641be4.zip |
PLT-6215 Major post list refactor (#6501)
* Major post list refactor
* Fix post and thread deletion
* Fix preferences not selecting correctly
* Fix military time displaying
* Fix UP key for editing posts
* Fix ESLint error
* Various fixes and updates per feedback
* Fix for permalink view
* Revert to old scrolling method and various fixes
* Add floating timestamp, new message indicator, scroll arrows
* Update post loading for focus mode and add visibility limit
* Fix pinning posts and a react warning
* Add loading UI updates from Asaad
* Fix refreshing loop
* Temporarily bump post visibility limit
* Update infinite scrolling
* Remove infinite scrolling
Diffstat (limited to 'webapp/components/rhs_root_post.jsx')
-rw-r--r-- | webapp/components/rhs_root_post.jsx | 63 |
1 files changed, 12 insertions, 51 deletions
diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx index c617477af..8f464056b 100644 --- a/webapp/components/rhs_root_post.jsx +++ b/webapp/components/rhs_root_post.jsx @@ -2,50 +2,38 @@ // See License.txt for license information. import UserProfile from './user_profile.jsx'; -import PostBodyAdditionalContent from 'components/post_view/components/post_body_additional_content.jsx'; -import PostMessageContainer from 'components/post_view/components/post_message_container.jsx'; -import FileAttachmentListContainer from './file_attachment_list_container.jsx'; +import PostBodyAdditionalContent from 'components/post_view/post_body_additional_content.jsx'; +import PostMessageContainer from 'components/post_view/post_message_view'; +import FileAttachmentListContainer from 'components/file_attachment_list'; import ProfilePicture from 'components/profile_picture.jsx'; -import ReactionListContainer from 'components/post_view/components/reaction_list_container.jsx'; -import PostFlagIcon from 'components/common/post_flag_icon.jsx'; -import DotMenu from 'components/dot_menu/dot_menu.jsx'; +import ReactionListContainer from 'components/post_view/reaction_list'; +import PostFlagIcon from 'components/post_view/post_flag_icon.jsx'; +import DotMenu from 'components/dot_menu'; +import EmojiPickerOverlay from 'components/emoji_picker/emoji_picker_overlay.jsx'; import ChannelStore from 'stores/channel_store.jsx'; import UserStore from 'stores/user_store.jsx'; import TeamStore from 'stores/team_store.jsx'; -import * as GlobalActions from 'actions/global_actions.jsx'; -import {flagPost, unflagPost, pinPost, unpinPost, addReaction} from 'actions/post_actions.jsx'; +import {addReaction} from 'actions/post_actions.jsx'; import * as Utils from 'utils/utils.jsx'; import * as PostUtils from 'utils/post_utils.jsx'; -import EmojiPickerOverlay from 'components/emoji_picker/emoji_picker_overlay.jsx'; - import Constants from 'utils/constants.jsx'; -import DelayedAction from 'utils/delayed_action.jsx'; - -import {FormattedMessage} from 'react-intl'; - -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {Link} from 'react-router/es6'; +import {FormattedMessage} from 'react-intl'; export default class RhsRootPost extends React.Component { constructor(props) { super(props); - this.handlePermalink = this.handlePermalink.bind(this); - this.flagPost = this.flagPost.bind(this); - this.unflagPost = this.unflagPost.bind(this); - this.pinPost = this.pinPost.bind(this); - this.unpinPost = this.unpinPost.bind(this); this.reactEmojiClick = this.reactEmojiClick.bind(this); this.handleDropdownOpened = this.handleDropdownOpened.bind(this); - this.editDisableAction = new DelayedAction(this.handleEditDisable); - this.state = { currentTeamDisplayName: TeamStore.getCurrent().name, width: '', @@ -68,11 +56,6 @@ export default class RhsRootPost extends React.Component { }); } - handlePermalink(e) { - e.preventDefault(); - GlobalActions.showGetPostLinkModal(this.props.post); - } - shouldComponentUpdate(nextProps, nextState) { if (nextProps.status !== this.props.status) { return true; @@ -121,16 +104,6 @@ export default class RhsRootPost extends React.Component { return false; } - flagPost(e) { - e.preventDefault(); - flagPost(this.props.post.id); - } - - unflagPost(e) { - e.preventDefault(); - unflagPost(this.props.post.id); - } - timeTag(post, timeOptions) { return ( <time @@ -156,16 +129,6 @@ export default class RhsRootPost extends React.Component { ); } - pinPost(e) { - e.preventDefault(); - pinPost(this.props.post.channel_id, this.props.post.id); - } - - unpinPost(e) { - e.preventDefault(); - unpinPost(this.props.post.channel_id, this.props.post.id); - } - toggleEmojiPicker = () => { const showEmojiPicker = !this.state.showEmojiPicker; @@ -220,7 +183,6 @@ export default class RhsRootPost extends React.Component { var channel = ChannelStore.get(post.channel_id); const isEphemeral = Utils.isPostEphemeral(post); - const isPending = post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING; const isSystemMessage = PostUtils.isSystemMessage(post); var channelName; @@ -238,7 +200,8 @@ export default class RhsRootPost extends React.Component { } let react; - if (!isEphemeral && !isPending && !isSystemMessage && Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMOJI_PICKER_PREVIEW)) { + + if (!isEphemeral && !post.failed && !isSystemMessage && Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMOJI_PICKER_PREVIEW)) { react = ( <span> <EmojiPickerOverlay @@ -454,10 +417,8 @@ RhsRootPost.defaultProps = { }; RhsRootPost.propTypes = { post: PropTypes.object.isRequired, - lastPostCount: PropTypes.number, user: PropTypes.object.isRequired, currentUser: PropTypes.object.isRequired, - commentCount: PropTypes.number, compactDisplay: PropTypes.bool, useMilitaryTime: PropTypes.bool.isRequired, isFlagged: PropTypes.bool, |