From d229a83eab5477656b83391e9e56066a2b5f3d8b Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Wed, 6 Jun 2018 16:49:49 -0400 Subject: [PATCH 01/22] Bump iOS build number to 106 (#1733) --- ios/Mattermost.xcodeproj/project.pbxproj | 4 ++-- ios/Mattermost/Info.plist | 2 +- ios/MattermostShare/Info.plist | 2 +- ios/MattermostTests/Info.plist | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index 77e247033..4cce677b6 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -2516,7 +2516,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 105; + CURRENT_PROJECT_VERSION = 106; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; @@ -2566,7 +2566,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 105; + CURRENT_PROJECT_VERSION = 106; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 9afc7be50..9e48fb726 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 105 + 106 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index dede86119..0d0c1b5e8 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -23,7 +23,7 @@ CFBundleShortVersionString 1.9.0 CFBundleVersion - 105 + 106 NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/ios/MattermostTests/Info.plist b/ios/MattermostTests/Info.plist index 2c2b377c0..1eec65630 100644 --- a/ios/MattermostTests/Info.plist +++ b/ios/MattermostTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 105 + 106 From b3f643d3153ca91d124b7497590f2d3791a67d9c Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Wed, 6 Jun 2018 16:53:15 -0400 Subject: [PATCH 02/22] Bump Android build number to 106 (#1734) --- android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index dde0859bf..08a99cdc5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -113,7 +113,7 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion 21 targetSdkVersion 23 - versionCode 105 + versionCode 106 versionName "1.9.0" ndk { abiFilters "armeabi-v7a", "x86" From fa17e9ad9da41440905c0fc4982ecf2cd2a84a5c Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 7 Jun 2018 10:17:08 -0400 Subject: [PATCH 03/22] Fixed dev-mode error relating to adjacent images (#1731) --- app/components/markdown/transform.js | 12 +++- app/components/markdown/transform.test.js | 78 +++++++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/app/components/markdown/transform.js b/app/components/markdown/transform.js index 0b01ddd4e..a7e5aa898 100644 --- a/app/components/markdown/transform.js +++ b/app/components/markdown/transform.js @@ -1,6 +1,8 @@ // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. +import {Node} from 'commonmark'; + /* eslint-disable no-underscore-dangle */ // Add indices to the items of every list @@ -185,7 +187,15 @@ function pullOutImage(image) { // Copies a Node without its parent, children, or siblings function copyNodeWithoutNeighbors(node) { // commonmark uses classes so it takes a bit of work to copy them - const copy = Object.assign(Object.create(Reflect.getPrototypeOf(node)), node); + const copy = new Node(); + + for (const key in node) { + if (!node.hasOwnProperty(key)) { + continue; + } + + copy[key] = node[key]; + } copy._parent = null; copy._firstChild = null; diff --git a/app/components/markdown/transform.test.js b/app/components/markdown/transform.test.js index 78152c016..8284e8611 100644 --- a/app/components/markdown/transform.test.js +++ b/app/components/markdown/transform.test.js @@ -1977,6 +1977,84 @@ describe('Components.Markdown.transform', () => { assert.equal(astToString(actual), astToString(expected)); assert.deepStrictEqual(actual, expected); }); + + it('adjacent images and text', () => { + const input = makeAst({ + type: 'document', + children: [{ + type: 'paragraph', + children: [{ + type: 'text', + literal: 'First:', + }, { + type: 'softbreak', + }, { + type: 'image', + destination: 'http://example.com/image', + children: [{ + type: 'text', + literal: 'Image', + }], + }, { + type: 'softbreak', + }, { + type: 'text', + literal: 'Second:', + }, { + type: 'softbreak', + }, { + type: 'image', + destination: 'http://example.com/image', + children: [{ + type: 'text', + literal: 'Image', + }], + }], + }], + }); + const expected = makeAst({ + type: 'document', + children: [{ + type: 'paragraph', + children: [{ + type: 'text', + literal: 'First:', + }, { + type: 'softbreak', + }], + }, { + type: 'image', + destination: 'http://example.com/image', + children: [{ + type: 'text', + literal: 'Image', + }], + }, { + type: 'paragraph', + continue: true, + children: [{ + type: 'softbreak', + }, { + type: 'text', + literal: 'Second:', + }, { + type: 'softbreak', + }], + }, { + type: 'image', + destination: 'http://example.com/image', + children: [{ + type: 'text', + literal: 'Image', + }], + }], + }); + const actual = pullOutImages(input); + + assert.ok(verifyAst(actual)); + assert.equal(astToString(actual), astToString(expected)); + assert.deepStrictEqual(actual, expected); + }); }); }); From c0b41cff33806c44c2e5fce5bf4b1ce912ac3cf2 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 7 Jun 2018 10:17:41 -0400 Subject: [PATCH 04/22] Fix Team icon background and radius in team lists (#1735) --- .../teams_list/teams_list_item/teams_list_item.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/components/channel_drawer/teams_list/teams_list_item/teams_list_item.js b/app/components/channel_drawer/teams_list/teams_list_item/teams_list_item.js index 319e9e38c..a8df3e966 100644 --- a/app/components/channel_drawer/teams_list/teams_list_item/teams_list_item.js +++ b/app/components/channel_drawer/teams_list/teams_list_item/teams_list_item.js @@ -77,7 +77,6 @@ export default class TeamsListItem extends React.PureComponent { teamId={teamId} styleContainer={styles.teamIconContainer} styleText={styles.teamIconText} - styleImage={styles.imageContainer} /> { teamIconContainer: { width: 40, height: 40, + backgroundColor: '#ffffff', }, teamIconText: { fontSize: 18, @@ -135,9 +135,6 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { color: changeOpacity(theme.sidebarText, 0.5), fontSize: 12, }, - imageContainer: { - backgroundColor: '#ffffff', - }, checkmarkContainer: { alignItems: 'flex-end', }, From 1cddb4590504503234185ffbb9a77c97f134a537 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 7 Jun 2018 10:17:57 -0400 Subject: [PATCH 05/22] Verify that the push notification version is not null (#1736) --- .../com/mattermost/rnbeta/CustomPushNotification.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java index edfe86de2..a07dcdb7f 100644 --- a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java +++ b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java @@ -146,7 +146,7 @@ public class CustomPushNotification extends PushNotification { String version = bundle.getString("version"); String title = null; - if (version.equals("v2")) { + if (version != null && version.equals("v2")) { title = bundle.getString("channel_name"); } else { title = bundle.getString("title"); @@ -217,7 +217,7 @@ public class CustomPushNotification extends PushNotification { } else { String summaryTitle = null; - if (version.equals("v2")) { + if (version != null && version.equals("v2")) { summaryTitle = String.format("(%d) %s", numMessages, title); } else { summaryTitle = String.format("%s (%d)", title, numMessages); @@ -232,7 +232,7 @@ public class CustomPushNotification extends PushNotification { list = new ArrayList(); } - if (version.equals("v2")) { + if (version != null && version.equals("v2")) { style.addLine(message); } @@ -243,7 +243,7 @@ public class CustomPushNotification extends PushNotification { } } - if (version.equals("v2")) { + if (version != null && version.equals("v2")) { notification .setContentTitle(summaryTitle) .setContentText(message) From c63ca6a7e07f6bcc3e6d7dc8d9605d3e9574c81e Mon Sep 17 00:00:00 2001 From: Chris Duarte Date: Thu, 7 Jun 2018 11:47:10 -0700 Subject: [PATCH 06/22] Ping server after setting app offline/online. Also include timeout (#1739) * Ping server after setting app offline/online. Also include timeout * Add missing semicolon --- app/utils/network.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/utils/network.js b/app/utils/network.js index cd8253911..08527d162 100644 --- a/app/utils/network.js +++ b/app/utils/network.js @@ -1,7 +1,11 @@ import {NetInfo} from 'react-native'; +import RNFetchBlob from 'react-native-fetch-blob'; + import {Client4} from 'mattermost-redux/client'; +const PING_TIMEOUT = 10000; + export async function checkConnection(isConnected) { if (Client4.getBaseRoute() === '/api/v4') { // If we don't have a server yet, return the default implementation @@ -12,7 +16,7 @@ export async function checkConnection(isConnected) { const server = `${Client4.getBaseRoute()}/system/ping?time=${Date.now()}`; try { - await fetch(server, {method: 'get'}); + await RNFetchBlob.config({timeout: PING_TIMEOUT}).fetch('GET', server); return true; } catch (error) { return false; @@ -21,6 +25,10 @@ export async function checkConnection(isConnected) { function handleConnectionChange(onChange) { return async (isConnected) => { + // Set device internet connectivity immediately + onChange(isConnected); + + // Check if connected to server const result = await checkConnection(isConnected); onChange(result); }; From 02f0e7348d2ed281cc6c372485f33df98452d9e8 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 7 Jun 2018 14:48:42 -0400 Subject: [PATCH 07/22] Update mm-redux to use release-5.0 branch (#1738) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 042fc6b09..52d2a995c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9878,8 +9878,8 @@ } }, "mattermost-redux": { - "version": "github:mattermost/mattermost-redux#fe27e2bfa465aea739e82afe18fa7a6f512f74a0", - "from": "github:mattermost/mattermost-redux#fe27e2bfa465aea739e82afe18fa7a6f512f74a0", + "version": "github:mattermost/mattermost-redux#8870c690f2e29d301a65fc2f0cba77070f355fa3", + "from": "github:mattermost/mattermost-redux#8870c690f2e29d301a65fc2f0cba77070f355fa3", "requires": { "deep-equal": "1.0.1", "eslint-plugin-header": "1.2.0", diff --git a/package.json b/package.json index be22a9d0d..2e5c0a9c3 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "intl": "1.2.5", "jail-monkey": "1.0.0", "jsc-android": "216113.0.3", - "mattermost-redux": "github:mattermost/mattermost-redux#fe27e2bfa465aea739e82afe18fa7a6f512f74a0", + "mattermost-redux": "github:mattermost/mattermost-redux#8870c690f2e29d301a65fc2f0cba77070f355fa3", "mime-db": "1.33.0", "prop-types": "15.6.1", "react": "16.3.2", From 90adb0524bd6096596fb7f1adec159b8ce3d307f Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Fri, 8 Jun 2018 03:52:40 +0800 Subject: [PATCH 08/22] remove converted channel (into private) from "MoreChannels" screen of joinable channels (#1740) --- app/screens/more_channels/more_channels.js | 31 ++++++++++++++++------ package-lock.json | 4 +-- package.json | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/screens/more_channels/more_channels.js b/app/screens/more_channels/more_channels.js index 245e2ee92..29237ce8a 100644 --- a/app/screens/more_channels/more_channels.js +++ b/app/screens/more_channels/more_channels.js @@ -100,15 +100,30 @@ export default class MoreChannels extends PureComponent { setNavigatorStyles(this.props.navigator, nextProps.theme); } + const {page, searching, term} = this.state; + + let channels; + if (nextProps.channels !== this.props.channels) { + channels = nextProps.channels.slice(0, (page + 1) * General.CHANNELS_CHUNK_SIZE); + if (term) { + channels = this.filterChannels(nextProps.channels, term); + } + } + const {requestStatus} = this.props; - if (this.state.searching && - nextProps.requestStatus.status === RequestStatus.SUCCESS) { - const channels = this.filterChannels(nextProps.channels, this.state.term); - this.setState({channels, showNoResults: true}); - } else if (requestStatus.status === RequestStatus.STARTED && - nextProps.requestStatus.status === RequestStatus.SUCCESS) { - const {page} = this.state; - const channels = nextProps.channels.slice(0, (page + 1) * General.CHANNELS_CHUNK_SIZE); + if ( + searching && + nextProps.requestStatus.status === RequestStatus.SUCCESS + ) { + channels = this.filterChannels(nextProps.channels, term); + } else if ( + requestStatus.status === RequestStatus.STARTED && + nextProps.requestStatus.status === RequestStatus.SUCCESS + ) { + channels = nextProps.channels.slice(0, (page + 1) * General.CHANNELS_CHUNK_SIZE); + } + + if (channels) { this.setState({channels, showNoResults: true}); } diff --git a/package-lock.json b/package-lock.json index 52d2a995c..4e0522550 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9878,8 +9878,8 @@ } }, "mattermost-redux": { - "version": "github:mattermost/mattermost-redux#8870c690f2e29d301a65fc2f0cba77070f355fa3", - "from": "github:mattermost/mattermost-redux#8870c690f2e29d301a65fc2f0cba77070f355fa3", + "version": "github:mattermost/mattermost-redux#2ef52763c82ca1ad338e5a4dc3dc557a0ecfd528", + "from": "github:mattermost/mattermost-redux#2ef52763c82ca1ad338e5a4dc3dc557a0ecfd528", "requires": { "deep-equal": "1.0.1", "eslint-plugin-header": "1.2.0", diff --git a/package.json b/package.json index 2e5c0a9c3..478977ef6 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "intl": "1.2.5", "jail-monkey": "1.0.0", "jsc-android": "216113.0.3", - "mattermost-redux": "github:mattermost/mattermost-redux#8870c690f2e29d301a65fc2f0cba77070f355fa3", + "mattermost-redux": "github:mattermost/mattermost-redux#2ef52763c82ca1ad338e5a4dc3dc557a0ecfd528", "mime-db": "1.33.0", "prop-types": "15.6.1", "react": "16.3.2", From 2dcf718f816095b3ae007fb7f466aaf91f11ffb2 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 7 Jun 2018 15:58:04 -0400 Subject: [PATCH 09/22] Fix iOS type error warnings (#1737) --- app/store/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/store/index.js b/app/store/index.js index e47f79186..e49da1589 100644 --- a/app/store/index.js +++ b/app/store/index.js @@ -170,6 +170,9 @@ export default function configureAppStore(initialState) { users: { ...state.entities.users, profilesInChannel, + profilesNotInTeam: [], + profilesWithoutTeam: [], + profilesNotInChannel: [], }, }; mattermostBucket.writeToFile('entities', JSON.stringify(entities), Config.AppGroupId); From bbe27df6ea4076106688938cb5e7153aa0bbe44e Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 7 Jun 2018 16:24:24 -0400 Subject: [PATCH 10/22] MM-10784 Remove keyboard animation (#1742) * Patch layout bug * Fixed warnings --- .../layout/keyboard_layout/keyboard_layout.js | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/app/components/layout/keyboard_layout/keyboard_layout.js b/app/components/layout/keyboard_layout/keyboard_layout.js index 6a3377b65..cf342412e 100644 --- a/app/components/layout/keyboard_layout/keyboard_layout.js +++ b/app/components/layout/keyboard_layout/keyboard_layout.js @@ -3,12 +3,10 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Animated, Keyboard, Platform, View} from 'react-native'; +import {Keyboard, Platform, View} from 'react-native'; import {makeStyleSheetFromTheme} from 'app/utils/theme'; -const {View: AnimatedView} = Animated; - export default class KeyboardLayout extends PureComponent { static propTypes = { children: PropTypes.node, @@ -25,7 +23,7 @@ export default class KeyboardLayout extends PureComponent { this.subscriptions = []; this.count = 0; this.state = { - bottom: new Animated.Value(0), + bottom: 0, }; } @@ -42,26 +40,20 @@ export default class KeyboardLayout extends PureComponent { this.subscriptions.forEach((sub) => sub.remove()); } - onKeyboardWillHide = (e) => { - const {duration} = e; - Animated.timing(this.state.bottom, { - toValue: 0, - duration, - }).start(); + onKeyboardWillHide = () => { + this.setState({bottom: 0}); }; onKeyboardChange = (e) => { if (!e) { - this.setState({bottom: new Animated.Value(0)}); + this.setState({bottom: 0}); return; } - const {endCoordinates, duration} = e; + const {endCoordinates} = e; const {height} = endCoordinates; - Animated.timing(this.state.bottom, { - toValue: height, - duration, - }).start(); + + this.setState({bottom: height}); }; render() { @@ -80,11 +72,11 @@ export default class KeyboardLayout extends PureComponent { } return ( - {children} - + ); } } From b12d4cd91b721cfdd83e5b70bc07bc57facf3680 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 7 Jun 2018 17:13:29 -0400 Subject: [PATCH 11/22] MM-10823 Switch to default channel after leaving channel (#1743) --- app/actions/views/channel.js | 16 ++++++++++++---- app/screens/channel/channel.js | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/actions/views/channel.js b/app/actions/views/channel.js index 7458c3b95..cf5e4a555 100644 --- a/app/actions/views/channel.js +++ b/app/actions/views/channel.js @@ -244,7 +244,7 @@ export function loadThreadIfNecessary(rootId, channelId) { } export function selectInitialChannel(teamId) { - return async (dispatch, getState) => { + return (dispatch, getState) => { const state = getState(); const {channels, myMembers} = state.entities.channels; const {currentUserId} = state.entities.users; @@ -266,6 +266,14 @@ export function selectInitialChannel(teamId) { return; } + dispatch(selectDefaultChannel(teamId)); + }; +} + +export function selectDefaultChannel(teamId) { + return (dispatch, getState) => { + const channels = getState().entities.channels.channels; + const channel = Object.values(channels).find((c) => c.team_id === teamId && c.name === General.DEFAULT_CHANNEL); let channelId; if (channel) { @@ -281,8 +289,8 @@ export function selectInitialChannel(teamId) { if (channelId) { dispatch(setChannelDisplayName('')); - handleSelectChannel(channelId)(dispatch, getState); - markChannelAsRead(channelId)(dispatch, getState); + dispatch(handleSelectChannel(channelId)); + dispatch(markChannelAsRead(channelId)); } }; } @@ -417,7 +425,7 @@ export function leaveChannel(channel, reset = false) { }); if (channel.id === currentChannelId || reset) { - await dispatch(selectInitialChannel(currentTeamId)); + await dispatch(selectDefaultChannel(currentTeamId)); } await serviceLeaveChannel(channel.id)(dispatch, getState); diff --git a/app/screens/channel/channel.js b/app/screens/channel/channel.js index 60c3a7e9d..0d0d2d9e1 100644 --- a/app/screens/channel/channel.js +++ b/app/screens/channel/channel.js @@ -213,9 +213,9 @@ export default class Channel extends PureComponent { loadChannelsIfNecessary(teamId).then(() => { loadProfilesAndTeamMembersForDMSidebar(teamId); - return selectInitialChannel(teamId); + selectInitialChannel(teamId); }).catch(() => { - return selectInitialChannel(teamId); + selectInitialChannel(teamId); }); }; From 2f3488f622c3d5bc10ab4397b77374ed2e5567aa Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Fri, 8 Jun 2018 05:14:42 +0800 Subject: [PATCH 12/22] MM-10340 Fix "More New Messages Above" that appears on top of the channel after joining (#1710) * Replace "More New Messages Above" with "New Messages" that appears on top of the channel after joining Signed-off-by: Saturnino Abril * add conditions in adding entry of start of new messages in preparing post IDs for post list * remove post unread for user joinining the channel * refactor and remove unnecessary conditional check * fix and add test cases --- app/selectors/post_list.js | 10 +++++++--- app/selectors/post_list.test.js | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/selectors/post_list.js b/app/selectors/post_list.js index a8e7c447c..272903edb 100644 --- a/app/selectors/post_list.js +++ b/app/selectors/post_list.js @@ -65,9 +65,13 @@ export function makePreparePostIdsForPostList() { lastDate = postDate; } - // Only add the new messages line if a lastViewedAt time is set - const postIsUnread = post.create_at > lastViewedAt && post.user_id !== currentUser.id; - if (lastViewedAt !== null && !addedNewMessagesIndicator && postIsUnread && indicateNewMessages) { + if ( + lastViewedAt && + post.create_at > lastViewedAt && + post.user_id !== currentUser.id && + !addedNewMessagesIndicator && + indicateNewMessages + ) { out.push(START_OF_NEW_MESSAGES); addedNewMessagesIndicator = true; } diff --git a/app/selectors/post_list.test.js b/app/selectors/post_list.test.js index a5cd0b5e4..68d99bd2e 100644 --- a/app/selectors/post_list.test.js +++ b/app/selectors/post_list.test.js @@ -136,14 +136,27 @@ describe('Selectors.PostList', () => { const postIds = ['1010', '1005', '1000']; // Remember that we list the posts backwards - // Show new messages indicator before all posts + // Do not show new messages indicator before all posts let now = preparePostIdsForPostList(state, {postIds, lastViewedAt: 0, indicateNewMessages: true}); + assert.deepEqual(removeDateLines(now), ['1010', '1005', '1000']); + + now = preparePostIdsForPostList(state, {postIds, indicateNewMessages: true}); + assert.deepEqual(removeDateLines(now), ['1010', '1005', '1000']); + + now = preparePostIdsForPostList(state, {postIds, lastViewedAt: 999, indicateNewMessages: false}); + assert.deepEqual(removeDateLines(now), ['1010', '1005', '1000']); + + // Show new messages indicator before all posts + now = preparePostIdsForPostList(state, {postIds, lastViewedAt: 999, indicateNewMessages: true}); assert.deepEqual(removeDateLines(now), ['1010', '1005', '1000', START_OF_NEW_MESSAGES]); // Show indicator between posts now = preparePostIdsForPostList(state, {postIds, lastViewedAt: 1003, indicateNewMessages: true}); assert.deepEqual(removeDateLines(now), ['1010', '1005', START_OF_NEW_MESSAGES, '1000']); + now = preparePostIdsForPostList(state, {postIds, lastViewedAt: 1006, indicateNewMessages: true}); + assert.deepEqual(removeDateLines(now), ['1010', START_OF_NEW_MESSAGES, '1005', '1000']); + // Don't show indicator when all posts are read now = preparePostIdsForPostList(state, {postIds, lastViewedAt: 1020}); assert.deepEqual(removeDateLines(now), ['1010', '1005', '1000']); From 1b6adb1fb4dbf76213f42f44012345aa45d79da5 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 8 Jun 2018 09:09:39 -0400 Subject: [PATCH 13/22] Bump iOS build number to 107 (#1745) --- ios/Mattermost.xcodeproj/project.pbxproj | 4 ++-- ios/Mattermost/Info.plist | 2 +- ios/MattermostShare/Info.plist | 2 +- ios/MattermostTests/Info.plist | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index 4cce677b6..7236dad01 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -2516,7 +2516,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 106; + CURRENT_PROJECT_VERSION = 107; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; @@ -2566,7 +2566,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 106; + CURRENT_PROJECT_VERSION = 107; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 9e48fb726..ac8d1395e 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 106 + 107 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index 0d0c1b5e8..e820a274a 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -23,7 +23,7 @@ CFBundleShortVersionString 1.9.0 CFBundleVersion - 106 + 107 NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/ios/MattermostTests/Info.plist b/ios/MattermostTests/Info.plist index 1eec65630..17064944a 100644 --- a/ios/MattermostTests/Info.plist +++ b/ios/MattermostTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 106 + 107 From 2ed45dbe28c509467e9856bed75140737bdedd04 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 8 Jun 2018 10:40:20 -0400 Subject: [PATCH 14/22] Bump Android build number to 107 (#1746) --- android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 08a99cdc5..c5d9077b3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -113,7 +113,7 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion 21 targetSdkVersion 23 - versionCode 106 + versionCode 107 versionName "1.9.0" ndk { abiFilters "armeabi-v7a", "x86" From e3e2456ecd54f1e66a0b87731b78cca50eb7ebe5 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 8 Jun 2018 14:15:56 -0400 Subject: [PATCH 15/22] Fix android share extension channel switching and searching --- .../search_bar/search_bar.android.js | 15 ++++----- .../extension_channels/extension_channels.js | 33 ++++++++++--------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/app/components/search_bar/search_bar.android.js b/app/components/search_bar/search_bar.android.js index 17dac6e79..f0ecda7c2 100644 --- a/app/components/search_bar/search_bar.android.js +++ b/app/components/search_bar/search_bar.android.js @@ -70,11 +70,6 @@ export default class SearchBarAndroid extends PureComponent { isFocused: false, }; } - componentWillReceiveProps(nextProps) { - if (this.state.value !== nextProps.value) { - this.setState({value: nextProps.value}); - } - } cancel = () => { this.onCancelButtonPress(); @@ -153,10 +148,12 @@ export default class SearchBarAndroid extends PureComponent { } = this.props; const {isFocused} = this.state; - const inputNoBackground = { - ...inputStyle, - }; - Reflect.deleteProperty(inputNoBackground, 'backgroundColor'); + const { + backgroundColor: bgColor, //eslint-disable-line no-unused-vars + ...otherStyles + } = inputStyle; + + const inputNoBackground = otherStyles; let inputColor = styles.searchBarInput.backgroundColor; if (inputStyle) { diff --git a/share_extension/android/extension_channels/extension_channels.js b/share_extension/android/extension_channels/extension_channels.js index 83014092c..940880a70 100644 --- a/share_extension/android/extension_channels/extension_channels.js +++ b/share_extension/android/extension_channels/extension_channels.js @@ -129,21 +129,23 @@ export default class ExtensionTeam extends PureComponent { } return ( - + + {this.renderSearchBar(styles)} + + ); }; @@ -188,7 +190,6 @@ export default class ExtensionTeam extends PureComponent { titleCancelColor={defaultTheme.centerChannelColor} onChangeText={this.handleSearch} autoCapitalize='none' - value={this.state.term} /> ); From a2af6b5fd68bfc2ebc5cc7d58efc7accf6eb5d8c Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 8 Jun 2018 16:18:14 -0400 Subject: [PATCH 16/22] Fix inApp notification handler (#1749) --- app/screens/entry/entry.js | 2 +- app/screens/notification/notification.js | 38 ++++++++++++++++++++---- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/app/screens/entry/entry.js b/app/screens/entry/entry.js index 9c4622cee..afda50b5c 100644 --- a/app/screens/entry/entry.js +++ b/app/screens/entry/entry.js @@ -227,7 +227,7 @@ export default class Entry extends PureComponent { navigator: this.props.navigator, }; - return wrapWithContextProvider(ChannelScreen, true)(props); + return wrapWithContextProvider(ChannelScreen, false)(props); }; render() { diff --git a/app/screens/notification/notification.js b/app/screens/notification/notification.js index 8efa23e59..1a949e018 100644 --- a/app/screens/notification/notification.js +++ b/app/screens/notification/notification.js @@ -92,8 +92,28 @@ export default class Notification extends PureComponent { return icon; }; - getNotificationTitle = (titleText) => { + getNotificationTitle = (notification) => { const {channel} = this.props; + const {message, data} = notification; + + if (data.version === 'v2') { + if (data.channel_name) { + return ( + + {data.channel_name} + + ); + } + + return null; + } + + const msg = message.split(':'); + const titleText = msg.shift(); let title = ( Date: Fri, 8 Jun 2018 16:27:54 -0400 Subject: [PATCH 17/22] update mattermost-redux (#1750) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4e0522550..b3e60c656 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9878,8 +9878,8 @@ } }, "mattermost-redux": { - "version": "github:mattermost/mattermost-redux#2ef52763c82ca1ad338e5a4dc3dc557a0ecfd528", - "from": "github:mattermost/mattermost-redux#2ef52763c82ca1ad338e5a4dc3dc557a0ecfd528", + "version": "github:mattermost/mattermost-redux#c000a81479a3b37de4e7815ef6f623c3e3649a20", + "from": "github:mattermost/mattermost-redux#c000a81479a3b37de4e7815ef6f623c3e3649a20", "requires": { "deep-equal": "1.0.1", "eslint-plugin-header": "1.2.0", diff --git a/package.json b/package.json index 478977ef6..2d657dff2 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "intl": "1.2.5", "jail-monkey": "1.0.0", "jsc-android": "216113.0.3", - "mattermost-redux": "github:mattermost/mattermost-redux#2ef52763c82ca1ad338e5a4dc3dc557a0ecfd528", + "mattermost-redux": "github:mattermost/mattermost-redux#c000a81479a3b37de4e7815ef6f623c3e3649a20", "mime-db": "1.33.0", "prop-types": "15.6.1", "react": "16.3.2", From 954ffeaadfdc52ce919cb0f699ae0667917a9fc9 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Sat, 9 Jun 2018 05:25:45 +0800 Subject: [PATCH 18/22] set solid background color on permalick header divider (#1752) --- app/screens/permalink/permalink.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/screens/permalink/permalink.js b/app/screens/permalink/permalink.js index a6456660f..eb0fbca64 100644 --- a/app/screens/permalink/permalink.js +++ b/app/screens/permalink/permalink.js @@ -370,6 +370,9 @@ export default class Permalink extends PureComponent { + + + {postList} @@ -407,8 +410,6 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { header: { alignItems: 'center', backgroundColor: theme.centerChannelBg, - borderBottomColor: changeOpacity(theme.centerChannelColor, 0.2), - borderBottomWidth: 1, borderTopLeftRadius: 6, borderTopRightRadius: 6, flexDirection: 'row', @@ -416,6 +417,13 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { paddingRight: 16, width: '100%', }, + dividerContainer: { + backgroundColor: theme.centerChannelBg, + }, + divider: { + backgroundColor: changeOpacity(theme.centerChannelColor, 0.2), + height: 1, + }, close: { justifyContent: 'center', height: 44, From 19729db610298faa161df5d8af126159f8755640 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 8 Jun 2018 17:35:33 -0400 Subject: [PATCH 19/22] Fix user is typing cut off on iOS (#1744) --- .../post_textbox/components/typing/typing.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/components/post_textbox/components/typing/typing.js b/app/components/post_textbox/components/typing/typing.js index 1f4820e4e..145a144a8 100644 --- a/app/components/post_textbox/components/typing/typing.js +++ b/app/components/post_textbox/components/typing/typing.js @@ -2,6 +2,7 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; import { Animated, + Platform, Text, } from 'react-native'; @@ -94,7 +95,14 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => { paddingLeft: 10, paddingTop: 3, fontSize: 11, - marginBottom: 5, + ...Platform.select({ + android: { + marginBottom: 5, + }, + ios: { + marginBottom: 2, + }, + }), color: theme.centerChannelColor, backgroundColor: 'transparent', }, From 27b68c74dca8ea5269725559b370283ec4123651 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 8 Jun 2018 17:42:04 -0400 Subject: [PATCH 20/22] Fix roles Set issue and update device-info to not cache appVersion (#1753) --- app/store/index.js | 5 +++++ package-lock.json | 8 ++++---- package.json | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/store/index.js b/app/store/index.js index e49da1589..9c1b9983b 100644 --- a/app/store/index.js +++ b/app/store/index.js @@ -38,9 +38,14 @@ const channelSetTransform = [ 'channelsInTeam', ]; +const rolesSetTransform = [ + 'pending', +]; + const setTransforms = [ ...usersSetTransform, ...channelSetTransform, + ...rolesSetTransform, ]; export default function configureAppStore(initialState) { diff --git a/package-lock.json b/package-lock.json index b3e60c656..a947184eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9878,8 +9878,8 @@ } }, "mattermost-redux": { - "version": "github:mattermost/mattermost-redux#c000a81479a3b37de4e7815ef6f623c3e3649a20", - "from": "github:mattermost/mattermost-redux#c000a81479a3b37de4e7815ef6f623c3e3649a20", + "version": "github:mattermost/mattermost-redux#b81b6c647b226554cb0d410578562e5f876f4d9b", + "from": "github:mattermost/mattermost-redux#b81b6c647b226554cb0d410578562e5f876f4d9b", "requires": { "deep-equal": "1.0.1", "eslint-plugin-header": "1.2.0", @@ -14427,8 +14427,8 @@ } }, "react-native-device-info": { - "version": "github:enahum/react-native-device-info#27ecfd4a59341bf6ed71d11203d914067070e8df", - "from": "react-native-device-info@github:enahum/react-native-device-info#27ecfd4a59341bf6ed71d11203d914067070e8df" + "version": "github:enahum/react-native-device-info#a7bb3cff1086780b2c791a3e43e5b826fdf3ab11", + "from": "github:enahum/react-native-device-info#a7bb3cff1086780b2c791a3e43e5b826fdf3ab11" }, "react-native-dismiss-keyboard": { "version": "1.0.0", diff --git a/package.json b/package.json index 2d657dff2..b28577986 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "intl": "1.2.5", "jail-monkey": "1.0.0", "jsc-android": "216113.0.3", - "mattermost-redux": "github:mattermost/mattermost-redux#c000a81479a3b37de4e7815ef6f623c3e3649a20", + "mattermost-redux": "github:mattermost/mattermost-redux#b81b6c647b226554cb0d410578562e5f876f4d9b", "mime-db": "1.33.0", "prop-types": "15.6.1", "react": "16.3.2", @@ -26,7 +26,7 @@ "react-native-button": "2.3.0", "react-native-circular-progress": "0.2.0", "react-native-cookies": "3.2.0", - "react-native-device-info": "enahum/react-native-device-info.git#27ecfd4a59341bf6ed71d11203d914067070e8df", + "react-native-device-info": "enahum/react-native-device-info.git#a7bb3cff1086780b2c791a3e43e5b826fdf3ab11", "react-native-doc-viewer": "2.7.8", "react-native-document-picker": "2.1.0", "react-native-drawer": "2.5.0", From efb5d2185c2ab931a82be5d3905ca94a34e14a8d Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 8 Jun 2018 18:02:42 -0400 Subject: [PATCH 21/22] Bump iOS build number to 108 (#1754) --- ios/Mattermost.xcodeproj/project.pbxproj | 4 ++-- ios/Mattermost/Info.plist | 2 +- ios/MattermostShare/Info.plist | 2 +- ios/MattermostTests/Info.plist | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index 7236dad01..3aa2fc6b9 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -2516,7 +2516,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 107; + CURRENT_PROJECT_VERSION = 108; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; @@ -2566,7 +2566,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 107; + CURRENT_PROJECT_VERSION = 108; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index ac8d1395e..82cc61ce8 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 107 + 108 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index e820a274a..4bbd49910 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -23,7 +23,7 @@ CFBundleShortVersionString 1.9.0 CFBundleVersion - 107 + 108 NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/ios/MattermostTests/Info.plist b/ios/MattermostTests/Info.plist index 17064944a..83a4fc3bc 100644 --- a/ios/MattermostTests/Info.plist +++ b/ios/MattermostTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 107 + 108 From 4a6e332d7eaefef95b652061517f98d46f31e546 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 8 Jun 2018 18:10:14 -0400 Subject: [PATCH 22/22] Bump Android build number to 108 (#1755) --- android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index c5d9077b3..9a13259d6 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -113,7 +113,7 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion 21 targetSdkVersion 23 - versionCode 107 + versionCode 108 versionName "1.9.0" ndk { abiFilters "armeabi-v7a", "x86"