From ab67f6e257f6e8f08145a02a7b93550f99641be4 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Sun, 18 Jun 2017 14:42:32 -0400 Subject: 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 --- .../components/file_attachment_list_container.jsx | 92 ---------------------- 1 file changed, 92 deletions(-) delete mode 100644 webapp/components/file_attachment_list_container.jsx (limited to 'webapp/components/file_attachment_list_container.jsx') 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 ( - - ); - } -} -- cgit v1.2.3-1-g7c22