From 92b992d204ed4bd4415c2407c6c1f511d847c7e2 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Mon, 18 Jun 2018 16:05:42 -0400 Subject: [PATCH 1/6] MM-10822 Change post textbox to only be partially connected --- app/components/post_textbox/post_textbox.js | 5 +- app/components/quick_text_input.js | 86 +++++++++++++++++++++ 2 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 app/components/quick_text_input.js diff --git a/app/components/post_textbox/post_textbox.js b/app/components/post_textbox/post_textbox.js index a6f5cddc6..38c425355 100644 --- a/app/components/post_textbox/post_textbox.js +++ b/app/components/post_textbox/post_textbox.js @@ -3,7 +3,7 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; -import {Alert, BackHandler, Keyboard, Platform, Text, TextInput, TouchableOpacity, View} from 'react-native'; +import {Alert, BackHandler, Keyboard, Platform, Text, TouchableOpacity, View} from 'react-native'; import {intlShape} from 'react-intl'; import {RequestStatus} from 'mattermost-redux/constants'; import EventEmitter from 'mattermost-redux/utils/event_emitter'; @@ -11,6 +11,7 @@ import EventEmitter from 'mattermost-redux/utils/event_emitter'; import AttachmentButton from 'app/components/attachment_button'; import Autocomplete from 'app/components/autocomplete'; import FileUploadPreview from 'app/components/file_upload_preview'; +import QuickTextInput from 'app/components/quick_text_input'; import {INITIAL_HEIGHT, INSERT_TO_COMMENT, INSERT_TO_DRAFT, IS_REACTION_REGEX, MAX_CONTENT_HEIGHT, MAX_FILE_COUNT} from 'app/constants/post_textbox'; import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme'; @@ -494,7 +495,7 @@ export default class PostTextbox extends PureComponent { {!channelIsReadOnly && attachmentButton} - { + if (!this.input) { + return; + } + + this.input.setNativeProps({text: this.props.value}); + } + + get value() { + return this.input.value; + } + + set value(value) { + this.input.setNativeProps({text: this.props.value}); + } + + focus() { + this.input.focus(); + } + + blur() { + this.input.blur(); + } + + getInput = () => { + return this.input; + }; + + setInput = (input) => { + this.input = input; + } + + render() { + const {value, ...props} = this.props; + + Reflect.deleteProperty(props, 'delayInputUpdate'); + + // Only set the defaultValue since the real one will be updated using componentDidUpdate if necessary + return ( + + ); + } +} From e19b6a08d34353be3aa49cc337e4568ff75002a1 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 21 Jun 2018 18:17:29 -0400 Subject: [PATCH 2/6] Silence fetch errors caused by websocket action (#1797) --- app/fetch_preconfig.js | 8 ++++++-- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/fetch_preconfig.js b/app/fetch_preconfig.js index c3c8af3e7..510c71221 100644 --- a/app/fetch_preconfig.js +++ b/app/fetch_preconfig.js @@ -18,11 +18,15 @@ Client4.doFetchWithResponse = async (url, options) => { url, }; } - const response = await fetch(url, Client4.getOptions(options)); - const headers = response.headers; + + let response; + let headers; let data; try { + response = await fetch(url, Client4.getOptions(options)); + headers = response.headers; + data = await response.json(); } catch (err) { if (response && response.resp && response.resp.data && response.resp.data.includes('SSL certificate')) { diff --git a/package-lock.json b/package-lock.json index fbacbd451..bc777de91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9878,8 +9878,8 @@ } }, "mattermost-redux": { - "version": "github:mattermost/mattermost-redux#c9b633da7fc3fc9ba3cc40ecc9665e088defbe73", - "from": "github:mattermost/mattermost-redux#c9b633da7fc3fc9ba3cc40ecc9665e088defbe73", + "version": "github:mattermost/mattermost-redux#d2e9ba4f30a7bdfccda9aab1cfa8124c4ca1f275", + "from": "github:mattermost/mattermost-redux#d2e9ba4f30a7bdfccda9aab1cfa8124c4ca1f275", "requires": { "deep-equal": "1.0.1", "eslint-plugin-header": "1.2.0", diff --git a/package.json b/package.json index 25b80372b..e67129764 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#c9b633da7fc3fc9ba3cc40ecc9665e088defbe73", + "mattermost-redux": "github:mattermost/mattermost-redux#d2e9ba4f30a7bdfccda9aab1cfa8124c4ca1f275", "mime-db": "1.33.0", "prop-types": "15.6.1", "react": "16.3.2", From 3055a43ec8497ad94ceef376a4651f9ccfcc595f Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 21 Jun 2018 18:17:59 -0400 Subject: [PATCH 3/6] Fix user being "logged out" after upgrading (#1798) --- app/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/app.js b/app/app.js index e9db17855..7d989c435 100644 --- a/app/app.js +++ b/app/app.js @@ -76,6 +76,7 @@ export default class App { return Initialization.credentials; }, () => { + this.waitForRehydration = true; return getGenericPassword(); } ); @@ -153,6 +154,13 @@ export default class App { } const username = `${deviceToken}, ${currentUserId}`; const password = `${token},${url}`; + + if (this.waitForRehydration) { + this.waitForRehydration = false; + this.token = token; + this.url = url; + } + setGenericPassword(username, password); }; @@ -215,7 +223,7 @@ export default class App { }; startApp = () => { - if (this.appStarted) { + if (this.appStarted || this.waitForRehydration) { return; } From 4796c3034e03367b71fbac89f5fd8bee7dd08bd3 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 21 Jun 2018 18:25:27 -0400 Subject: [PATCH 4/6] Increment app version to 1.9.1 --- android/app/build.gradle | 2 +- ios/Mattermost/Info.plist | 2 +- ios/MattermostShare/Info.plist | 2 +- ios/MattermostTests/Info.plist | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 45fcb1d8a..b63618c6c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -114,7 +114,7 @@ android { minSdkVersion 21 targetSdkVersion 23 versionCode 112 - versionName "1.9.0" + versionName "1.9.1" ndk { abiFilters "armeabi-v7a", "x86" } diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index da58d1c48..0cacae2ac 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -19,7 +19,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.9.0 + 1.9.1 CFBundleSignature ???? CFBundleURLTypes diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index 90f8a47f7..3b6869a71 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.9.0 + 1.9.1 CFBundleVersion 112 NSAppTransportSecurity diff --git a/ios/MattermostTests/Info.plist b/ios/MattermostTests/Info.plist index 2168c7f28..9ce007ef7 100644 --- a/ios/MattermostTests/Info.plist +++ b/ios/MattermostTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.9.0 + 1.9.1 CFBundleSignature ???? CFBundleVersion From 54857865ec8e59d766da934d7afb2ab4d9915a2e Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 21 Jun 2018 18:43:29 -0400 Subject: [PATCH 5/6] Bump iOS build number to 113 (#1800) --- 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 962280f1c..8e12f44d9 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 = 112; + CURRENT_PROJECT_VERSION = 113; 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 = 112; + CURRENT_PROJECT_VERSION = 113; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 0cacae2ac..aeb93ad6e 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 112 + 113 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index 3b6869a71..de4b23ddf 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -23,7 +23,7 @@ CFBundleShortVersionString 1.9.1 CFBundleVersion - 112 + 113 NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/ios/MattermostTests/Info.plist b/ios/MattermostTests/Info.plist index 9ce007ef7..c2dc1dc8a 100644 --- a/ios/MattermostTests/Info.plist +++ b/ios/MattermostTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 112 + 113 From c10d31c62b489b01fc6cd131b989de9c487e312a Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 21 Jun 2018 18:48:17 -0400 Subject: [PATCH 6/6] Bump Android build number to 113 (#1801) --- 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 b63618c6c..7445ac38f 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 112 + versionCode 113 versionName "1.9.1" ndk { abiFilters "armeabi-v7a", "x86"