diff options
-rw-r--r-- | CHANGELOG.md | 26 | ||||
-rw-r--r-- | model/gitlab/gitlab.go | 27 | ||||
-rw-r--r-- | web/react/components/admin_console/admin_sidebar.jsx | 1 | ||||
-rw-r--r-- | web/react/components/channel_loader.jsx | 4 | ||||
-rw-r--r-- | web/react/components/post_info.jsx | 3 | ||||
-rw-r--r-- | web/react/components/rhs_comment.jsx | 22 | ||||
-rw-r--r-- | web/react/components/rhs_root_post.jsx | 22 | ||||
-rw-r--r-- | web/react/stores/channel_store.jsx | 4 | ||||
-rw-r--r-- | web/react/stores/socket_store.jsx | 6 | ||||
-rw-r--r-- | web/react/utils/async_client.jsx | 2 | ||||
-rw-r--r-- | web/static/i18n/en.json | 2 |
11 files changed, 101 insertions, 18 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index bd9772b2b..8606fc72c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -150,21 +150,31 @@ The following is for informational purposes only, no action needed. Mattermost a #### Known Issues - Navigating to a page with new messages containing inline images added via markdown causes the channel to scroll up and down while loading the inline images. -- Microsoft Edge does not yet support drag and drop for file attachments. +- Microsoft Edge does not yet support drag and drop for file attachments. +- No error message on IE11 when uploading more than 5 files or a file over 50 MB. +- File name tooltip stays open after clicking to download. - Scroll bar does not appear in the center channel. - Unable to paste images into the text box on Firefox, Safari, and IE11. -- Importing from Slack fails to load messages in certain cases and breaks @mentions. -- System Console > TEAMS > Statistics > Newly Created Users shows all users as created "just now". -- Favicon does not turn red when @mentions and direct messages are received in an inactive browser tab. +- Importing from Slack fails to load channels in certain cases. +- System Console > Teams > Statistics > Newly Created Users shows all users as created "just now". +- Username and email display on single line in System Console user management tab. - Searching for a phrase in quotations returns more than just the phrase on installations with a Postgres database. - Archived channels are not removed from the "More" menu for the person that archived the channel until after refresh. +- First load of an empty channel does not display the introduction message. - Search results don't highlight searches for @username, non-latin characters, or terms inside Markdown code blocks. - Searching for a username or hashtag containing a dot returns a search where the dot is replaced with the "or" operator. +- Search term highlighting doesn't update on IE11 when search terms change but return the same posts. - Hashtags less than three characters long are not searchable. -- Users remains in the channel counter after being deactivated. -- Messages with symbols (<,>,-,+,=,%,^,#,*,|) directly before or after a hashtag are not searchable. -- Permalinks for the second message or later consecutively sent in a group by the same author displaces the copy link popover or causes an error -- Emoji smileys ending with a letter at the end of a message do not auto-complete as expected +- Hashtags containing a dash incorrectly highlight in the search results. +- Users remain in the channel counter after being deactivated. +- Permalinks for the second message or later consecutively sent in a group by the same author displaces the copy link popover or causes an error. +- Emoji smileys ending with a letter at the end of a message do not auto-complete as expected. +- Logout slash command does not force a logout. +- Incorrect formatting when a new line is added directly after a list. +- Timestamps are displayed in 12-hour format when set to 24-hour format. +- GIF links inside code blocks auto-post the GIFs. +- Syntax highlighting code block is missing the label for Latex documents. +- Deleted messages don't delete in the RHS until a page refresh. #### Contributors diff --git a/model/gitlab/gitlab.go b/model/gitlab/gitlab.go index 8b96c64f6..3ca499976 100644 --- a/model/gitlab/gitlab.go +++ b/model/gitlab/gitlab.go @@ -67,6 +67,18 @@ func gitLabUserFromJson(data io.Reader) *GitLabUser { } } +func (glu *GitLabUser) IsValid() bool { + if glu.Id == 0 { + return false + } + + if len(glu.Email) == 0 { + return false + } + + return true +} + func (glu *GitLabUser) getAuthData() string { return strconv.FormatInt(glu.Id, 10) } @@ -76,9 +88,20 @@ func (m *GitLabProvider) GetIdentifier() string { } func (m *GitLabProvider) GetUserFromJson(data io.Reader) *model.User { - return userFromGitLabUser(gitLabUserFromJson(data)) + glu := gitLabUserFromJson(data) + if glu.IsValid() { + return userFromGitLabUser(glu) + } + + return &model.User{} } func (m *GitLabProvider) GetAuthDataFromJson(data io.Reader) string { - return gitLabUserFromJson(data).getAuthData() + glu := gitLabUserFromJson(data) + + if glu.IsValid() { + return glu.getAuthData() + } + + return "" } diff --git a/web/react/components/admin_console/admin_sidebar.jsx b/web/react/components/admin_console/admin_sidebar.jsx index eadd8d412..795b19eec 100644 --- a/web/react/components/admin_console/admin_sidebar.jsx +++ b/web/react/components/admin_console/admin_sidebar.jsx @@ -50,6 +50,7 @@ export default class AdminSidebar extends React.Component { removeTeam(teamId, e) { e.preventDefault(); + e.stopPropagation(); Reflect.deleteProperty(this.props.selectedTeams, teamId); this.props.removeSelectedTeam(teamId); diff --git a/web/react/components/channel_loader.jsx b/web/react/components/channel_loader.jsx index 174c8c4e1..f3000ee05 100644 --- a/web/react/components/channel_loader.jsx +++ b/web/react/components/channel_loader.jsx @@ -95,6 +95,8 @@ class ChannelLoader extends React.Component { $(window).on('focus', function windowFocus() { AsyncClient.updateLastViewedAt(); + ChannelStore.resetCounts(ChannelStore.getCurrentId()); + ChannelStore.emitChange(); window.isActive = true; }); @@ -185,4 +187,4 @@ ChannelLoader.propTypes = { intl: intlShape.isRequired }; -export default injectIntl(ChannelLoader);
\ No newline at end of file +export default injectIntl(ChannelLoader); diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx index 6d82423d5..c44223b1f 100644 --- a/web/react/components/post_info.jsx +++ b/web/react/components/post_info.jsx @@ -144,7 +144,8 @@ export default class PostInfo extends React.Component { ); } - handlePermalink() { + handlePermalink(e) { + e.preventDefault(); EventHelpers.showGetPostLinkModal(this.props.post); } diff --git a/web/react/components/rhs_comment.jsx b/web/react/components/rhs_comment.jsx index 9c85e9940..0d15c8599 100644 --- a/web/react/components/rhs_comment.jsx +++ b/web/react/components/rhs_comment.jsx @@ -31,6 +31,7 @@ class RhsComment extends React.Component { this.retryComment = this.retryComment.bind(this); this.parseEmojis = this.parseEmojis.bind(this); + this.handlePermalink = this.handlePermalink.bind(this); this.state = {}; } @@ -67,6 +68,10 @@ class RhsComment extends React.Component { parseEmojis() { twemoji.parse(ReactDOM.findDOMNode(this), {size: Constants.EMOJI_SIZE}); } + handlePermalink(e) { + e.preventDefault(); + EventHelpers.showGetPostLinkModal(this.props.post); + } componentDidMount() { this.parseEmojis(); } @@ -92,6 +97,23 @@ class RhsComment extends React.Component { var dropdownContents = []; + dropdownContents.push( + <li + key='rhs-root-permalink' + role='presentation' + > + <a + href='#' + onClick={this.handlePermalink} + > + <FormattedMessage + id='rhs_comment.permalink' + defaultMessage='Permalink' + /> + </a> + </li> + ); + if (isOwner) { dropdownContents.push( <li diff --git a/web/react/components/rhs_root_post.jsx b/web/react/components/rhs_root_post.jsx index f9f7f8f81..54f2e8262 100644 --- a/web/react/components/rhs_root_post.jsx +++ b/web/react/components/rhs_root_post.jsx @@ -21,6 +21,7 @@ export default class RhsRootPost extends React.Component { super(props); this.parseEmojis = this.parseEmojis.bind(this); + this.handlePermalink = this.handlePermalink.bind(this); this.state = {}; } @@ -31,6 +32,10 @@ export default class RhsRootPost extends React.Component { folder: Emoji.getImagePathForEmoticon() }); } + handlePermalink(e) { + e.preventDefault(); + EventHelpers.showGetPostLinkModal(this.props.post); + } componentDidMount() { this.parseEmojis(); } @@ -83,6 +88,23 @@ export default class RhsRootPost extends React.Component { var dropdownContents = []; + dropdownContents.push( + <li + key='rhs-root-permalink' + role='presentation' + > + <a + href='#' + onClick={this.handlePermalink} + > + <FormattedMessage + id='rhs_root.permalink' + defaultMessage='Permalink' + /> + </a> + </li> + ); + if (isOwner) { dropdownContents.push( <li diff --git a/web/react/stores/channel_store.jsx b/web/react/stores/channel_store.jsx index ac800a988..60cb10de7 100644 --- a/web/react/stores/channel_store.jsx +++ b/web/react/stores/channel_store.jsx @@ -308,7 +308,7 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => { ChannelStore.storeChannels(action.channels); ChannelStore.storeChannelMembers(action.members); currentId = ChannelStore.getCurrentId(); - if (currentId && !document.hidden) { + if (currentId && window.isActive) { ChannelStore.resetCounts(currentId); } ChannelStore.setUnreadCounts(); @@ -321,7 +321,7 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => { ChannelStore.pStoreChannelMember(action.member); } currentId = ChannelStore.getCurrentId(); - if (currentId && !document.hidden) { + if (currentId && window.isActive) { ChannelStore.resetCounts(currentId); } ChannelStore.setUnreadCount(action.channel.id); diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx index 424c7fe57..efb57e226 100644 --- a/web/react/stores/socket_store.jsx +++ b/web/react/stores/socket_store.jsx @@ -202,10 +202,10 @@ function handleNewPostEvent(msg, translations) { // Update channel state if (ChannelStore.getCurrentId() === msg.channel_id) { - if (document.hidden) { - AsyncClient.getChannel(msg.channel_id); - } else { + if (window.isActive) { AsyncClient.updateLastViewedAt(); + } else { + AsyncClient.getChannel(msg.channel_id); } } else if (UserStore.getCurrentId() !== msg.user_id || post.type !== Constants.POST_TYPE_JOIN_LEAVE) { AsyncClient.getChannel(msg.channel_id); diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx index 45cdf699f..13b57092d 100644 --- a/web/react/utils/async_client.jsx +++ b/web/react/utils/async_client.jsx @@ -549,7 +549,7 @@ export function getPosts(id) { type: ActionTypes.RECEIVED_POSTS, id: channelId, before: true, - numRequested: Constants.POST_CHUNK_SIZE, + numRequested: 0, post_list: data }); diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json index e916d8423..4b20682af 100644 --- a/web/static/i18n/en.json +++ b/web/static/i18n/en.json @@ -827,11 +827,13 @@ "rename_channel.cancel": "Cancel", "rename_channel.save": "Save", "rhs_comment.comment": "Comment", + "rhs_comment.permalink": "Permalink", "rhs_comment.edit": "Edit", "rhs_comment.del": "Delete", "rhs_comment.retry": "Retry", "rhs_header.details": "Message Details", "rhs_root.direct": "Direct Message", + "rhs_root.permalink": "Permalink", "rhs_root.edit": "Edit", "rhs_root.del": "Delete", "search_bar.search": "Search", |