summaryrefslogtreecommitdiffstats
path: root/webapp/components
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-11-14 07:09:41 -0500
committerChristopher Speller <crspeller@gmail.com>2016-11-14 07:09:41 -0500
commit323ce8b203c570ed6a1dd57b44d6637ad8207616 (patch)
treeefc3c61b905244bdb0e1ace0ce9f5ae4876644ad /webapp/components
parentd1207d34c1d99eba9ebf85c98d267ee7e955ea7d (diff)
parentb55ec6148caa93d54b660afe55408c643d217108 (diff)
downloadchat-323ce8b203c570ed6a1dd57b44d6637ad8207616.tar.gz
chat-323ce8b203c570ed6a1dd57b44d6637ad8207616.tar.bz2
chat-323ce8b203c570ed6a1dd57b44d6637ad8207616.zip
Merge branch 'release-3.5'
Diffstat (limited to 'webapp/components')
-rw-r--r--webapp/components/admin_console/admin_team_members_dropdown.jsx1
-rw-r--r--webapp/components/logged_in.jsx2
-rw-r--r--webapp/components/member_list_team.jsx11
-rw-r--r--webapp/components/more_direct_channels.jsx12
-rw-r--r--webapp/components/navbar.jsx10
-rw-r--r--webapp/components/needs_team.jsx2
-rw-r--r--webapp/components/post_view/components/post_list.jsx14
-rw-r--r--webapp/components/search_bar.jsx3
-rw-r--r--webapp/components/sidebar.jsx4
-rw-r--r--webapp/components/suggestion/suggestion_box.jsx13
-rw-r--r--webapp/components/user_settings/user_settings_security.jsx3
11 files changed, 49 insertions, 26 deletions
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();
},
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
diff --git a/webapp/components/member_list_team.jsx b/webapp/components/member_list_team.jsx
index d899bb8a4..a48283b96 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);
}
);
diff --git a/webapp/components/more_direct_channels.jsx b/webapp/components/more_direct_channels.jsx
index f672cb617..50ab5224a 100644
--- a/webapp/components/more_direct_channels.jsx
+++ b/webapp/components/more_direct_channels.jsx
@@ -38,6 +38,7 @@ export default class MoreDirectChannels extends React.Component {
users: null,
loadingDMChannel: -1,
listType: 'team',
+ show: true,
search: false
};
}
@@ -60,15 +61,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) {
@@ -220,7 +223,7 @@ export default class MoreDirectChannels extends React.Component {
return (
<Modal
dialogClassName='more-modal more-direct-channels'
- show={this.props.show}
+ show={this.state.show}
onHide={this.handleHide}
onExited={this.handleExit}
>
@@ -262,6 +265,5 @@ export default class MoreDirectChannels extends React.Component {
}
MoreDirectChannels.propTypes = {
- show: React.PropTypes.bool.isRequired,
onModalDismissed: React.PropTypes.func
};
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}
+ <div
+ className='close visible-xs-block'
+ onClick={() => this.refs.headerOverlay.hide()}
+ >
+ {'×'}
+ </div>
</ul>
</div>
</div>
@@ -671,7 +677,7 @@ export default class Navbar extends React.Component {
options={{singleline: true, mentionHighlight: false}}
/>
<div
- className='close__icon visible-xs-block'
+ className='close visible-xs-block'
onClick={() => this.refs.headerOverlay.hide()}
>
{'×'}
@@ -721,7 +727,7 @@ export default class Navbar extends React.Component {
/>
</div>
<div
- className='close__icon visible-xs-block'
+ className='close visible-xs-block'
onClick={() => this.refs.headerOverlay.hide()}
>
{'×'}
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() {
diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx
index 1142197c6..a0cfb208e 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;
@@ -271,9 +272,14 @@ export default class PostList extends React.Component {
commentRootId = post.id;
}
- for (const postId in posts) {
- if (posts[postId].root_id === commentRootId) {
- commentCount += 1;
+ if (commentRootId) {
+ for (const postId in posts) {
+ if (posts[postId].root_id === commentRootId) {
+ commentCount += 1;
+ if (posts[postId].user_id === userId) {
+ shouldHighlightThreads = true;
+ }
+ }
}
}
@@ -281,7 +287,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;
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});
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) {
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 (
- <div>
+ <div ref='container'>
{textbox}
<SuggestionListComponent
suggestionId={this.suggestionId}
@@ -239,6 +245,5 @@ SuggestionBox.propTypes = {
// explicitly name any input event handlers we override and need to manually call
onChange: React.PropTypes.func,
- onBlur: React.PropTypes.func,
onKeyDown: React.PropTypes.func
};
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();
}