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/file_attachment_list_container.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/file_attachment_list_container.jsx')
-rw-r--r-- | webapp/components/file_attachment_list_container.jsx | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/webapp/components/file_attachment_list_container.jsx b/webapp/components/file_attachment_list_container.jsx deleted file mode 100644 index 4b05e392c..000000000 --- a/webapp/components/file_attachment_list_container.jsx +++ /dev/null @@ -1,92 +0,0 @@ -import PropTypes from 'prop-types'; - -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import React from 'react'; - -import * as AsyncClient from 'utils/async_client.jsx'; -import FileStore from 'stores/file_store.jsx'; - -import FileAttachmentList from './file_attachment_list.jsx'; - -export default class FileAttachmentListContainer extends React.Component { - static propTypes = { - post: PropTypes.object.isRequired, - compactDisplay: PropTypes.bool.isRequired - } - - constructor(props) { - super(props); - - this.handleFileChange = this.handleFileChange.bind(this); - - this.state = { - fileInfos: FileStore.getInfosForPost(props.post.id) - }; - } - - componentDidMount() { - FileStore.addChangeListener(this.handleFileChange); - - if (this.props.post.id && !FileStore.hasInfosForPost(this.props.post.id)) { - AsyncClient.getFileInfosForPost(this.props.post.channel_id, this.props.post.id); - } - } - - componentWillReceiveProps(nextProps) { - if (nextProps.post.id !== this.props.post.id) { - this.setState({ - fileInfos: FileStore.getInfosForPost(nextProps.post.id) - }); - - if (nextProps.post.id && !FileStore.hasInfosForPost(nextProps.post.id)) { - AsyncClient.getFileInfosForPost(nextProps.post.channel_id, nextProps.post.id); - } - } - } - - shouldComponentUpdate(nextProps, nextState) { - if (this.props.post.id !== nextProps.post.id) { - return true; - } - - if (this.props.compactDisplay !== nextProps.compactDisplay) { - return true; - } - - // fileInfos are treated as immutable by the FileStore - if (nextState.fileInfos !== this.state.fileInfos) { - return true; - } - - return false; - } - - handleFileChange() { - this.setState({ - fileInfos: FileStore.getInfosForPost(this.props.post.id) - }); - } - - componentWillUnmount() { - FileStore.removeChangeListener(this.handleFileChange); - } - - render() { - let fileCount = 0; - if (this.props.post.file_ids) { - fileCount = this.props.post.file_ids.length; - } else if (this.props.post.filenames) { - fileCount = this.props.post.filenames.length; - } - - return ( - <FileAttachmentList - fileCount={fileCount} - fileInfos={this.state.fileInfos} - compactDisplay={this.props.compactDisplay} - /> - ); - } -} |