From 4b20dc5e6610a4b24a20525661f223e8a2a7acf5 Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 7 Dec 2017 12:16:45 -0300 Subject: [PATCH 1/9] Fix channel editing for DM and GM channels (#1276) --- app/screens/edit_channel/edit_channel.js | 28 ++++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/app/screens/edit_channel/edit_channel.js b/app/screens/edit_channel/edit_channel.js index 88872c0a3..af1097a8c 100644 --- a/app/screens/edit_channel/edit_channel.js +++ b/app/screens/edit_channel/edit_channel.js @@ -9,7 +9,7 @@ import { InteractionManager } from 'react-native'; -import {RequestStatus} from 'mattermost-redux/constants'; +import {General, RequestStatus} from 'mattermost-redux/constants'; import EventEmitter from 'mattermost-redux/utils/event_emitter'; import EditChannelInfo from 'app/components/edit_channel_info'; @@ -199,23 +199,27 @@ export default class EditChannel extends PureComponent { onUpdateChannel = () => { Keyboard.dismiss(); const {displayName, channelURL, purpose, header} = this.state; - const {channel: {id}} = this.props; + const {channel: {id, type}} = this.props; + const isDirect = type === General.DM_CHANNEL || type === General.GM_CHANNEL; const channel = { - display_name: displayName, + display_name: isDirect ? '' : displayName, name: channelURL, purpose, header }; - let result = this.validateDisplayName(displayName.trim()); - if (result.error) { - this.setState({error: result.error}); - return; - } - result = this.validateChannelURL(channelURL.trim()); - if (result.error) { - this.setState({error: result.error}); - return; + if (!isDirect) { + let result = this.validateDisplayName(displayName.trim()); + if (result.error) { + this.setState({error: result.error}); + return; + } + + result = this.validateChannelURL(channelURL.trim()); + if (result.error) { + this.setState({error: result.error}); + return; + } } this.props.actions.patchChannel(id, channel); From e1051395ba49f1947f01541f0845d8ad347b179a Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 7 Dec 2017 12:17:12 -0300 Subject: [PATCH 2/9] Android: Show center screen from user profile (#1264) --- app/screens/user_profile/user_profile.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/screens/user_profile/user_profile.js b/app/screens/user_profile/user_profile.js index dc6370822..e5877d6d1 100644 --- a/app/screens/user_profile/user_profile.js +++ b/app/screens/user_profile/user_profile.js @@ -49,11 +49,11 @@ class UserProfile extends PureComponent { close = () => { const {navigator} = this.props; - if (Platform.OS === 'ios') { - navigator.popToRoot({ - animated: true - }); - } else { + navigator.popToRoot({ + animated: true + }); + + if (Platform.OS === 'android') { navigator.dismissModal({ animationType: 'slide-down' }); From e68374d757a96efef732dd1f91b12dd5c286df43 Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 7 Dec 2017 12:17:52 -0300 Subject: [PATCH 3/9] Fix replying to a search result (#1278) --- app/components/post_textbox/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/post_textbox/index.js b/app/components/post_textbox/index.js index a24489d00..23d60c155 100644 --- a/app/components/post_textbox/index.js +++ b/app/components/post_textbox/index.js @@ -24,7 +24,7 @@ function mapStateToProps(state, ownProps) { const currentDraft = ownProps.rootId ? getThreadDraft(state, ownProps.rootId) : getCurrentChannelDraft(state); return { - channelId: getCurrentChannelId(state), + channelId: ownProps.channelId || getCurrentChannelId(state), canUploadFiles: canUploadFilesOnMobile(state), channelIsLoading: state.views.channel.loading, currentUserId: getCurrentUserId(state), From 9b55868ced5dfd581ee6924c188abcb7aac9a7c1 Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 7 Dec 2017 12:18:43 -0300 Subject: [PATCH 4/9] Hide keyboard when bringing the app to the foreground (#1279) --- app/mattermost.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/mattermost.js b/app/mattermost.js index 076e7d270..086c41a70 100644 --- a/app/mattermost.js +++ b/app/mattermost.js @@ -10,6 +10,7 @@ import { Alert, AppState, InteractionManager, + Keyboard, NativeModules, Platform } from 'react-native'; @@ -194,6 +195,7 @@ export default class Mattermost { } } else if (isActive) { this.inBackgroundSince = null; + Keyboard.dismiss(); } } catch (error) { // do nothing From f2a02d77565f1e6ac4bc94ddc45ed8b6c9d17055 Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 7 Dec 2017 12:19:11 -0300 Subject: [PATCH 5/9] Keep keyboard open in login screen (#1280) --- app/screens/login/login.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/screens/login/login.js b/app/screens/login/login.js index 6262b0a4d..466ff71f7 100644 --- a/app/screens/login/login.js +++ b/app/screens/login/login.js @@ -131,6 +131,7 @@ class Login extends PureComponent { blur = () => { this.loginId.blur(); this.passwd.blur(); + Keyboard.dismiss(); }; preSignIn = wrapWithPreventDoubleTap(() => { @@ -341,6 +342,7 @@ class Login extends PureComponent { ref={this.scrollRef} style={style.container} contentContainerStyle={style.innerContainer} + keyboardShouldPersistTaps='handled' > Date: Thu, 7 Dec 2017 12:19:42 -0300 Subject: [PATCH 6/9] Android: Avoid crash when clearing notifications (#1282) --- .../java/com/mattermost/rnbeta/CustomPushNotification.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 98881b318..aa2d51f84 100644 --- a/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java +++ b/android/app/src/main/java/com/mattermost/rnbeta/CustomPushNotification.java @@ -56,8 +56,10 @@ public class CustomPushNotification extends PushNotification { if (notificationId != -1) { channelIdToNotificationCount.remove(channelId); channelIdToNotification.remove(channelId); - final NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - notificationManager.cancel(notificationId); + if (context != null) { + final NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + notificationManager.cancel(notificationId); + } } } From ece329f540a0b6932dc732255f73b3b473dd193f Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 7 Dec 2017 12:21:10 -0300 Subject: [PATCH 7/9] Android: Fix image not displaying in preview (#1281) --- app/screens/image_preview/previewer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/screens/image_preview/previewer.js b/app/screens/image_preview/previewer.js index 4b8aa6ebc..87865f458 100644 --- a/app/screens/image_preview/previewer.js +++ b/app/screens/image_preview/previewer.js @@ -255,6 +255,10 @@ export default class Previewer extends Component { }; const opacity = isInFetchCache ? 1 : this.state.opacity; + const containerStyle = Platform.select({ + android: {height: imageHeight, width: this.state.imageWidth, backgroundColor: '#000'}, + ios: {flex: 1, backgroundColor: '#000'} + }); return ( - + Date: Thu, 7 Dec 2017 13:13:28 -0300 Subject: [PATCH 8/9] Version Bump to 72 (#1283) --- ios/Mattermost.xcodeproj/project.pbxproj | 4 ++-- ios/Mattermost/Info.plist | 2 +- ios/MattermostTests/Info.plist | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index df453b053..8360a8646 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -2113,7 +2113,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 71; + CURRENT_PROJECT_VERSION = 72; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; @@ -2163,7 +2163,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 71; + CURRENT_PROJECT_VERSION = 72; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 46de1a08a..fce86fc9e 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -32,7 +32,7 @@ CFBundleVersion - 71 + 72 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostTests/Info.plist b/ios/MattermostTests/Info.plist index db54c2247..588970528 100644 --- a/ios/MattermostTests/Info.plist +++ b/ios/MattermostTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 71 + 72 From 49b0e4cb669fdb49b9b7b8d63a4bf32ce631fc99 Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 7 Dec 2017 13:54:14 -0300 Subject: [PATCH 9/9] Version Bump to 72 (#1284) --- 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 680234c68..ba656cd16 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -106,7 +106,7 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion 21 targetSdkVersion 23 - versionCode 71 + versionCode 72 versionName "1.5.0" multiDexEnabled true ndk {