diff --git a/web/react/components/file_attachment.jsx b/web/react/components/file_attachment.jsx
index c6dff6550..307c543a2 100644
--- a/web/react/components/file_attachment.jsx
+++ b/web/react/components/file_attachment.jsx
@@ -39,7 +39,7 @@ export default class FileAttachment extends React.Component {
if (type === 'image') {
var self = this; // Need this reference since we use the given "this"
- $('
').attr('src', fileInfo.path + '_thumb.jpg').load(function loadWrapper(path, name) {
+ $('
').attr('src', fileInfo.path + '_thumb.jpg?' + utils.getSessionIndex()).load(function loadWrapper(path, name) {
return function loader() {
$(this).remove();
if (name in self.refs) {
@@ -62,7 +62,7 @@ export default class FileAttachment extends React.Component {
var re2 = new RegExp('\\(', 'g');
var re3 = new RegExp('\\)', 'g');
var url = path.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29');
- $(imgDiv).css('background-image', 'url(' + url + '_thumb.jpg)');
+ $(imgDiv).css('background-image', 'url(' + url + '_thumb.jpg?' + utils.getSessionIndex() + ')');
}
};
}(fileInfo.path, filename));
diff --git a/web/react/components/file_preview.jsx b/web/react/components/file_preview.jsx
index a40ed1dcf..df5deb8bc 100644
--- a/web/react/components/file_preview.jsx
+++ b/web/react/components/file_preview.jsx
@@ -34,7 +34,7 @@ export default class FilePreview extends React.Component {
if (filename.indexOf('/api/v1/files/get') !== -1) {
filename = filename.split('/api/v1/files/get')[1];
}
- filename = Utils.getWindowLocationOrigin() + '/api/v1/files/get' + filename;
+ filename = Utils.getWindowLocationOrigin() + '/api/v1/files/get' + filename + '?' + Utils.getSessionIndex();
if (type === 'image') {
previews.push(
diff --git a/web/react/components/member_list_item.jsx b/web/react/components/member_list_item.jsx
index 5c3695ad4..8ed94680e 100644
--- a/web/react/components/member_list_item.jsx
+++ b/web/react/components/member_list_item.jsx
@@ -105,7 +105,7 @@ export default class MemberListItem extends React.Component {
diff --git a/web/react/components/member_list_team_item.jsx b/web/react/components/member_list_team_item.jsx
index 3af1d3800..14db05cdb 100644
--- a/web/react/components/member_list_team_item.jsx
+++ b/web/react/components/member_list_team_item.jsx
@@ -169,7 +169,7 @@ export default class MemberListTeamItem extends React.Component {
diff --git a/web/react/components/mention.jsx b/web/react/components/mention.jsx
index aeed724a8..09035523a 100644
--- a/web/react/components/mention.jsx
+++ b/web/react/components/mention.jsx
@@ -25,7 +25,7 @@ export default class Mention extends React.Component {
);
diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx
index 105199035..21f9a53a0 100644
--- a/web/react/components/more_direct_channels.jsx
+++ b/web/react/components/more_direct_channels.jsx
@@ -179,7 +179,7 @@ export default class MoreDirectChannels extends React.Component {
className='profile-img pull-left'
width='38'
height='38'
- src={`/api/v1/users/${user.id}/image?time=${user.update_at}`}
+ src={`/api/v1/users/${user.id}/image?time=${user.update_at}&${Utils.getSessionIndex()}`}
/>
{user.username}
diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx
index 3b3b0383c..bc3144dbc 100644
--- a/web/react/components/post.jsx
+++ b/web/react/components/post.jsx
@@ -158,7 +158,7 @@ export default class Post extends React.Component {
var profilePic = null;
if (!this.props.hideProfilePic) {
- let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp;
+ let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp + '&' + utils.getSessionIndex();
if (post.props && post.props.from_webhook && global.window.mm_config.EnablePostIconOverride === 'true') {
if (post.props.override_icon_url) {
src = post.props.override_icon_url;
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 4402745e1..29cd22c44 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -323,7 +323,7 @@ export default class PostList extends React.Component {
diff --git a/web/react/components/rhs_comment.jsx b/web/react/components/rhs_comment.jsx
index d3a4cfaeb..cfff04fa2 100644
--- a/web/react/components/rhs_comment.jsx
+++ b/web/react/components/rhs_comment.jsx
@@ -199,7 +199,7 @@ export default class RhsComment extends React.Component {
diff --git a/web/react/components/rhs_root_post.jsx b/web/react/components/rhs_root_post.jsx
index 979c56036..deef389e2 100644
--- a/web/react/components/rhs_root_post.jsx
+++ b/web/react/components/rhs_root_post.jsx
@@ -134,7 +134,7 @@ export default class RhsRootPost extends React.Component {
botIndicator =
{'BOT'} ;
}
- let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp;
+ let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp + '&' + utils.getSessionIndex();
if (post.props && post.props.from_webhook && global.window.mm_config.EnablePostIconOverride === 'true') {
if (post.props.override_icon_url) {
src = post.props.override_icon_url;
diff --git a/web/react/components/search_results_item.jsx b/web/react/components/search_results_item.jsx
index 75d2e7a45..a7d4bb229 100644
--- a/web/react/components/search_results_item.jsx
+++ b/web/react/components/search_results_item.jsx
@@ -77,7 +77,7 @@ export default class SearchResultsItem extends React.Component {
diff --git a/web/react/components/sidebar_header.jsx b/web/react/components/sidebar_header.jsx
index 6b29da622..f5d2ed3b4 100644
--- a/web/react/components/sidebar_header.jsx
+++ b/web/react/components/sidebar_header.jsx
@@ -32,7 +32,7 @@ export default class SidebarHeader extends React.Component {
profilePicture = (
);
}
diff --git a/web/react/components/user_profile.jsx b/web/react/components/user_profile.jsx
index 4a759bb21..38d15b7f8 100644
--- a/web/react/components/user_profile.jsx
+++ b/web/react/components/user_profile.jsx
@@ -67,7 +67,7 @@ export default class UserProfile extends React.Component {
dataContent.push(
-
+
);
} else {
--
cgit v1.2.3-1-g7c22
From 636db0d2f2f46aa4232bcc6b297d0b3b584679f3 Mon Sep 17 00:00:00 2001
From: =Corey Hulen
Date: Tue, 20 Oct 2015 15:02:15 -0700
Subject: fixing eslint errors
---
web/react/components/mention.jsx | 1 +
web/react/components/search_results_item.jsx | 2 +-
web/react/components/sidebar_header.jsx | 1 +
web/react/components/user_profile.jsx | 2 +-
4 files changed, 4 insertions(+), 2 deletions(-)
(limited to 'web/react/components')
diff --git a/web/react/components/mention.jsx b/web/react/components/mention.jsx
index 09035523a..050887c6f 100644
--- a/web/react/components/mention.jsx
+++ b/web/react/components/mention.jsx
@@ -1,6 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
var UserStore = require('../stores/user_store.jsx');
+const Utils = require('../utils/utils.jsx');
export default class Mention extends React.Component {
constructor(props) {
diff --git a/web/react/components/search_results_item.jsx b/web/react/components/search_results_item.jsx
index a7d4bb229..d212e47a3 100644
--- a/web/react/components/search_results_item.jsx
+++ b/web/react/components/search_results_item.jsx
@@ -77,7 +77,7 @@ export default class SearchResultsItem extends React.Component {
diff --git a/web/react/components/sidebar_header.jsx b/web/react/components/sidebar_header.jsx
index f5d2ed3b4..de28a8374 100644
--- a/web/react/components/sidebar_header.jsx
+++ b/web/react/components/sidebar_header.jsx
@@ -3,6 +3,7 @@
var NavbarDropdown = require('./navbar_dropdown.jsx');
var UserStore = require('../stores/user_store.jsx');
+const Utils = require('../utils/utils.jsx');
export default class SidebarHeader extends React.Component {
constructor(props) {
diff --git a/web/react/components/user_profile.jsx b/web/react/components/user_profile.jsx
index 38d15b7f8..c4402ae23 100644
--- a/web/react/components/user_profile.jsx
+++ b/web/react/components/user_profile.jsx
@@ -73,7 +73,7 @@ export default class UserProfile extends React.Component {
key='user-popover-image'
/>
);
-
+
if (!global.window.mm_config.ShowEmailAddress === 'true') {
dataContent.push(
Date: Tue, 20 Oct 2015 16:19:41 -0700
Subject: Fixing admin console
---
web/react/components/navbar_dropdown.jsx | 2 +-
web/react/components/sidebar_right_menu.jsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'web/react/components')
diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx
index 2b2cc2f95..2b68645e5 100644
--- a/web/react/components/navbar_dropdown.jsx
+++ b/web/react/components/navbar_dropdown.jsx
@@ -152,7 +152,7 @@ export default class NavbarDropdown extends React.Component {
sysAdminLink = (
{'System Console'}
diff --git a/web/react/components/sidebar_right_menu.jsx b/web/react/components/sidebar_right_menu.jsx
index 870fe77e5..fddc98c9d 100644
--- a/web/react/components/sidebar_right_menu.jsx
+++ b/web/react/components/sidebar_right_menu.jsx
@@ -84,7 +84,7 @@ export default class SidebarRightMenu extends React.Component {
consoleLink = (
System Console
--
cgit v1.2.3-1-g7c22
From 27a8169ae8dd41eb5a2b8a9b11e69fc4b922b115 Mon Sep 17 00:00:00 2001
From: Reed Garmsen
Date: Wed, 21 Oct 2015 13:55:41 -0700
Subject: Changed post list resize code to use react state; fixed various
eslint warnings
---
web/react/components/post_list.jsx | 89 ++++++++++++++++++++++----------------
1 file changed, 51 insertions(+), 38 deletions(-)
(limited to 'web/react/components')
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 4402745e1..5a4e8abaf 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -12,7 +12,7 @@ const UserStore = require('../stores/user_store.jsx');
const SocketStore = require('../stores/socket_store.jsx');
const PreferenceStore = require('../stores/preference_store.jsx');
-const utils = require('../utils/utils.jsx');
+const Utils = require('../utils/utils.jsx');
const Client = require('../utils/client.jsx');
const Constants = require('../utils/constants.jsx');
const ActionTypes = Constants.ActionTypes;
@@ -40,11 +40,13 @@ export default class PostList extends React.Component {
this.loadFirstPosts = this.loadFirstPosts.bind(this);
this.activate = this.activate.bind(this);
this.deactivate = this.deactivate.bind(this);
- this.resize = this.resize.bind(this);
+ this.handleResize = this.handleResize.bind(this);
+ this.resizePostList = this.resizePostList.bind(this);
const state = this.getStateFromStores(props.channelId);
state.numToDisplay = Constants.POST_CHUNK_SIZE;
state.isFirstLoadComplete = false;
+ state.windowHeight = Utils.windowHeight();
this.state = state;
}
@@ -115,12 +117,7 @@ export default class PostList extends React.Component {
const postHolder = $(ReactDOM.findDOMNode(this.refs.postlist));
- $(window).resize(() => {
- this.resize();
- if (!this.scrolled) {
- this.scrollToBottom();
- }
- });
+ window.addEventListener('resize', this.handleResize);
postHolder.on('scroll', () => {
const position = postHolder.scrollTop() + postHolder.height() + 14;
@@ -154,7 +151,7 @@ export default class PostList extends React.Component {
this.loadFirstPosts(this.props.channelId);
}
- this.resize();
+ this.handleResize();
this.onChange();
this.scrollToBottom();
}
@@ -164,7 +161,9 @@ export default class PostList extends React.Component {
SocketStore.removeChangeListener(this.onSocketChange);
PreferenceStore.removeChangeListener(this.onTimeChange);
$('body').off('click.userpopover');
- $(window).off('resize');
+
+ window.removeEventListener('resize', this.handleResize);
+
var postHolder = $(ReactDOM.findDOMNode(this.refs.postlist));
postHolder.off('scroll');
}
@@ -202,7 +201,7 @@ export default class PostList extends React.Component {
// it's by the user and not a comment
} else if (isNewPost &&
userId === firstPost.user_id &&
- !utils.isComment(firstPost)) {
+ !Utils.isComment(firstPost)) {
this.scrollToBottom(true);
// the user clicked 'load more messages'
@@ -219,6 +218,10 @@ export default class PostList extends React.Component {
} else {
this.scrollTo(this.prevScrollTop);
}
+
+ if (prevState.windowHeight !== this.state.windowHeight) {
+ this.handleResize();
+ }
}
componentWillUpdate() {
var postHolder = $(ReactDOM.findDOMNode(this.refs.postlist));
@@ -231,10 +234,20 @@ export default class PostList extends React.Component {
this.deactivate();
}
}
- resize() {
+ handleResize() {
+ this.setState({
+ windowHeight: Utils.windowHeight()
+ });
+
+ this.resizePostList();
+ if (!this.scrolled) {
+ this.scrollToBottom();
+ }
+ }
+ resizePostList() {
const postHolder = $(ReactDOM.findDOMNode(this.refs.postlist));
if ($('#create_post').length > 0) {
- const height = $(window).height() - $('#create_post').height() - $('#error_bar').outerHeight() - 50;
+ const height = this.state.windowHeight - $('#create_post').height() - $('#error_bar').outerHeight() - 50;
postHolder.css('height', height + 'px');
}
}
@@ -280,7 +293,7 @@ export default class PostList extends React.Component {
onChange() {
var newState = this.getStateFromStores(this.props.channelId);
- if (!utils.areStatesEqual(newState.postList, this.state.postList)) {
+ if (!Utils.areStatesEqual(newState.postList, this.state.postList)) {
this.setState(newState);
}
}
@@ -310,7 +323,7 @@ export default class PostList extends React.Component {
}
}
createDMIntroMessage(channel) {
- var teammate = utils.getDirectTeammate(channel.id);
+ var teammate = Utils.getDirectTeammate(channel.id);
if (teammate) {
var teammateName = teammate.username;
@@ -370,13 +383,13 @@ export default class PostList extends React.Component {
createDefaultIntroMessage(channel) {
return (
-
Beginning of {channel.display_name}
+
{'Beginning of ' + channel.display_name}
- Welcome to {channel.display_name}!
+ {'Welcome to ' + channel.display_name + '!'}
- This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.
+ {'This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.'}
- To create a new channel or join an existing one, go to the Left Sidebar under “Channels” and click “More…”.
+ {'To create a new channel or join an existing one, go to the Left Sidebar under “Channels” and click “More…”.'}
@@ -385,7 +398,7 @@ export default class PostList extends React.Component {
createOffTopicIntroMessage(channel) {
return (
-
Beginning of {channel.display_name}
+
{'Beginning of ' + channel.display_name}
{'This is the start of ' + channel.display_name + ', a channel for non-work-related conversations.'}
@@ -399,7 +412,7 @@ export default class PostList extends React.Component {
data-title={channel.display_name}
data-channelid={channel.id}
>
- Set a description
+ {'Set a description'}
- Invite others to this channel
+ {'Invite others to this channel'}
);
@@ -422,7 +435,7 @@ export default class PostList extends React.Component {
var members = ChannelStore.getExtraInfo(channel.id).members;
for (var i = 0; i < members.length; i++) {
- if (utils.isAdmin(members[i].roles)) {
+ if (Utils.isAdmin(members[i].roles)) {
return members[i].username;
}
}
@@ -443,14 +456,14 @@ export default class PostList extends React.Component {
var createMessage;
if (creatorName === '') {
- createMessage = 'This is the start of the ' + uiName + ' ' + uiType + ', created on ' + utils.displayDate(channel.create_at) + '.';
+ createMessage = 'This is the start of the ' + uiName + ' ' + uiType + ', created on ' + Utils.displayDate(channel.create_at) + '.';
} else {
- createMessage = (This is the start of the {uiName} {uiType}, created by {creatorName} on {utils.displayDate(channel.create_at)} );
+ createMessage = (This is the start of the {uiName} {uiType}, created by {creatorName} on {Utils.displayDate(channel.create_at)} );
}
return (
);
@@ -507,7 +520,7 @@ export default class PostList extends React.Component {
if (prevPost) {
sameUser = prevPost.user_id === post.user_id && post.create_at - prevPost.create_at <= 1000 * 60 * 5;
- sameRoot = utils.isComment(post) && (prevPost.id === post.root_id || prevPost.root_id === post.root_id);
+ sameRoot = Utils.isComment(post) && (prevPost.id === post.root_id || prevPost.root_id === post.root_id);
// hide the profile pic if:
// the previous post was made by the same user as the current post,
@@ -516,8 +529,8 @@ export default class PostList extends React.Component {
// the current post is not from a webhook
// and the previous post is not from a webhook
if ((prevPost.user_id === post.user_id) &&
- !utils.isComment(prevPost) &&
- !utils.isComment(post) &&
+ !Utils.isComment(prevPost) &&
+ !Utils.isComment(post) &&
(!post.props || !post.props.from_webhook) &&
(!prevPost.props || !prevPost.props.from_webhook)) {
hideProfilePic = true;
@@ -526,7 +539,7 @@ export default class PostList extends React.Component {
// check if it's the last comment in a consecutive string of comments on the same post
// it is the last comment if it is last post in the channel or the next post has a different root post
- var isLastComment = utils.isComment(post) && (i === 0 || posts[order[i - 1]].root_id !== post.root_id);
+ var isLastComment = Utils.isComment(post) && (i === 0 || posts[order[i - 1]].root_id !== post.root_id);
var postCtl = (
);
- let currentPostDay = utils.getDateForUnixTicks(post.create_at);
+ const currentPostDay = Utils.getDateForUnixTicks(post.create_at);
if (currentPostDay.toDateString() !== previousPostDay.toDateString()) {
postCtls.push(
lastViewed && !renderedLastViewed) {
renderedLastViewed = true;
- // Temporary fix to solve ie10/11 rendering issue
+ // Temporary fix to solve ie11 rendering issue
let newSeparatorId = '';
- if (!utils.isBrowserIE()) {
+ if (!Utils.isBrowserIE()) {
newSeparatorId = 'new_message_' + this.props.channelId;
}
postCtls.push(
@@ -572,7 +585,7 @@ export default class PostList extends React.Component {
-
New Messages
+
{'New Messages'}
);
}
@@ -638,7 +651,7 @@ export default class PostList extends React.Component {
order = this.state.postList.order;
}
- var moreMessages = Beginning of Channel
;
+ var moreMessages = {'Beginning of Channel'}
;
if (channel != null) {
if (order.length >= this.state.numToDisplay) {
moreMessages = (
@@ -648,7 +661,7 @@ export default class PostList extends React.Component {
href='#'
onClick={this.loadMorePosts}
>
- Load more messages
+ {'Load more messages'}
);
} else {
--
cgit v1.2.3-1-g7c22
From 4129b204c3f6d76154f98ed715c11508d5348cc9 Mon Sep 17 00:00:00 2001
From: Reed Garmsen
Date: Wed, 21 Oct 2015 15:08:04 -0700
Subject: Fixed typos in create_post.jsx resizing code
---
web/react/components/create_post.jsx | 6 +++---
web/react/components/post_list.jsx | 18 ++++++++----------
2 files changed, 11 insertions(+), 13 deletions(-)
(limited to 'web/react/components')
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index 035899592..8b5fc4162 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -51,7 +51,7 @@ export default class CreatePost extends React.Component {
submitting: false,
initialText: draft.messageText,
windowWidth: Utils.windowWidth(),
- windowHeigth: Utils.windowHeight()
+ windowHeight: Utils.windowHeight()
};
}
handleResize() {
@@ -71,7 +71,7 @@ export default class CreatePost extends React.Component {
return;
}
- if (prevState.windowWidth !== this.state.windowWidth || prevState.windowHeight !== this.state.windowHeigth) {
+ if (prevState.windowWidth !== this.state.windowWidth || prevState.windowHeight !== this.state.windowHeight) {
this.resizePostHolder();
return;
}
@@ -208,7 +208,7 @@ export default class CreatePost extends React.Component {
PostStore.storeCurrentDraft(draft);
}
resizePostHolder() {
- const height = this.state.windowHeigth - $(ReactDOM.findDOMNode(this.refs.topDiv)).height() - 50;
+ const height = this.state.windowHeight - $(ReactDOM.findDOMNode(this.refs.topDiv)).height() - 50;
$('.post-list-holder-by-time').css('height', `${height}px`);
if (this.state.windowWidth > 960) {
$('#post_textbox').focus();
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 5a4e8abaf..b7df483e9 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -151,7 +151,7 @@ export default class PostList extends React.Component {
this.loadFirstPosts(this.props.channelId);
}
- this.handleResize();
+ this.resizePostList();
this.onChange();
this.scrollToBottom();
}
@@ -172,6 +172,13 @@ export default class PostList extends React.Component {
return;
}
+ if (prevState.windowHeight !== this.state.windowHeight) {
+ this.resizePostList();
+ if (!this.scrolled) {
+ this.scrollToBottom();
+ }
+ }
+
$('.post-list__content div .post').removeClass('post--last');
$('.post-list__content div:last-child .post').addClass('post--last');
@@ -218,10 +225,6 @@ export default class PostList extends React.Component {
} else {
this.scrollTo(this.prevScrollTop);
}
-
- if (prevState.windowHeight !== this.state.windowHeight) {
- this.handleResize();
- }
}
componentWillUpdate() {
var postHolder = $(ReactDOM.findDOMNode(this.refs.postlist));
@@ -238,11 +241,6 @@ export default class PostList extends React.Component {
this.setState({
windowHeight: Utils.windowHeight()
});
-
- this.resizePostList();
- if (!this.scrolled) {
- this.scrollToBottom();
- }
}
resizePostList() {
const postHolder = $(ReactDOM.findDOMNode(this.refs.postlist));
--
cgit v1.2.3-1-g7c22
From 47d519927a66c9e8e39b81f6f0f22f992648cdee Mon Sep 17 00:00:00 2001
From: hmhealey
Date: Thu, 22 Oct 2015 12:15:21 -0400
Subject: Added help popover to search box
---
web/react/components/search_bar.jsx | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
(limited to 'web/react/components')
diff --git a/web/react/components/search_bar.jsx b/web/react/components/search_bar.jsx
index 2e9764bd9..bf12ca160 100644
--- a/web/react/components/search_bar.jsx
+++ b/web/react/components/search_bar.jsx
@@ -8,6 +8,7 @@ var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
var utils = require('../utils/utils.jsx');
var Constants = require('../utils/constants.jsx');
var ActionTypes = Constants.ActionTypes;
+var Tooltip = ReactBootstrap.Tooltip;
export default class SearchBar extends React.Component {
constructor() {
@@ -16,10 +17,14 @@ export default class SearchBar extends React.Component {
this.onListenerChange = this.onListenerChange.bind(this);
this.handleUserInput = this.handleUserInput.bind(this);
+ this.handleUserFocus = this.handleUserFocus.bind(this);
+ this.handleUserBlur = this.handleUserBlur.bind(this);
this.performSearch = this.performSearch.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
- this.state = this.getSearchTermStateFromStores();
+ const state = this.getSearchTermStateFromStores();
+ state.focused = false;
+ this.state = state;
}
getSearchTermStateFromStores() {
var term = PostStore.getSearchTerm() || '';
@@ -78,9 +83,14 @@ export default class SearchBar extends React.Component {
handleMouseInput(e) {
e.preventDefault();
}
+ handleUserBlur() {
+ this.setState({focused: false});
+ }
handleUserFocus(e) {
e.target.select();
$('.search-bar__container').addClass('focused');
+
+ this.setState({focused: true});
}
performSearch(terms, isMentionSearch) {
if (terms.length) {
@@ -115,6 +125,12 @@ export default class SearchBar extends React.Component {
if (this.state.isSearching) {
isSearching = ;
}
+
+ let helpClass = 'search-help-popover';
+ if (!this.state.searchTerm && this.state.focused) {
+ helpClass += ' visible';
+ }
+
return (
{isSearching}
+
+ {'Search Options'}
+
+
+ {'Use '} {'"quotation marks"'} {' to search for phrases'}
+
+
+ {'Use '} {'from:'} {' to find posts from specific users and '} {'in:'} {' to find posts in specific channels'}
+
+
+
);
--
cgit v1.2.3-1-g7c22
From 4411a21ca7cf6031d2eb1f387bb8c1ba845df1e8 Mon Sep 17 00:00:00 2001
From: hmhealey
Date: Thu, 22 Oct 2015 12:51:32 -0400
Subject: Made searching case insensitive in Direct Messages modal
---
web/react/components/more_direct_channels.jsx | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
(limited to 'web/react/components')
diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx
index d5b44d86b..da125ae3f 100644
--- a/web/react/components/more_direct_channels.jsx
+++ b/web/react/components/more_direct_channels.jsx
@@ -209,12 +209,14 @@ export default class MoreDirectChannels extends React.Component {
}
let users = this.state.users;
- if (this.state.filter !== '') {
+ if (this.state.filter) {
+ const filter = this.state.filter.toLowerCase();
+
users = users.filter((user) => {
- return user.username.indexOf(this.state.filter) !== -1 ||
- user.first_name.indexOf(this.state.filter) !== -1 ||
- user.last_name.indexOf(this.state.filter) !== -1 ||
- user.nickname.indexOf(this.state.filter) !== -1;
+ return user.username.toLowerCase().indexOf(filter) !== -1 ||
+ user.first_name.toLowerCase().indexOf(filter) !== -1 ||
+ user.last_name.toLowerCase().indexOf(filter) !== -1 ||
+ user.nickname.toLowerCase().indexOf(filter) !== -1;
});
}
--
cgit v1.2.3-1-g7c22
From 9483ef66d3ae6272e05348339b62bc4d30165d88 Mon Sep 17 00:00:00 2001
From: hmhealey
Date: Thu, 22 Oct 2015 12:55:35 -0400
Subject: Changed Direct Channel modal to only show active users
---
web/react/components/more_direct_channels.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'web/react/components')
diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx
index d5b44d86b..9b59db424 100644
--- a/web/react/components/more_direct_channels.jsx
+++ b/web/react/components/more_direct_channels.jsx
@@ -31,7 +31,7 @@ export default class MoreDirectChannels extends React.Component {
getUsersFromStore() {
const currentId = UserStore.getCurrentId();
- const profiles = UserStore.getProfiles();
+ const profiles = UserStore.getActiveOnlyProfiles();
const users = [];
for (const id in profiles) {
--
cgit v1.2.3-1-g7c22
From 7384b0791e54b0fd980ce8c321566c2c42289c02 Mon Sep 17 00:00:00 2001
From: =Corey Hulen
Date: Thu, 22 Oct 2015 20:52:31 -0700
Subject: Fixing merge
---
web/react/components/post_list.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'web/react/components')
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 2839325fe..fd29a303c 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -334,7 +334,7 @@ export default class PostList extends React.Component {
--
cgit v1.2.3-1-g7c22
From 8291d0285ec07eb6acb253b619d5dd1b286f06bc Mon Sep 17 00:00:00 2001
From: =Corey Hulen
Date: Thu, 22 Oct 2015 22:10:16 -0700
Subject: Fixing merge
---
web/react/components/admin_console/admin_sidebar_header.jsx | 1 +
1 file changed, 1 insertion(+)
(limited to 'web/react/components')
diff --git a/web/react/components/admin_console/admin_sidebar_header.jsx b/web/react/components/admin_console/admin_sidebar_header.jsx
index e66beaf35..fd6d92c4a 100644
--- a/web/react/components/admin_console/admin_sidebar_header.jsx
+++ b/web/react/components/admin_console/admin_sidebar_header.jsx
@@ -3,6 +3,7 @@
var AdminNavbarDropdown = require('./admin_navbar_dropdown.jsx');
var UserStore = require('../../stores/user_store.jsx');
+var Utils = require('../../utils/utils.jsx');
export default class SidebarHeader extends React.Component {
constructor(props) {
--
cgit v1.2.3-1-g7c22