From 40e8fbaa626cbb34e2bb0f9317511c68c93d4044 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 8 Nov 2016 09:58:17 -0500 Subject: Fix switching to DMs from more DM list (#4494) --- webapp/components/more_direct_channels.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/more_direct_channels.jsx b/webapp/components/more_direct_channels.jsx index 7c61d2f2e..4cb7db28a 100644 --- a/webapp/components/more_direct_channels.jsx +++ b/webapp/components/more_direct_channels.jsx @@ -39,6 +39,7 @@ export default class MoreDirectChannels extends React.Component { users: null, loadingDMChannel: -1, listType: 'team', + show: true, search: false }; } @@ -61,15 +62,17 @@ export default class MoreDirectChannels extends React.Component { } handleHide() { - if (this.props.onModalDismissed) { - this.props.onModalDismissed(); - } + this.setState({show: false}); } handleExit() { if (this.exitToDirectChannel) { browserHistory.push(this.exitToDirectChannel); } + + if (this.props.onModalDismissed) { + this.props.onModalDismissed(); + } } handleShowDirectChannel(teammate, e) { @@ -226,7 +229,7 @@ export default class MoreDirectChannels extends React.Component { return ( @@ -269,6 +272,5 @@ export default class MoreDirectChannels extends React.Component { } MoreDirectChannels.propTypes = { - show: React.PropTypes.bool.isRequired, onModalDismissed: React.PropTypes.func }; -- cgit v1.2.3-1-g7c22 From 5fe2d782115ec6faf9ac743f5999a786126a3251 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 8 Nov 2016 09:59:14 -0500 Subject: Fixing loading of team members for dm list (#4477) --- webapp/components/sidebar.jsx | 4 ---- 1 file changed, 4 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 626ac2866..5c6645833 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -19,7 +19,6 @@ import * as AsyncClient from 'utils/async_client.jsx'; import * as Utils from 'utils/utils.jsx'; import * as ChannelUtils from 'utils/channel_utils.jsx'; import * as ChannelActions from 'actions/channel_actions.jsx'; -import {loadProfilesAndTeamMembersForDMSidebar} from 'actions/user_actions.jsx'; import Constants from 'utils/constants.jsx'; @@ -125,9 +124,6 @@ export default class Sidebar extends React.Component { document.addEventListener('keydown', this.navigateChannelShortcut); document.addEventListener('keydown', this.navigateUnreadChannelShortcut); - - loadProfilesAndTeamMembersForDMSidebar(); - AsyncClient.getMyChannelMembers(); } shouldComponentUpdate(nextProps, nextState) { -- cgit v1.2.3-1-g7c22 From 376f7c6f0e06baeffc8642de1685abf2ced70aa3 Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 8 Nov 2016 11:59:27 -0300 Subject: PLT-4649 reply threads highlight (#4479) --- webapp/components/post_view/components/post_list.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'webapp/components') diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx index 1142197c6..400f516cc 100644 --- a/webapp/components/post_view/components/post_list.jsx +++ b/webapp/components/post_view/components/post_list.jsx @@ -264,6 +264,7 @@ export default class PostList extends React.Component { let commentCount = 0; let isCommentMention = false; + let shouldHighlightThreads = false; let commentRootId; if (parentPost) { commentRootId = post.root_id; @@ -274,6 +275,9 @@ export default class PostList extends React.Component { for (const postId in posts) { if (posts[postId].root_id === commentRootId) { commentCount += 1; + if (posts[postId].user_id === userId) { + shouldHighlightThreads = true; + } } } @@ -281,7 +285,7 @@ export default class PostList extends React.Component { const commentsNotifyLevel = this.props.currentUser.notify_props.comments || 'never'; const notCurrentUser = post.user_id !== userId || (post.props && post.props.from_webhook); if (notCurrentUser) { - if (commentsNotifyLevel === 'any') { + if (commentsNotifyLevel === 'any' && (posts[commentRootId].user_id === userId || shouldHighlightThreads)) { isCommentMention = true; } else if (commentsNotifyLevel === 'root' && posts[commentRootId].user_id === userId) { isCommentMention = true; -- cgit v1.2.3-1-g7c22 From 707b01e1ab8e32cd9006f6ded2c00665b9fb69c5 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 8 Nov 2016 09:59:40 -0500 Subject: Don't count inactive users on statistic pages (#4482) --- webapp/components/admin_console/admin_team_members_dropdown.jsx | 1 + 1 file changed, 1 insertion(+) (limited to 'webapp/components') diff --git a/webapp/components/admin_console/admin_team_members_dropdown.jsx b/webapp/components/admin_console/admin_team_members_dropdown.jsx index dffc0573a..0331e6c4e 100644 --- a/webapp/components/admin_console/admin_team_members_dropdown.jsx +++ b/webapp/components/admin_console/admin_team_members_dropdown.jsx @@ -81,6 +81,7 @@ export default class AdminTeamMembersDropdown extends React.Component { this.props.teamMember.team_id, this.props.user.id, () => { + AsyncClient.getTeamStats(this.props.teamMember.team_id); UserStore.removeProfileFromTeam(this.props.teamMember.team_id, this.props.user.id); UserStore.emitInTeamChange(); }, -- cgit v1.2.3-1-g7c22 From 13dcccc60bba90f0883aae63e72aac896a6f553c Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 8 Nov 2016 11:47:42 -0500 Subject: PLT-4205 Fixed pending posts always being considered as part of a post thread (#4488) --- webapp/components/post_view/components/post_list.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx index 400f516cc..a0cfb208e 100644 --- a/webapp/components/post_view/components/post_list.jsx +++ b/webapp/components/post_view/components/post_list.jsx @@ -272,11 +272,13 @@ export default class PostList extends React.Component { commentRootId = post.id; } - for (const postId in posts) { - if (posts[postId].root_id === commentRootId) { - commentCount += 1; - if (posts[postId].user_id === userId) { - shouldHighlightThreads = true; + if (commentRootId) { + for (const postId in posts) { + if (posts[postId].root_id === commentRootId) { + commentCount += 1; + if (posts[postId].user_id === userId) { + shouldHighlightThreads = true; + } } } } -- cgit v1.2.3-1-g7c22 From 4b3eceee7015af12750e6f73f11bb0969c8d5c41 Mon Sep 17 00:00:00 2001 From: Kai Faust Date: Wed, 9 Nov 2016 06:40:24 -0800 Subject: PLT-4602 Fix misaligned close button and fix Android icon rendering bug (#4492) * PLT-4602 Fix horizontal alignment for .close__button Reduce negative left margin to fix miscalculated center-positioning. * PLT-4602 Fix dropdown close icon rendering bug on Android The combination of using a unicode character and a pseudo element was too problematic, so I added a new custom icon svg CLOSE_ICON that renders consistently on all browsers. * PLT-4602 Use font-family fix, remove You were correct @hmhealey, the problem was that the unicode characters were rendering as different fonts: Open Sans and Helvetica Neue! --- webapp/components/navbar.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index 9721ddee1..d71fec945 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -546,6 +546,12 @@ export default class Navbar extends React.Component { {deleteChannelOption} {leaveChannelOption} {toggleFavoriteOption} +
this.refs.headerOverlay.hide()} + > + {'×'} +
@@ -671,7 +677,7 @@ export default class Navbar extends React.Component { options={{singleline: true, mentionHighlight: false}} />
this.refs.headerOverlay.hide()} > {'×'} @@ -721,7 +727,7 @@ export default class Navbar extends React.Component { />
this.refs.headerOverlay.hide()} > {'×'} -- cgit v1.2.3-1-g7c22 From daf0490bbf4d382b53d23e2fd0938aa7658bb368 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 9 Nov 2016 10:03:06 -0500 Subject: Fix status interval not clearing after logout (#4507) --- webapp/components/needs_team.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webapp/components') diff --git a/webapp/components/needs_team.jsx b/webapp/components/needs_team.jsx index e210fcbee..014d6c93e 100644 --- a/webapp/components/needs_team.jsx +++ b/webapp/components/needs_team.jsx @@ -81,7 +81,6 @@ export default class NeedsTeam extends React.Component { if (tutorialStep <= TutorialSteps.INTRO_SCREENS) { browserHistory.push(TeamStore.getCurrentTeamRelativeUrl() + '/tutorial'); } - stopPeriodicStatusUpdates(); } componentDidMount() { @@ -132,6 +131,7 @@ export default class NeedsTeam extends React.Component { if (UserAgent.isIosSafari()) { iNoBounce.disable(); } + stopPeriodicStatusUpdates(); } render() { -- cgit v1.2.3-1-g7c22 From 8c76560b4849f8d1fdc3c3f1c2f1877459a30fca Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 10 Nov 2016 09:22:06 -0500 Subject: Fix websocket on old versions of IE11 (#4501) --- webapp/components/logged_in.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webapp/components') diff --git a/webapp/components/logged_in.jsx b/webapp/components/logged_in.jsx index 824e7b91d..4e7df0392 100644 --- a/webapp/components/logged_in.jsx +++ b/webapp/components/logged_in.jsx @@ -105,7 +105,7 @@ export default class LoggedIn extends React.Component { } componentDidMount() { - // Initalize websocket + // Initialize websocket WebSocketActions.initialize(); // Listen for user -- cgit v1.2.3-1-g7c22 From b46ced78def34f81742072c493992afff62c6fb7 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 10 Nov 2016 09:25:00 -0500 Subject: If email accounts are disabled, allow email users to switch account type to one of the available types (#4517) --- webapp/components/user_settings/user_settings_security.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'webapp/components') diff --git a/webapp/components/user_settings/user_settings_security.jsx b/webapp/components/user_settings/user_settings_security.jsx index 617acb7f5..0cee3dfca 100644 --- a/webapp/components/user_settings/user_settings_security.jsx +++ b/webapp/components/user_settings/user_settings_security.jsx @@ -928,8 +928,9 @@ export default class SecurityTab extends React.Component { numMethods = config.EnableLdap === 'true' ? numMethods + 1 : numMethods; numMethods = config.EnableSaml === 'true' ? numMethods + 1 : numMethods; + // If there are other sign-in methods and either email is enabled or the user's account is email, then allow switching let signInSection; - if (config.EnableSignUpWithEmail === 'true' && numMethods > 0) { + if ((config.EnableSignUpWithEmail === 'true' || user.auth_service === '') && numMethods > 0) { signInSection = this.createSignInSection(); } -- cgit v1.2.3-1-g7c22 From 2fdb33042a118831de60d96e7138209e973e0d65 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 10 Nov 2016 09:25:43 -0500 Subject: Load profiles for search results (#4519) --- webapp/components/search_bar.jsx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'webapp/components') diff --git a/webapp/components/search_bar.jsx b/webapp/components/search_bar.jsx index 5cc0e7c23..3ddc192d9 100644 --- a/webapp/components/search_bar.jsx +++ b/webapp/components/search_bar.jsx @@ -13,6 +13,7 @@ import SearchSuggestionList from './suggestion/search_suggestion_list.jsx'; import SearchUserProvider from './suggestion/search_user_provider.jsx'; import * as Utils from 'utils/utils.jsx'; import Constants from 'utils/constants.jsx'; +import {loadProfilesForPosts} from 'actions/post_actions.jsx'; import {FormattedMessage, FormattedHTMLMessage} from 'react-intl'; @@ -129,6 +130,8 @@ export default class SearchBar extends React.Component { results: data, is_mention_search: isMentionSearch }); + + loadProfilesForPosts(data.posts); }, (err) => { this.setState({isSearching: false}); -- cgit v1.2.3-1-g7c22 From 03e3ac60c20bfc93752f9e57cdd5dec1cf397fa5 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 10 Nov 2016 17:00:14 -0500 Subject: PLT-4600 Properly clear autocomplete suggestions when suggestions are out of date (#4529) * PLT-4600 Better clear autocomplete suggestions when suggestions are out of date * Fixed react warnings and removed an eslint ignore --- webapp/components/suggestion/suggestion_box.jsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/suggestion/suggestion_box.jsx b/webapp/components/suggestion/suggestion_box.jsx index 464e57ef2..eeae5ba28 100644 --- a/webapp/components/suggestion/suggestion_box.jsx +++ b/webapp/components/suggestion/suggestion_box.jsx @@ -2,7 +2,6 @@ // See License.txt for license information. import $ from 'jquery'; -import ReactDOM from 'react-dom'; import Constants from 'utils/constants.jsx'; import * as GlobalActions from 'actions/global_actions.jsx'; @@ -37,6 +36,13 @@ export default class SuggestionBox extends React.Component { SuggestionStore.addPretextChangedListener(this.suggestionId, this.handlePretextChanged); } + componentWillReceiveProps(nextProps) { + // Clear any suggestions when the SuggestionBox is cleared + if (nextProps.value === '' && this.props.value !== nextProps.value) { + GlobalActions.emitClearSuggestions(this.suggestionId); + } + } + componentWillUnmount() { SuggestionStore.removeCompleteWordListener(this.suggestionId, this.handleCompleteWord); SuggestionStore.removePretextChangedListener(this.suggestionId, this.handlePretextChanged); @@ -64,7 +70,7 @@ export default class SuggestionBox extends React.Component { return; } - const container = $(ReactDOM.findDOMNode(this)); + const container = $(this.refs.container); if (!(container.is(e.target) || container.has(e.target).length > 0)) { // We can't just use blur for this because it fires and hides the children before @@ -198,7 +204,7 @@ export default class SuggestionBox extends React.Component { const SuggestionListComponent = listComponent; return ( -
+
{textbox} Date: Thu, 10 Nov 2016 17:00:19 -0500 Subject: Fixing team members dialog not updating while searching. (#4524) --- webapp/components/member_list_team.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/member_list_team.jsx b/webapp/components/member_list_team.jsx index 8b23b650b..4795604e3 100644 --- a/webapp/components/member_list_team.jsx +++ b/webapp/components/member_list_team.jsx @@ -32,6 +32,7 @@ export default class MemberListTeam extends React.Component { teamMembers: Object.assign([], TeamStore.getMembersInTeam()), total: stats.total_member_count, search: false, + term: '', loading: true }; } @@ -39,7 +40,7 @@ export default class MemberListTeam extends React.Component { componentDidMount() { UserStore.addInTeamChangeListener(this.onChange); UserStore.addStatusesChangeListener(this.onChange); - TeamStore.addChangeListener(this.onChange); + TeamStore.addChangeListener(this.onChange.bind(null, true)); TeamStore.addStatsChangeListener(this.onStatsChange); loadProfilesAndTeamMembers(0, Constants.PROFILE_CHUNK_SIZE, TeamStore.getCurrentId(), this.loadComplete); @@ -60,6 +61,9 @@ export default class MemberListTeam extends React.Component { onChange(force) { if (this.state.search && !force) { return; + } else if (this.state.search) { + this.search(this.state.term); + return; } this.setState({users: UserStore.getProfileListInTeam(), teamMembers: Object.assign([], TeamStore.getMembersInTeam())}); @@ -76,8 +80,7 @@ export default class MemberListTeam extends React.Component { search(term) { if (term === '') { - this.onChange(true); - this.setState({search: false}); + this.setState({search: false, term, users: UserStore.getProfileListInTeam(), teamMembers: Object.assign([], TeamStore.getMembersInTeam())}); return; } @@ -86,7 +89,7 @@ export default class MemberListTeam extends React.Component { TeamStore.getCurrentId(), {}, (users) => { - this.setState({loading: true, search: true, users}); + this.setState({loading: true, search: true, users, term, teamMembers: Object.assign([], TeamStore.getMembersInTeam())}); loadTeamMembersForProfilesList(users, TeamStore.getCurrentId(), this.loadComplete); } ); -- cgit v1.2.3-1-g7c22 From 29efeff09532397a33bb971e91324f673b296559 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Sat, 12 Nov 2016 00:54:53 +0500 Subject: PLT-4609 - Fixing list modals on mobile (#4536) * PLT-4609 - Fixing list modals on mobile * PLT-4609 - Adjust more modal height --- webapp/components/channel_invite_modal.jsx | 6 ------ webapp/components/channel_members_modal.jsx | 7 ------- webapp/components/member_list_team.jsx | 2 -- webapp/components/more_channels.jsx | 10 +--------- webapp/components/more_direct_channels.jsx | 7 ------- webapp/components/searchable_user_list.jsx | 6 +----- webapp/components/team_members_modal.jsx | 7 ------- 7 files changed, 2 insertions(+), 43 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/channel_invite_modal.jsx b/webapp/components/channel_invite_modal.jsx index 89185435a..cffc73705 100644 --- a/webapp/components/channel_invite_modal.jsx +++ b/webapp/components/channel_invite_modal.jsx @@ -11,7 +11,6 @@ import TeamStore from 'stores/team_store.jsx'; import {searchUsers} from 'actions/user_actions.jsx'; -import * as Utils from 'utils/utils.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import React from 'react'; @@ -133,13 +132,8 @@ export default class ChannelInviteModal extends React.Component { if (this.state.loading) { content = (); } else { - let maxHeight = 1000; - if (Utils.windowHeight() <= 1200) { - maxHeight = Utils.windowHeight() - 300; - } content = ( ); } else { - let maxHeight = 1000; - if (Utils.windowHeight() <= 1200) { - maxHeight = Utils.windowHeight() - 300; - } - let removeButton = null; if (this.props.isAdmin) { removeButton = [this.createRemoveMemberButton]; @@ -156,7 +150,6 @@ export default class ChannelMembersModal extends React.Component { content = (
; @@ -204,10 +199,7 @@ export default class MoreChannels extends React.Component { onModalDismissed={() => this.setState({showNewChannelModal: false})} />
-
+
{moreChannels} {serverError}
diff --git a/webapp/components/more_direct_channels.jsx b/webapp/components/more_direct_channels.jsx index 4cb7db28a..50ab5224a 100644 --- a/webapp/components/more_direct_channels.jsx +++ b/webapp/components/more_direct_channels.jsx @@ -12,7 +12,6 @@ import TeamStore from 'stores/team_store.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import * as UserAgent from 'utils/user_agent.jsx'; -import * as Utils from 'utils/utils.jsx'; import Constants from 'utils/constants.jsx'; import React from 'react'; @@ -185,11 +184,6 @@ export default class MoreDirectChannels extends React.Component { } render() { - let maxHeight = 1000; - if (Utils.windowHeight() <= 1200) { - maxHeight = Utils.windowHeight() - 300; - } - let teamToggle; if (global.window.mm_config.RestrictDirectMessage === 'any') { teamToggle = ( @@ -245,7 +239,6 @@ export default class MoreDirectChannels extends React.Component { {teamToggle} +
-- cgit v1.2.3-1-g7c22