From b07f8272d6a99db2b7d4094961ffe0650b282bb7 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 28 Apr 2016 10:53:52 -0400 Subject: Change footer links to a tags instead of Link tags (#2815) --- webapp/components/header_footer_template.jsx | 29 +++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'webapp') diff --git a/webapp/components/header_footer_template.jsx b/webapp/components/header_footer_template.jsx index ce2f59541..76061d532 100644 --- a/webapp/components/header_footer_template.jsx +++ b/webapp/components/header_footer_template.jsx @@ -5,7 +5,6 @@ import $ from 'jquery'; import {FormattedMessage} from 'react-intl'; import React from 'react'; -import {Link} from 'react-router'; export default class NotLoggedIn extends React.Component { componentDidMount() { @@ -30,34 +29,38 @@ export default class NotLoggedIn extends React.Component {
{'© 2015 Mattermost, Inc.'} - - - + - - + - - + - +
-- cgit v1.2.3-1-g7c22 From 65a2427b90f3261d895f6b64a771d2362e896cb6 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 28 Apr 2016 10:55:07 -0400 Subject: Update {user} is typing.. based on display name setting (#2817) --- webapp/stores/user_typing_store.jsx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'webapp') diff --git a/webapp/stores/user_typing_store.jsx b/webapp/stores/user_typing_store.jsx index ab0a9af1d..85c10bfbe 100644 --- a/webapp/stores/user_typing_store.jsx +++ b/webapp/stores/user_typing_store.jsx @@ -33,16 +33,16 @@ class UserTypingStoreClass extends EventEmitter { this.removeListener(CHANGE_EVENT, callback); } - usernameFromId(userId) { - let username = Utils.localizeMessage('msg_typing.someone', 'Someone'); + nameFromId(userId) { + let name = Utils.localizeMessage('msg_typing.someone', 'Someone'); if (UserStore.hasProfile(userId)) { - username = UserStore.getProfile(userId).username; + name = Utils.displayUsername(userId); } - return username; + return name; } userTyping(channelId, userId, postParentId) { - const username = this.usernameFromId(userId); + const name = this.nameFromId(userId); // Key representing a location where users can type const loc = channelId + postParentId; @@ -53,15 +53,15 @@ class UserTypingStoreClass extends EventEmitter { } // If we already have this user, clear it's timeout to be deleted - if (this.typingUsers[loc][username]) { - clearTimeout(this.typingUsers[loc][username].timeout); + if (this.typingUsers[loc][name]) { + clearTimeout(this.typingUsers[loc][name].timeout); } // Set the user and a timeout to remove it - this.typingUsers[loc][username] = setTimeout(() => { - delete this.typingUsers[loc][username]; + this.typingUsers[loc][name] = setTimeout(() => { + Reflect.deleteProperty(this.typingUsers[loc], name); if (this.typingUsers[loc] === {}) { - delete this.typingUsers[loc]; + Reflect.deleteProperty(this.typingUsers, loc); } this.emitChange(); }, Constants.UPDATE_TYPING_MS); @@ -76,14 +76,14 @@ class UserTypingStoreClass extends EventEmitter { } userPosted(userId, channelId, postParentId) { - const username = this.usernameFromId(userId); + const name = this.nameFromId(userId); const loc = channelId + postParentId; if (this.typingUsers[loc]) { - clearTimeout(this.typingUsers[loc][username]); - delete this.typingUsers[loc][username]; + clearTimeout(this.typingUsers[loc][name]); + Reflect.deleteProperty(this.typingUsers[loc], name); if (this.typingUsers[loc] === {}) { - delete this.typingUsers[loc]; + Reflect.deleteProperty(this.typingUsers, loc); } this.emitChange(); } -- cgit v1.2.3-1-g7c22 From 3dbb5ab4cca74de7d7a00909927e1f034949052d Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 28 Apr 2016 10:55:50 -0400 Subject: Only cache 3 post views at a time (#2818) --- webapp/components/posts_view_container.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'webapp') diff --git a/webapp/components/posts_view_container.jsx b/webapp/components/posts_view_container.jsx index a49c77f8d..edfa314f8 100644 --- a/webapp/components/posts_view_container.jsx +++ b/webapp/components/posts_view_container.jsx @@ -16,6 +16,8 @@ import {createChannelIntroMessage} from 'utils/channel_intro_messages.jsx'; import React from 'react'; +const MAXIMUM_CACHED_VIEWS = 3; + export default class PostsViewContainer extends React.Component { constructor() { super(); @@ -105,6 +107,12 @@ export default class PostsViewContainer extends React.Component { let newIndex = channels.indexOf(channelId); if (newIndex === -1) { + if (channels.length >= MAXIMUM_CACHED_VIEWS) { + channels.shift(); + atTop.shift(); + postLists.shift(); + } + newIndex = channels.length; channels.push(channelId); atTop[newIndex] = PostStore.getVisibilityAtTop(channelId); @@ -172,7 +180,7 @@ export default class PostsViewContainer extends React.Component { const isActive = (channels[i] === currentChannelId); postListCtls.push( Date: Thu, 28 Apr 2016 10:56:19 -0400 Subject: Don't return error if already part of channel being joined (#2814) --- webapp/components/notify_counts.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'webapp') diff --git a/webapp/components/notify_counts.jsx b/webapp/components/notify_counts.jsx index 9238c8736..8f9eadab7 100644 --- a/webapp/components/notify_counts.jsx +++ b/webapp/components/notify_counts.jsx @@ -9,8 +9,12 @@ function getCountsStateFromStores() { var channels = ChannelStore.getAll(); var members = ChannelStore.getAllMembers(); - channels.forEach(function setChannelInfo(channel) { + channels.forEach((channel) => { var channelMember = members[channel.id]; + if (channelMember == null) { + return; + } + if (channel.type === 'D') { count += channel.total_msg_count - channelMember.msg_count; } else if (channelMember.mention_count > 0) { @@ -20,7 +24,7 @@ function getCountsStateFromStores() { } }); - return {count: count}; + return {count}; } import React from 'react'; -- cgit v1.2.3-1-g7c22 From 938caa061d4f5aad00133926c86d3d6f4485b3a2 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Thu, 28 Apr 2016 23:52:22 +0500 Subject: Fixing long usernames (#2821) * Submitting a fix for popover titles * Fixing heading for channels * Fixing other minor corner cases for long username --- webapp/sass/components/_popover.scss | 3 +++ webapp/sass/layout/_headers.scss | 9 ++++++++- webapp/sass/layout/_navigation.scss | 4 ++++ webapp/sass/responsive/_mobile.scss | 4 ++++ 4 files changed, 19 insertions(+), 1 deletion(-) (limited to 'webapp') diff --git a/webapp/sass/components/_popover.scss b/webapp/sass/components/_popover.scss index 0b2769f77..7526fcb5a 100644 --- a/webapp/sass/components/_popover.scss +++ b/webapp/sass/components/_popover.scss @@ -18,7 +18,10 @@ .popover-title { background: alpha-color($black, .05); + max-width: 100%; + overflow: hidden; padding: 8px 10px; + text-overflow: ellipsis; } .popover-content { diff --git a/webapp/sass/layout/_headers.scss b/webapp/sass/layout/_headers.scss index 950588df5..b4b6e9cbc 100644 --- a/webapp/sass/layout/_headers.scss +++ b/webapp/sass/layout/_headers.scss @@ -82,6 +82,12 @@ .channel-intro-profile { margin-left: 63px; margin-top: 5px; + + .user-popover { + max-width: calc(100% - 100px); + overflow: hidden; + text-overflow: ellipsis; + } } .channel-intro-img { @@ -106,6 +112,7 @@ .channel-intro-text { margin-top: 35px; + word-break: break-all; } } @@ -308,7 +315,7 @@ font-size: 1.3em; font-weight: 600; margin: 0 4px 0 0; - max-width: 100%; + max-width: calc(100% - 50px); overflow: hidden; text-overflow: ellipsis; vertical-align: middle; diff --git a/webapp/sass/layout/_navigation.scss b/webapp/sass/layout/_navigation.scss index 3daf6e56b..2008b247a 100644 --- a/webapp/sass/layout/_navigation.scss +++ b/webapp/sass/layout/_navigation.scss @@ -70,8 +70,12 @@ .heading { color: $white; + display: inline-block; font-weight: 600; margin-right: 3px; + overflow: hidden; + vertical-align: top; + width: calc(100% - 200px); } .header-dropdown__icon { diff --git a/webapp/sass/responsive/_mobile.scss b/webapp/sass/responsive/_mobile.scss index f2a1cf819..3a4cd3b89 100644 --- a/webapp/sass/responsive/_mobile.scss +++ b/webapp/sass/responsive/_mobile.scss @@ -11,6 +11,10 @@ } } + .user-popover { + pointer-events: none; + } + .signup-team__container { font-size: 1em; } -- cgit v1.2.3-1-g7c22 From f3fa435a1b35c2ada4cd9a81744a41904fe97909 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 28 Apr 2016 16:29:13 -0400 Subject: Fixing slack import. (#2819) --- webapp/client/client.jsx | 5 ++--- webapp/components/team_import_tab.jsx | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'webapp') diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx index 53a514082..6a7c5de40 100644 --- a/webapp/client/client.jsx +++ b/webapp/client/client.jsx @@ -348,10 +348,9 @@ export default class Client { importSlack = (fileData, success, error) => { request. - post(`${this.getTeamsRoute()}/import_team`). + post(`${this.getTeamNeededRoute()}/import_team`). set(this.defaultHeaders). - type('application/json'). - accept('application/json'). + accept('application/octet-stream'). send(fileData). end(this.handleResponse.bind(this, 'importSlack', success, error)); } diff --git a/webapp/components/team_import_tab.jsx b/webapp/components/team_import_tab.jsx index 03d35bb3f..782273c5a 100644 --- a/webapp/components/team_import_tab.jsx +++ b/webapp/components/team_import_tab.jsx @@ -33,8 +33,8 @@ class TeamImportTab extends React.Component { this.setState({status: 'fail', link: ''}); } - onImportSuccess(data) { - this.setState({status: 'done', link: 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(data)}); + onImportSuccess(data, res) { + this.setState({status: 'done', link: 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(res.text)}); } doImportSlack(file) { @@ -167,4 +167,4 @@ TeamImportTab.propTypes = { intl: intlShape.isRequired }; -export default injectIntl(TeamImportTab); \ No newline at end of file +export default injectIntl(TeamImportTab); -- cgit v1.2.3-1-g7c22