From 6399a94ce221be3d15e7132654c28cd953075ec6 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Fri, 27 May 2016 16:01:28 -0400 Subject: [PATCH] PLT-2672 Refactored posts view with caching (#3054) * Refactored posts view to use view controller design * Add post view caching * Required updates after rebase * Fixed bug where current channel not set yet was causing breakage --- webapp/components/channel_view.jsx | 4 +- webapp/components/permalink_view.jsx | 4 +- .../components}/floating_timestamp.jsx | 0 .../components/pending_post_options.jsx} | 6 +- .../{ => post_view/components}/post.jsx | 41 +- .../components}/post_attachment.jsx | 0 .../components}/post_attachment_list.jsx | 0 .../components}/post_attachment_oembed.jsx | 0 .../{ => post_view/components}/post_body.jsx | 6 +- .../post_body_additional_content.jsx | 2 +- .../components}/post_header.jsx | 7 +- .../{ => post_view/components}/post_image.jsx | 0 .../{ => post_view/components}/post_info.jsx | 2 +- .../components/post_list.jsx} | 350 ++++++------------ .../{ => post_view/components}/providers.json | 0 .../components/scroll_to_bottom_arrows.jsx | 37 ++ .../post_focus_view_controller.jsx} | 85 +++-- .../components/post_view/post_view_cache.jsx | 85 +++++ .../post_view/post_view_controller.jsx | 264 +++++++++++++ webapp/components/posts_view_container.jsx | 217 ----------- webapp/components/rhs_comment.jsx | 4 +- webapp/components/rhs_root_post.jsx | 12 +- webapp/components/search_results_item.jsx | 3 +- webapp/stores/notification_store.jsx | 3 +- webapp/utils/constants.jsx | 14 +- webapp/utils/post_utils.jsx | 32 ++ webapp/utils/utils.jsx | 28 +- 27 files changed, 646 insertions(+), 560 deletions(-) rename webapp/components/{ => post_view/components}/floating_timestamp.jsx (100%) rename webapp/components/{pending_post_actions.jsx => post_view/components/pending_post_options.jsx} (94%) rename webapp/components/{ => post_view/components}/post.jsx (84%) rename webapp/components/{ => post_view/components}/post_attachment.jsx (100%) rename webapp/components/{ => post_view/components}/post_attachment_list.jsx (100%) rename webapp/components/{ => post_view/components}/post_attachment_oembed.jsx (100%) rename webapp/components/{ => post_view/components}/post_body.jsx (96%) rename webapp/components/{ => post_view/components}/post_body_additional_content.jsx (98%) rename webapp/components/{ => post_view/components}/post_header.jsx (94%) rename webapp/components/{ => post_view/components}/post_image.jsx (100%) rename webapp/components/{ => post_view/components}/post_info.jsx (99%) rename webapp/components/{posts_view.jsx => post_view/components/post_list.jsx} (61%) rename webapp/components/{ => post_view/components}/providers.json (100%) create mode 100644 webapp/components/post_view/components/scroll_to_bottom_arrows.jsx rename webapp/components/{post_focus_view.jsx => post_view/post_focus_view_controller.jsx} (56%) create mode 100644 webapp/components/post_view/post_view_cache.jsx create mode 100644 webapp/components/post_view/post_view_controller.jsx delete mode 100644 webapp/components/posts_view_container.jsx create mode 100644 webapp/utils/post_utils.jsx diff --git a/webapp/components/channel_view.jsx b/webapp/components/channel_view.jsx index 6511d960a8..ff101bca7f 100644 --- a/webapp/components/channel_view.jsx +++ b/webapp/components/channel_view.jsx @@ -7,7 +7,7 @@ import React from 'react'; import ChannelHeader from 'components/channel_header.jsx'; import FileUploadOverlay from 'components/file_upload_overlay.jsx'; import CreatePost from 'components/create_post.jsx'; -import PostsViewContainer from 'components/posts_view_container.jsx'; +import PostViewCache from 'components/post_view/post_view_cache.jsx'; import ChannelStore from 'stores/channel_store.jsx'; @@ -70,7 +70,7 @@ export default class ChannelView extends React.Component { - +
- +