From 814d2fc88d000c61b4430fa00cbadeb9674091c5 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 14 Nov 2016 13:48:28 -0500 Subject: Fixed websocket to properly logout when logged out from another tab (#4546) --- webapp/components/logged_in.jsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/logged_in.jsx b/webapp/components/logged_in.jsx index 4e7df0392..ec4ca2a6a 100644 --- a/webapp/components/logged_in.jsx +++ b/webapp/components/logged_in.jsx @@ -14,8 +14,6 @@ import {loadEmoji} from 'actions/emoji_actions.jsx'; import * as Utils from 'utils/utils.jsx'; import Constants from 'utils/constants.jsx'; -import {browserHistory} from 'react-router/es6'; - const BACKSPACE_CHAR = 8; import $ from 'jquery'; @@ -41,7 +39,7 @@ export default class LoggedIn extends React.Component { } console.log('detected logout from a different tab'); //eslint-disable-line no-console - browserHistory.push('/'); + GlobalActions.emitUserLoggedOutEvent('/', false); } if (e.originalEvent.key === '__login__' && e.originalEvent.storageArea === localStorage && e.originalEvent.newValue) { -- cgit v1.2.3-1-g7c22 From 3f19ccf1b1a6efdcc990cf8a0270ec4ffc0c6e22 Mon Sep 17 00:00:00 2001 From: enahum Date: Mon, 14 Nov 2016 21:35:34 -0300 Subject: PLT-4754 Fix RHS options menu (#4552) --- webapp/components/rhs_comment.jsx | 21 ++---------- webapp/components/rhs_dropdown.jsx | 61 +++++++++++++++++++++++++++++++++ webapp/components/rhs_dropdown_menu.jsx | 22 ++++++++++++ webapp/components/rhs_root_post.jsx | 19 ++-------- 4 files changed, 88 insertions(+), 35 deletions(-) create mode 100644 webapp/components/rhs_dropdown.jsx create mode 100644 webapp/components/rhs_dropdown_menu.jsx (limited to 'webapp/components') diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx index c7b005845..416c0fe4b 100644 --- a/webapp/components/rhs_comment.jsx +++ b/webapp/components/rhs_comment.jsx @@ -6,6 +6,7 @@ import FileAttachmentListContainer from './file_attachment_list_container.jsx'; import PendingPostOptions from 'components/post_view/components/pending_post_options.jsx'; import PostMessageContainer from 'components/post_view/components/post_message_container.jsx'; import ProfilePicture from 'components/profile_picture.jsx'; +import RhsDropdown from 'components/rhs_dropdown.jsx'; import TeamStore from 'stores/team_store.jsx'; import UserStore from 'stores/user_store.jsx'; @@ -218,24 +219,8 @@ export default class RhsComment extends React.Component { } return ( -
-
+ + {this.props.dropdownContents} + + + ); + } +} + +RhsDropdown.propTypes = { + dropdownContents: React.PropTypes.array.isRequired +}; diff --git a/webapp/components/rhs_dropdown_menu.jsx b/webapp/components/rhs_dropdown_menu.jsx new file mode 100644 index 000000000..6efaa9dea --- /dev/null +++ b/webapp/components/rhs_dropdown_menu.jsx @@ -0,0 +1,22 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import {Dropdown} from 'react-bootstrap'; +import React from 'react'; + +export default class RhsDropdownMenu extends Dropdown.Menu { + constructor(props) { //eslint-disable-line no-useless-constructor + super(props); + } + + render() { + return ( +
+ {super.render()} +
+ ); + } +} diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx index aa663bda7..0dae5976f 100644 --- a/webapp/components/rhs_root_post.jsx +++ b/webapp/components/rhs_root_post.jsx @@ -6,6 +6,7 @@ import PostBodyAdditionalContent from 'components/post_view/components/post_body import PostMessageContainer from 'components/post_view/components/post_message_container.jsx'; import FileAttachmentListContainer from './file_attachment_list_container.jsx'; import ProfilePicture from 'components/profile_picture.jsx'; +import RhsDropdown from 'components/rhs_dropdown.jsx'; import ChannelStore from 'stores/channel_store.jsx'; import UserStore from 'stores/user_store.jsx'; @@ -228,23 +229,7 @@ export default class RhsRootPost extends React.Component { var rootOptions = ''; if (dropdownContents.length > 0) { rootOptions = ( -
-