summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'webapp')
-rw-r--r--webapp/client/client.jsx5
-rw-r--r--webapp/components/header_footer_template.jsx29
-rw-r--r--webapp/components/notify_counts.jsx8
-rw-r--r--webapp/components/posts_view_container.jsx10
-rw-r--r--webapp/components/team_import_tab.jsx6
-rw-r--r--webapp/sass/components/_popover.scss3
-rw-r--r--webapp/sass/layout/_headers.scss9
-rw-r--r--webapp/sass/layout/_navigation.scss4
-rw-r--r--webapp/sass/responsive/_mobile.scss4
-rw-r--r--webapp/stores/user_typing_store.jsx28
10 files changed, 69 insertions, 37 deletions
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/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 {
</div>
<div className='col-xs-12'>
<span className='pull-right footer-link copyright'>{'© 2015 Mattermost, Inc.'}</span>
- <Link
+ <a
id='help_link'
className='pull-right footer-link'
- to={global.window.mm_config.HelpLink}
+ target='_blank'
+ href={global.window.mm_config.HelpLink}
>
<FormattedMessage id='web.footer.help'/>
- </Link>
- <Link
+ </a>
+ <a
id='terms_link'
className='pull-right footer-link'
- to={global.window.mm_config.TermsOfServiceLink}
+ target='_blank'
+ href={global.window.mm_config.TermsOfServiceLink}
>
<FormattedMessage id='web.footer.terms'/>
- </Link>
- <Link
+ </a>
+ <a
id='privacy_link'
className='pull-right footer-link'
- to={global.window.mm_config.PrivacyPolicyLink}
+ target='_blank'
+ href={global.window.mm_config.PrivacyPolicyLink}
>
<FormattedMessage id='web.footer.privacy'/>
- </Link>
- <Link
+ </a>
+ <a
id='about_link'
className='pull-right footer-link'
- to={global.window.mm_config.AboutLink}
+ target='_blank'
+ href={global.window.mm_config.AboutLink}
>
<FormattedMessage id='web.footer.about'/>
- </Link>
+ </a>
</div>
</div>
</div>
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';
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(
<PostsView
- key={'postsviewkey' + i}
+ key={'postsviewkey' + channels[i]}
isActive={isActive}
postList={postLists[i]}
scrollType={this.state.scrollType}
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);
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;
}
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();
}