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 5c09060f530148210ca9ee869226afea8d8d2883 Mon Sep 17 00:00:00 2001
From: Asaad Mahmood
Date: Thu, 22 Oct 2015 20:18:31 +0500
Subject: Multiple UI Improvements
- Changing the UI for the active item in the nav
- Updating the UI for drag and drop
- Fixing z-index for date selector
---
web/react/components/file_upload_overlay.jsx | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
(limited to 'web/react/components')
diff --git a/web/react/components/file_upload_overlay.jsx b/web/react/components/file_upload_overlay.jsx
index d991dd625..dbba00022 100644
--- a/web/react/components/file_upload_overlay.jsx
+++ b/web/react/components/file_upload_overlay.jsx
@@ -12,19 +12,21 @@ export default class FileUploadOverlay extends React.Component {
return (
-
-
-
{'Drop a file to upload it.'}
-
+
+
+
+
{'Drop a file to upload it.'}
+
+
);
--
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 46f448899bf715fa2b557562a6a01d80ca4fc6b4 Mon Sep 17 00:00:00 2001
From: JoramWilander
Date: Thu, 22 Oct 2015 14:16:51 -0400
Subject: In webhooks UI handle error if channel can't be found, also use
display name over url name, plus warning fixes
---
.../user_settings/manage_incoming_hooks.jsx | 52 +++++++++++++---------
.../user_settings/manage_outgoing_hooks.jsx | 32 +++++++++++--
.../user_settings/user_settings_integrations.jsx | 4 +-
3 files changed, 62 insertions(+), 26 deletions(-)
(limited to 'web/react/components')
diff --git a/web/react/components/user_settings/manage_incoming_hooks.jsx b/web/react/components/user_settings/manage_incoming_hooks.jsx
index f5a2774a0..812169be4 100644
--- a/web/react/components/user_settings/manage_incoming_hooks.jsx
+++ b/web/react/components/user_settings/manage_incoming_hooks.jsx
@@ -96,7 +96,14 @@ export default class ManageIncomingHooks extends React.Component {
const options = [];
channels.forEach((channel) => {
if (channel.type !== Constants.DM_CHANNEL) {
- options.push({channel.name} );
+ options.push(
+
+ {channel.display_name}
+
+ );
}
});
@@ -108,26 +115,31 @@ export default class ManageIncomingHooks extends React.Component {
const hooks = [];
this.state.hooks.forEach((hook) => {
const c = ChannelStore.get(hook.channel_id);
- hooks.push(
-
-
-
- {'URL: '} {Utils.getWindowLocationOrigin() + '/hooks/' + hook.id}
-
-
- {'Channel: '} {c.name}
-
-
-
- {'Remove'}
-
+ if (c) {
+ hooks.push(
+
+
+
+ {'URL: '} {Utils.getWindowLocationOrigin() + '/hooks/' + hook.id}
+
+
+ {'Channel: '} {c.display_name}
+
+
-
- );
+ );
+ }
});
let displayHooks;
diff --git a/web/react/components/user_settings/manage_outgoing_hooks.jsx b/web/react/components/user_settings/manage_outgoing_hooks.jsx
index e83ae3bd6..f6d6b515b 100644
--- a/web/react/components/user_settings/manage_outgoing_hooks.jsx
+++ b/web/react/components/user_settings/manage_outgoing_hooks.jsx
@@ -128,21 +128,42 @@ export default class ManageOutgoingHooks extends React.Component {
}
const channels = ChannelStore.getAll();
- const options = [
{'--- Select a channel ---'} ];
+ const options = [];
+ options.push(
+
+ {'--- Select a channel ---'}
+
+ );
+
channels.forEach((channel) => {
if (channel.type === Constants.OPEN_CHANNEL) {
- options.push(
{channel.name} );
+ options.push(
+
+ {channel.display_name}
+
+ );
}
});
const hooks = [];
this.state.hooks.forEach((hook) => {
const c = ChannelStore.get(hook.channel_id);
+
+ if (!c && hook.channel_id && hook.channel_id.length !== 0) {
+ return;
+ }
+
let channelDiv;
if (c) {
channelDiv = (
- {'Channel: '} {c.name}
+ {'Channel: '} {c.display_name}
);
}
@@ -157,7 +178,10 @@ export default class ManageOutgoingHooks extends React.Component {
}
hooks.push(
-
+
{'URLs: '} {hook.callback_urls.join(', ')}
diff --git a/web/react/components/user_settings/user_settings_integrations.jsx b/web/react/components/user_settings/user_settings_integrations.jsx
index 231580cc3..1845ca28c 100644
--- a/web/react/components/user_settings/user_settings_integrations.jsx
+++ b/web/react/components/user_settings/user_settings_integrations.jsx
@@ -37,7 +37,7 @@ export default class UserSettingsIntegrationsTab extends React.Component {
if (global.window.config.EnableIncomingWebhooks === 'true') {
if (this.props.activeSection === 'incoming-hooks') {
inputs.push(
-
+
);
incomingHooksSection = (
@@ -68,7 +68,7 @@ export default class UserSettingsIntegrationsTab extends React.Component {
if (global.window.config.EnableOutgoingWebhooks === 'true') {
if (this.props.activeSection === 'outgoing-hooks') {
inputs.push(
-
+
);
outgoingHooksSection = (
--
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
From 210e2a062d8015e778369a6c7d75a4e976baa5fd Mon Sep 17 00:00:00 2001
From: Asaad Mahmood
Date: Fri, 23 Oct 2015 11:34:56 +0500
Subject: Improving UI for the search popover
---
web/react/components/search_bar.jsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'web/react/components')
diff --git a/web/react/components/search_bar.jsx b/web/react/components/search_bar.jsx
index bf12ca160..7540b41a4 100644
--- a/web/react/components/search_bar.jsx
+++ b/web/react/components/search_bar.jsx
@@ -8,7 +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;
+var Popover = ReactBootstrap.Popover;
export default class SearchBar extends React.Component {
constructor() {
@@ -163,7 +163,7 @@ export default class SearchBar extends React.Component {
onMouseUp={this.handleMouseInput}
/>
{isSearching}
-
@@ -176,7 +176,7 @@ export default class SearchBar extends React.Component {
{'Use '} {'from:'} {' to find posts from specific users and '} {'in:'} {' to find posts in specific channels'}
-
+
);
--
cgit v1.2.3-1-g7c22
From d4f1f981a5143663e03a1daab8105cc11b39820d Mon Sep 17 00:00:00 2001
From: JoramWilander
Date: Thu, 22 Oct 2015 08:45:28 -0400
Subject: Auto-embed gifs from .gif links
---
web/react/components/post.jsx | 10 ++++++--
web/react/components/post_body.jsx | 49 ++++++++++++++++++++++++++++++++++++--
web/react/components/post_list.jsx | 10 +++++++-
3 files changed, 64 insertions(+), 5 deletions(-)
(limited to 'web/react/components')
diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx
index bc3144dbc..dedac8951 100644
--- a/web/react/components/post.jsx
+++ b/web/react/components/post.jsx
@@ -120,6 +120,10 @@ export default class Post extends React.Component {
var parentPost = this.props.parentPost;
var posts = this.props.posts;
+ if (!post.props) {
+ post.props = {};
+ }
+
var type = 'Post';
if (post.root_id && post.root_id.length > 0) {
type = 'Comment';
@@ -140,7 +144,7 @@ export default class Post extends React.Component {
}
var currentUserCss = '';
- if (UserStore.getCurrentId() === post.user_id) {
+ if (UserStore.getCurrentId() === post.user_id && !post.props.from_webhook) {
currentUserCss = 'current--user';
}
@@ -200,6 +204,7 @@ export default class Post extends React.Component {
posts={posts}
handleCommentClick={this.handleCommentClick}
retryPost={this.retryPost}
+ resize={this.props.resize}
/>
{
+ this.setState({gifLoaded: true});
+ }
+ );
+ }
+
+ createGifEmbed(link) {
+ if (link.substring(link.length - 4) !== '.gif') {
+ return null;
+ }
+
+ if (!this.state.gifLoaded) {
+ this.loadGif(link);
+ return null;
+ }
+
+ return (
+
+ );
+ }
+
handleYoutubeTime(link) {
const timeRegex = /[\\?&]t=([0-9hms]+)/;
@@ -247,7 +291,7 @@ export default class PostBody extends React.Component {
let embed;
if (filenames.length === 0 && this.state.links) {
- embed = this.createYoutubeEmbed(this.state.links[0]);
+ embed = this.createEmbed(this.state.links[0]);
}
let fileAttachmentHolder = '';
@@ -287,5 +331,6 @@ PostBody.propTypes = {
post: React.PropTypes.object.isRequired,
parentPost: React.PropTypes.object,
retryPost: React.PropTypes.func.isRequired,
- handleCommentClick: React.PropTypes.func.isRequired
+ handleCommentClick: React.PropTypes.func.isRequired,
+ resize: React.PropTypes.func.isRequired
};
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index fd29a303c..3ceef478c 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -42,6 +42,7 @@ export default class PostList extends React.Component {
this.deactivate = this.deactivate.bind(this);
this.handleResize = this.handleResize.bind(this);
this.resizePostList = this.resizePostList.bind(this);
+ this.updateScroll = this.updateScroll.bind(this);
const state = this.getStateFromStores(props.channelId);
state.numToDisplay = Constants.POST_CHUNK_SIZE;
@@ -205,9 +206,10 @@ export default class PostList extends React.Component {
this.scrollToBottom();
// there's a new post and
- // it's by the user and not a comment
+ // it's by the user (and not from their webhook) and not a comment
} else if (isNewPost &&
userId === firstPost.user_id &&
+ !firstPost.props.from_webhook &&
!Utils.isComment(firstPost)) {
this.scrollToBottom(true);
@@ -237,6 +239,11 @@ export default class PostList extends React.Component {
this.deactivate();
}
}
+ updateScroll() {
+ if (!this.scrolled) {
+ this.scrollToBottom();
+ }
+ }
handleResize() {
this.setState({
windowHeight: Utils.windowHeight()
@@ -550,6 +557,7 @@ export default class PostList extends React.Component {
posts={posts}
hideProfilePic={hideProfilePic}
isLastComment={isLastComment}
+ resize={this.updateScroll}
/>
);
--
cgit v1.2.3-1-g7c22
From 4c0e4991e76c18fd39ffadcf5b0e1943fb4cd2c3 Mon Sep 17 00:00:00 2001
From: JoramWilander
Date: Fri, 23 Oct 2015 08:01:51 -0400
Subject: Make sure gif only loads once
---
web/react/components/post_body.jsx | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'web/react/components')
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index 6b15682b0..45eae8c6a 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -13,6 +13,7 @@ export default class PostBody extends React.Component {
super(props);
this.receivedYoutubeData = false;
+ this.isGifLoading = false;
this.parseEmojis = this.parseEmojis.bind(this);
this.createEmbed = this.createEmbed.bind(this);
@@ -70,6 +71,12 @@ export default class PostBody extends React.Component {
}
loadGif(src) {
+ if (this.isGifLoading) {
+ return;
+ }
+
+ this.isGifLoading = true;
+
const gif = new Image();
gif.src = src;
gif.onload = (
--
cgit v1.2.3-1-g7c22