From 6e7e083aeef6e4442ef84b91fb134deb178786f8 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 30 May 2019 19:31:12 -0400 Subject: [PATCH 1/8] Update missed MMMConstant.h reference (#2849) --- ios/Mattermost/MattermostManaged.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Mattermost/MattermostManaged.m b/ios/Mattermost/MattermostManaged.m index 4c261b3f5..4000f5902 100644 --- a/ios/Mattermost/MattermostManaged.m +++ b/ios/Mattermost/MattermostManaged.m @@ -8,7 +8,7 @@ #import "RCTUITextView.h" #import "MattermostManaged.h" -#import +#import @implementation MattermostManaged { bool hasListeners; From 30ee1e78c7fe614e9e18225648b5d088d8a1949d Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Sat, 1 Jun 2019 01:16:32 +0800 Subject: [PATCH 2/8] configure telemetry on build (#2852) --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 470c82a44..7f8cbd8c3 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -376,8 +376,8 @@ platform :android do lane :build do unless configured configure - configure_telemetry_android end + configure_telemetry_android update_identifiers replace_assets link_sentry_android From 1e8a1307af6d364468852ff82eb454f63f1c0d2a Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 31 May 2019 13:33:56 -0400 Subject: [PATCH 3/8] Update netInfo to check for internet connectivity (#2850) * Update netInfo to check for internet connectivity instead of using apple.com as a reference * Fix network indicator position on tablets --- Makefile | 5 +- .../network_indicator/network_indicator.js | 9 +- app/utils/network.js | 15 +- native_modules/RNCNetInfo.m | 228 ++++++++++++++++++ package-lock.json | 87 ++----- package.json | 4 +- 6 files changed, 265 insertions(+), 83 deletions(-) create mode 100644 native_modules/RNCNetInfo.m diff --git a/Makefile b/Makefile index 626af86ab..9645fbd3a 100644 --- a/Makefile +++ b/Makefile @@ -77,9 +77,12 @@ post-install: @# Need to copy custom RNDocumentPicker.m that implements direct access to the document picker in iOS @cp ./native_modules/RNDocumentPicker.m node_modules/react-native-document-picker/ios/RNDocumentPicker/RNDocumentPicker.m - # Need to copy custom RNCookieManagerIOS.m that fixes a crash when cookies does not have expiration date set + @# Need to copy custom RNCookieManagerIOS.m that fixes a crash when cookies does not have expiration date set @cp ./native_modules/RNCookieManagerIOS.m node_modules/react-native-cookies/ios/RNCookieManagerIOS/RNCookieManagerIOS.m + @# Need to copy custom RNCNetInfo.m that checks for internet connectivity instead of reaching a host by default + @cp ./native_modules/RNCNetInfo.m node_modules/@react-native-community/netinfo/ios/RNCNetInfo.m + @rm -f node_modules/intl/.babelrc @# Hack to get react-intl and its dependencies to work with react-native @# Based off of https://github.com/este/este/blob/master/gulp/native-fix.js diff --git a/app/components/network_indicator/network_indicator.js b/app/components/network_indicator/network_indicator.js index 62b340117..71a40b28a 100644 --- a/app/components/network_indicator/network_indicator.js +++ b/app/components/network_indicator/network_indicator.js @@ -19,7 +19,6 @@ import IonIcon from 'react-native-vector-icons/Ionicons'; import FormattedText from 'app/components/formatted_text'; import {DeviceTypes, ViewTypes} from 'app/constants'; import mattermostBucket from 'app/mattermost_bucket'; -import mattermostManaged from 'app/mattermost_managed'; import PushNotifications from 'app/push_notifications'; import networkConnectionListener, {checkConnection} from 'app/utils/network'; import {t} from 'app/utils/i18n'; @@ -36,7 +35,6 @@ const { IOS_TOP_LANDSCAPE, IOS_TOP_PORTRAIT, IOSX_TOP_PORTRAIT, - STATUS_BAR_HEIGHT, } = ViewTypes; export default class NetworkIndicator extends PureComponent { @@ -142,7 +140,7 @@ export default class NetworkIndicator extends PureComponent { const {connection} = this.props.actions; clearTimeout(this.connectionRetryTimeout); - NetInfo.isConnected.fetch().then(async (isConnected) => { + NetInfo.fetch().then(async ({isConnected}) => { const {hasInternet, serverReachable} = await checkConnection(isConnected); connection(hasInternet); @@ -204,9 +202,7 @@ export default class NetworkIndicator extends PureComponent { return IOS_TOP_LANDSCAPE; } else if (isX) { return IOSX_TOP_PORTRAIT; - } else if (isLandscape && DeviceTypes.IS_TABLET && mattermostManaged.hasSafeAreaInsets) { - return IOS_TOP_LANDSCAPE + STATUS_BAR_HEIGHT; - } else if (isLandscape) { + } else if (isLandscape && !DeviceTypes.IS_TABLET) { return IOS_TOP_LANDSCAPE; } @@ -233,7 +229,6 @@ export default class NetworkIndicator extends PureComponent { handleAppStateChange = async (appState) => { const {actions, currentChannelId} = this.props; const active = appState === 'active'; - if (active) { this.connect(true); diff --git a/app/utils/network.js b/app/utils/network.js index a441f12d9..0502c3087 100644 --- a/app/utils/network.js +++ b/app/utils/network.js @@ -13,6 +13,10 @@ import mattermostManaged from 'app/mattermost_managed'; let certificate = ''; let previousState; export async function checkConnection(isConnected) { + if (!isConnected) { + return {hasInternet: false, serverReachable: false}; + } + if (!Client4.getBaseRoute().startsWith('http')) { // If we don't have a connection or have a server yet, return the default implementation return {hasInternet: isConnected, serverReachable: false}; @@ -43,6 +47,7 @@ export async function checkConnection(isConnected) { auto: true, waitsForConnectivity, timeoutIntervalForResource, + timeout: 3000, }; if (Platform.OS === 'ios' && certificate === '') { @@ -59,7 +64,7 @@ export async function checkConnection(isConnected) { } function handleConnectionChange(onChange) { - return async (isConnected) => { + return async ({isConnected}) => { if (isConnected !== previousState) { previousState = isConnected; @@ -72,13 +77,7 @@ function handleConnectionChange(onChange) { export default function networkConnectionListener(onChange) { const connectionChanged = handleConnectionChange(onChange); - - NetInfo.isConnected.fetch().then((isConnected) => { - NetInfo.isConnected.addEventListener('connectionChange', connectionChanged); - connectionChanged(isConnected); - }); - - const removeEventListener = () => NetInfo.isConnected.removeEventListener('connectionChange', connectionChanged); + const removeEventListener = NetInfo.addEventListener(connectionChanged); return { removeEventListener, diff --git a/native_modules/RNCNetInfo.m b/native_modules/RNCNetInfo.m new file mode 100644 index 000000000..0985fec2b --- /dev/null +++ b/native_modules/RNCNetInfo.m @@ -0,0 +1,228 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNCNetInfo.h" + +#if !TARGET_OS_TV + #import +#endif +#import +#import +#import + +// Start of the Mattermost fix +#import +// End of the Mattermost fix + +// Based on the ConnectionType enum described in the W3C Network Information API spec +// (https://wicg.github.io/netinfo/). +static NSString *const RNCConnectionTypeUnknown = @"unknown"; +static NSString *const RNCConnectionTypeNone = @"none"; +static NSString *const RNCConnectionTypeWifi = @"wifi"; +static NSString *const RNCConnectionTypeCellular = @"cellular"; + +// Based on the EffectiveConnectionType enum described in the W3C Network Information API spec +// (https://wicg.github.io/netinfo/). +static NSString *const RNCCellularGeneration2g = @"2g"; +static NSString *const RNCCellularGeneration3g = @"3g"; +static NSString *const RNCCellularGeneration4g = @"4g"; + +@implementation RNCNetInfo +{ + SCNetworkReachabilityRef _firstTimeReachability; + SCNetworkReachabilityRef _reachability; + NSString *_connectionType; + BOOL _connectionExpensive; + NSString *_effectiveConnectionType; + BOOL _isObserving; + NSMutableSet *_firstTimeReachabilityResolvers; +} + +RCT_EXPORT_MODULE() + +static void RNCReachabilityCallback(__unused SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *info) +{ + RNCNetInfo *self = (__bridge id)info; + BOOL didSetReachabilityFlags = [self setReachabilityStatus:flags]; + + if (self->_firstTimeReachability) { + [self->_firstTimeReachabilityResolvers enumerateObjectsUsingBlock:^(RCTPromiseResolveBlock resolver, BOOL *stop) { + resolver([self currentState]); + }]; + + [self cleanUpFirstTimeReachability]; + [self->_firstTimeReachabilityResolvers removeAllObjects]; + } + + if (didSetReachabilityFlags && self->_isObserving) { + [self sendEventWithName:@"netInfo.networkStatusDidChange" body:[self currentState]]; + } +} + +// We need RNCReachabilityCallback's and module methods to be called on the same thread so that we can have +// guarantees about when we mess with the reachability callbacks. +- (dispatch_queue_t)methodQueue +{ + return dispatch_get_main_queue(); +} + +#pragma mark - Lifecycle + +- (NSArray *)supportedEvents +{ + return @[@"netInfo.networkStatusDidChange"]; +} + +- (void)startObserving +{ + _isObserving = YES; + _connectionType = RNCConnectionTypeUnknown; + _effectiveConnectionType = nil; + _reachability = [self getReachabilityRef]; +} + +- (void)stopObserving +{ + _isObserving = NO; + if (_reachability) { + SCNetworkReachabilityUnscheduleFromRunLoop(_reachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); + CFRelease(_reachability); + } +} + +- (void)dealloc +{ + [self cleanUpFirstTimeReachability]; +} + +- (SCNetworkReachabilityRef)getReachabilityRef +{ + // Start of the Mattermost fix + struct sockaddr_in zeroAddress; + bzero(&zeroAddress, sizeof(zeroAddress)); + zeroAddress.sin_len = sizeof(zeroAddress); + zeroAddress.sin_family = AF_INET; + + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *) &zeroAddress); + // End of the Mattermost fix + SCNetworkReachabilityContext context = { 0, ( __bridge void *)self, NULL, NULL, NULL }; + SCNetworkReachabilitySetCallback(reachability, RNCReachabilityCallback, &context); + SCNetworkReachabilityScheduleWithRunLoop(reachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); + + return reachability; +} + +- (BOOL)setReachabilityStatus:(SCNetworkReachabilityFlags)flags +{ + NSString *connectionType = RNCConnectionTypeUnknown; + bool connectionExpensive = false; + NSString *effectiveConnectionType = nil; + if ((flags & kSCNetworkReachabilityFlagsReachable) == 0 || + (flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0) { + connectionType = RNCConnectionTypeNone; + } + +#if !TARGET_OS_TV + + else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) { + connectionType = RNCConnectionTypeCellular; + connectionExpensive = true; + + CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init]; + if (netinfo) { + if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS] || + [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyEdge] || + [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMA1x]) { + effectiveConnectionType = RNCCellularGeneration2g; + } else if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyWCDMA] || + [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSDPA] || + [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSUPA] || + [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0] || + [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA] || + [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB] || + [netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyeHRPD]) { + effectiveConnectionType = RNCCellularGeneration3g; + } else if ([netinfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) { + effectiveConnectionType = RNCCellularGeneration4g; + } + } + } + +#endif + + else { + connectionType = RNCConnectionTypeWifi; + } + + if (![connectionType isEqualToString:self->_connectionType] || + ![effectiveConnectionType isEqualToString:self->_effectiveConnectionType]) { + self->_connectionType = connectionType; + self->_connectionExpensive = connectionExpensive; + self->_effectiveConnectionType = effectiveConnectionType; + return YES; + } + + return NO; +} + +- (void)cleanUpFirstTimeReachability +{ + if (_firstTimeReachability) { + SCNetworkReachabilityUnscheduleFromRunLoop(self->_firstTimeReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); + CFRelease(self->_firstTimeReachability); + _firstTimeReachability = nil; + } +} + +- (id)currentState +{ + NSString *connectionType = self->_connectionType ?: RNCConnectionTypeUnknown; + NSString *effectiveConnectionType = self->_effectiveConnectionType; + + BOOL isConnected = ![connectionType isEqualToString:RNCConnectionTypeNone] && ![connectionType isEqualToString:RNCConnectionTypeUnknown]; + + NSMutableDictionary *details = nil; + if (isConnected) { + details = [NSMutableDictionary new]; + details[@"isConnectionExpensive"] = @(self->_connectionExpensive ?: false); + + if ([connectionType isEqualToString:RNCConnectionTypeCellular]) { + details[@"cellularGeneration"] = effectiveConnectionType ?: [NSNull null]; + } + } + + return @{ + @"type": connectionType, + @"isConnected": @(isConnected), + @"details": details ?: [NSNull null] + }; +} + +#pragma mark - Public API + +RCT_EXPORT_METHOD(getCurrentState:(RCTPromiseResolveBlock)resolve + reject:(__unused RCTPromiseRejectBlock)reject) +{ + // Setup the reacability listener if needed + if (!_firstTimeReachability) { + _firstTimeReachability = [self getReachabilityRef]; + } + + // Start of the Mattermost fix + if (_firstTimeReachability) { + SCNetworkReachabilityFlags flags; + SCNetworkReachabilityGetFlags(_firstTimeReachability, &flags); + [self setReachabilityStatus:flags]; + + resolve([self currentState]); + + [self cleanUpFirstTimeReachability]; + } + // End of the Mattermost fix +} + +@end diff --git a/package-lock.json b/package-lock.json index 6c9b3a126..1411679e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3625,9 +3625,9 @@ } }, "@react-native-community/netinfo": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-2.0.10.tgz", - "integrity": "sha512-NrIzyLe0eSbhgMnHl2QdSEhaA7yXh6p9jzMomfUa//hoTXE+xbObGDdiWWSQm2bnXnZJg8XCU3AB9qzvqcuLnA==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@react-native-community/netinfo/-/netinfo-3.1.3.tgz", + "integrity": "sha512-T9fFuxnMSZdVtpygW3BdmoE2o70BXrryi95Xi7FnRYmdr7PtEjNxEziR8i+VvrXXNG8KkQ2Bngc0YUqrNxNMtA==" }, "@react-navigation/core": { "version": "3.4.1", @@ -4932,9 +4932,9 @@ "optional": true }, "bluebird": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz", - "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==", + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", "dev": true }, "boolbase": { @@ -7365,27 +7365,6 @@ } } }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -13718,7 +13697,7 @@ }, "mmjstool": { "version": "github:mattermost/mattermost-utilities#b55348242168df75da500fd813d4105c44eaea08", - "from": "github:mattermost/mattermost-utilities#b55348242168df75da500fd813d4105c44eaea08", + "from": "github:mattermost/mattermost-utilities", "dev": true, "requires": { "estree-walk": "2.2.0", @@ -18108,9 +18087,9 @@ } }, "tapable": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz", - "integrity": "sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", "dev": true }, "temp": { @@ -18669,9 +18648,9 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "v8-compile-cache": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz", - "integrity": "sha512-1wFuMUIM16MDJRCrpbpuEPTUGmM5QMUg0cr3KFwra2XgOgFcPGDQHDh3CszSCD2Zewc/dh/pamNEW8CbfDebUw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz", + "integrity": "sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w==", "dev": true }, "validate-npm-package-license": { @@ -18732,9 +18711,9 @@ "dev": true }, "webpack-cli": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.0.tgz", - "integrity": "sha512-t1M7G4z5FhHKJ92WRKwZ1rtvi7rHc0NZoZRbSkol0YKl4HvcC8+DsmGDmK7MmZxHSAetHagiOsjOB6MmzC2TUw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.2.tgz", + "integrity": "sha512-FLkobnaJJ+03j5eplxlI0TUxhGCOdfewspIGuvDVtpOlrAuKMFC57K42Ukxqs1tn8947/PM6tP95gQc0DCzRYA==", "dev": true, "requires": { "chalk": "^2.4.1", @@ -18756,32 +18735,12 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -18804,14 +18763,6 @@ "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } } }, "find-up": { @@ -18900,6 +18851,12 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", diff --git a/package.json b/package.json index f15232eba..410e98ae3 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "@babel/runtime": "7.4.4", "@react-native-community/async-storage": "1.4.0", - "@react-native-community/netinfo": "2.0.10", + "@react-native-community/netinfo": "3.1.3", "analytics-react-native": "1.2.0", "commonmark": "github:mattermost/commonmark.js#6c3136c18ae8bb7842f8491d160f370a334fd903", "commonmark-react-renderer": "github:mattermost/commonmark-react-renderer#3a2ac19cab725ad28b170fdc1d397dddedcf87eb", @@ -97,7 +97,7 @@ "jest-enzyme": "7.0.2", "jsdom-global": "3.0.2", "metro-react-native-babel-preset": "0.54.0", - "mmjstool": "github:mattermost/mattermost-utilities#b55348242168df75da500fd813d4105c44eaea08", + "mmjstool": "github:mattermost/mattermost-utilities", "nyc": "14.1.1", "react-dom": "16.8.6", "react-test-renderer": "16.8.6", From 6d52fed6e900be5cad178861dcc80b783a2a6e24 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 31 May 2019 14:22:10 -0400 Subject: [PATCH 4/8] Bump app build number to 196 (#2853) --- android/app/build.gradle | 2 +- ios/Mattermost.xcodeproj/project.pbxproj | 4 ++-- ios/Mattermost/Info.plist | 2 +- ios/MattermostShare/Info.plist | 2 +- ios/MattermostTests/Info.plist | 2 +- ios/NotificationService/Info.plist | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 9ab282910..148f8a12a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -122,7 +122,7 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 195 + versionCode 196 versionName "1.20.0" multiDexEnabled = true ndk { diff --git a/ios/Mattermost.xcodeproj/project.pbxproj b/ios/Mattermost.xcodeproj/project.pbxproj index 09998aaba..f71d46cd8 100644 --- a/ios/Mattermost.xcodeproj/project.pbxproj +++ b/ios/Mattermost.xcodeproj/project.pbxproj @@ -2762,7 +2762,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 195; + CURRENT_PROJECT_VERSION = 196; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; @@ -2822,7 +2822,7 @@ CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 195; + CURRENT_PROJECT_VERSION = 196; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = UQ8HT4Q2XM; ENABLE_BITCODE = NO; diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 4626b3262..df2f9b159 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 195 + 196 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/MattermostShare/Info.plist b/ios/MattermostShare/Info.plist index 8c275ebb6..abe8f9077 100644 --- a/ios/MattermostShare/Info.plist +++ b/ios/MattermostShare/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.20.0 CFBundleVersion - 195 + 196 NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/ios/MattermostTests/Info.plist b/ios/MattermostTests/Info.plist index b4bafc524..e92ca45f5 100644 --- a/ios/MattermostTests/Info.plist +++ b/ios/MattermostTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 195 + 196 diff --git a/ios/NotificationService/Info.plist b/ios/NotificationService/Info.plist index e19127bee..5b9061c05 100644 --- a/ios/NotificationService/Info.plist +++ b/ios/NotificationService/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.20.0 CFBundleVersion - 195 + 196 NSExtension NSExtensionPointIdentifier From e16d9555270afde4f0e7ae94068abbb3f0898861 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Mon, 3 Jun 2019 09:48:18 -0400 Subject: [PATCH 5/8] MM-15959 disable android firebase analytics (#2854) --- android/app/google-services.json | 8 ++++---- android/app/src/main/AndroidManifest.xml | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/android/app/google-services.json b/android/app/google-services.json index 9f083952d..74d308939 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -26,7 +26,7 @@ ], "services": { "analytics_service": { - "status": 1 + "status": 0 }, "appinvite_service": { "status": 1, @@ -57,7 +57,7 @@ ], "services": { "analytics_service": { - "status": 1 + "status": 0 }, "appinvite_service": { "status": 1, @@ -88,7 +88,7 @@ ], "services": { "analytics_service": { - "status": 1 + "status": 0 }, "appinvite_service": { "status": 1, @@ -101,4 +101,4 @@ } ], "configuration_version": "1" -} \ No newline at end of file +} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 54cfc1fcf..e3d966fce 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -19,6 +19,7 @@ android:installLocation="auto" android:networkSecurityConfig="@xml/network_security_config" > + From f6a73e2f2ca0b796d1d0a5d066961f723b158c09 Mon Sep 17 00:00:00 2001 From: Tsilavina Razafinirina Date: Mon, 3 Jun 2019 18:23:15 +0300 Subject: [PATCH 6/8] MM-11287 Add support for plus sign and period/dot in custom URL schemes (#9155) (#2841) --- package-lock.json | 217 +++++++++++++++++++++------------------------- package.json | 2 +- 2 files changed, 98 insertions(+), 121 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1411679e7..a1706a386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5238,7 +5238,6 @@ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, - "optional": true, "requires": { "is-extendable": "^0.1.0" } @@ -5283,8 +5282,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "optional": true + "dev": true }, "is-glob": { "version": "4.0.1", @@ -5471,8 +5469,8 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, "commonmark": { - "version": "github:mattermost/commonmark.js#6c3136c18ae8bb7842f8491d160f370a334fd903", - "from": "github:mattermost/commonmark.js#6c3136c18ae8bb7842f8491d160f370a334fd903", + "version": "github:mattermost/commonmark.js#4224e725f14b5d4e340a62d7e56d5ad451e9f8cf", + "from": "github:mattermost/commonmark.js#4224e725f14b5d4e340a62d7e56d5ad451e9f8cf", "requires": { "entities": "~ 1.1.1", "mdurl": "~ 1.0.1", @@ -7664,25 +7662,24 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": "", + "resolved": false, "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "optional": true + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "aproba": { "version": "1.2.0", - "resolved": "", + "resolved": false, "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": "", + "resolved": false, "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "optional": true, "requires": { @@ -7692,15 +7689,13 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": "", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "optional": true + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "brace-expansion": { "version": "1.1.11", - "resolved": "", + "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7708,37 +7703,34 @@ }, "chownr": { "version": "1.1.1", - "resolved": "", + "resolved": false, "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": "", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "optional": true + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "concat-map": { "version": "0.0.1", - "resolved": "", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "optional": true + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "console-control-strings": { "version": "1.1.0", - "resolved": "", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "optional": true + "resolved": false, + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "core-util-is": { "version": "1.0.2", - "resolved": "", + "resolved": false, "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "optional": true }, "debug": { "version": "4.1.1", - "resolved": "", + "resolved": false, "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "optional": true, "requires": { @@ -7747,25 +7739,25 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": "", + "resolved": false, "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "optional": true }, "delegates": { "version": "1.0.0", - "resolved": "", + "resolved": false, "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": "", + "resolved": false, "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": "", + "resolved": false, "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "optional": true, "requires": { @@ -7774,13 +7766,13 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "", + "resolved": false, "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "optional": true }, "gauge": { "version": "2.7.4", - "resolved": "", + "resolved": false, "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "optional": true, "requires": { @@ -7796,7 +7788,7 @@ }, "glob": { "version": "7.1.3", - "resolved": "", + "resolved": false, "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "optional": true, "requires": { @@ -7810,13 +7802,13 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": "", + "resolved": false, "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": "", + "resolved": false, "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "optional": true, "requires": { @@ -7825,7 +7817,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": "", + "resolved": false, "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "optional": true, "requires": { @@ -7834,7 +7826,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": "", + "resolved": false, "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "optional": true, "requires": { @@ -7844,51 +7836,46 @@ }, "inherits": { "version": "2.0.3", - "resolved": "", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "optional": true + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", - "resolved": "", + "resolved": false, "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "", + "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "optional": true, "requires": { "number-is-nan": "^1.0.0" } }, "isarray": { "version": "1.0.0", - "resolved": "", + "resolved": false, "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": "", + "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "resolved": "", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "optional": true + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "minipass": { "version": "2.3.5", - "resolved": "", + "resolved": false, "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -7896,7 +7883,7 @@ }, "minizlib": { "version": "1.2.1", - "resolved": "", + "resolved": false, "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "optional": true, "requires": { @@ -7905,22 +7892,21 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "", + "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "optional": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.1.1", - "resolved": "", + "resolved": false, "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "optional": true }, "needle": { "version": "2.3.0", - "resolved": "", + "resolved": false, "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "optional": true, "requires": { @@ -7931,7 +7917,7 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": "", + "resolved": false, "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "optional": true, "requires": { @@ -7949,7 +7935,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": "", + "resolved": false, "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "optional": true, "requires": { @@ -7959,13 +7945,13 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": "", + "resolved": false, "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "optional": true }, "npm-packlist": { "version": "1.4.1", - "resolved": "", + "resolved": false, "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "optional": true, "requires": { @@ -7975,7 +7961,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "", + "resolved": false, "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "optional": true, "requires": { @@ -7987,40 +7973,38 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "optional": true + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "object-assign": { "version": "4.1.1", - "resolved": "", + "resolved": false, "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "optional": true }, "once": { "version": "1.4.0", - "resolved": "", + "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "optional": true, "requires": { "wrappy": "1" } }, "os-homedir": { "version": "1.0.2", - "resolved": "", + "resolved": false, "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "", + "resolved": false, "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "optional": true }, "osenv": { "version": "0.1.5", - "resolved": "", + "resolved": false, "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "optional": true, "requires": { @@ -8030,19 +8014,19 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "", + "resolved": false, "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": "", + "resolved": false, "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "optional": true }, "rc": { "version": "1.2.8", - "resolved": "", + "resolved": false, "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "optional": true, "requires": { @@ -8054,7 +8038,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "", + "resolved": false, "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "optional": true } @@ -8062,7 +8046,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "", + "resolved": false, "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "optional": true, "requires": { @@ -8077,7 +8061,7 @@ }, "rimraf": { "version": "2.6.3", - "resolved": "", + "resolved": false, "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "optional": true, "requires": { @@ -8086,45 +8070,43 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "optional": true + "resolved": false, + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safer-buffer": { "version": "2.1.2", - "resolved": "", + "resolved": false, "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "optional": true }, "sax": { "version": "1.2.4", - "resolved": "", + "resolved": false, "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "optional": true }, "semver": { "version": "5.7.0", - "resolved": "", + "resolved": false, "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": "", + "resolved": false, "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": "", + "resolved": false, "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "optional": true }, "string-width": { "version": "1.0.2", - "resolved": "", + "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -8133,7 +8115,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "", + "resolved": false, "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "optional": true, "requires": { @@ -8142,22 +8124,21 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "", + "resolved": false, "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "optional": true, "requires": { "ansi-regex": "^2.0.0" } }, "strip-json-comments": { "version": "2.0.1", - "resolved": "", + "resolved": false, "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "optional": true }, "tar": { "version": "4.4.8", - "resolved": "", + "resolved": false, "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "optional": true, "requires": { @@ -8172,13 +8153,13 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "", + "resolved": false, "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": "", + "resolved": false, "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "optional": true, "requires": { @@ -8187,15 +8168,13 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "optional": true + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "yallist": { "version": "3.0.3", - "resolved": "", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "optional": true + "resolved": false, + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, @@ -13181,9 +13160,9 @@ "resolved": "https://registry.npmjs.org/redux-persist/-/redux-persist-4.9.1.tgz", "integrity": "sha512-XoOmfPyo9GEU/WLH9FgB47dNIN9l5ArjHes4o7vUWx9nxZoPxnVodhuHdyc4Ot+fMkdj3L2LTqSHhwrkr0QFUg==", "requires": { - "json-stringify-safe": "^5.0.1", - "lodash": "^4.17.4", - "lodash-es": "^4.17.4" + "json-stringify-safe": "5.0.1", + "lodash": "4.17.11", + "lodash-es": "4.17.11" } } } @@ -14180,7 +14159,7 @@ "dependencies": { "ansi-regex": { "version": "3.0.0", - "resolved": "", + "resolved": false, "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, @@ -14192,7 +14171,7 @@ }, "cliui": { "version": "4.1.0", - "resolved": "", + "resolved": false, "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { @@ -14221,7 +14200,7 @@ }, "find-up": { "version": "3.0.0", - "resolved": "", + "resolved": false, "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { @@ -14236,13 +14215,13 @@ }, "invert-kv": { "version": "2.0.0", - "resolved": "", + "resolved": false, "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, "lcid": { "version": "2.0.0", - "resolved": "", + "resolved": false, "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { @@ -14251,7 +14230,7 @@ }, "locate-path": { "version": "3.0.0", - "resolved": "", + "resolved": false, "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { @@ -14278,7 +14257,7 @@ }, "os-locale": { "version": "3.1.0", - "resolved": "", + "resolved": false, "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { @@ -14298,7 +14277,7 @@ }, "p-locate": { "version": "3.0.0", - "resolved": "", + "resolved": false, "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { @@ -14319,7 +14298,7 @@ }, "resolve-from": { "version": "4.0.0", - "resolved": "", + "resolved": false, "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, @@ -14353,7 +14332,7 @@ }, "strip-ansi": { "version": "4.0.0", - "resolved": "", + "resolved": false, "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { @@ -14362,13 +14341,13 @@ }, "uuid": { "version": "3.3.2", - "resolved": "", + "resolved": false, "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "dev": true }, "y18n": { "version": "4.0.0", - "resolved": "", + "resolved": false, "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, @@ -16035,8 +16014,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true, - "optional": true + "dev": true }, "braces": { "version": "2.3.2", @@ -16299,8 +16277,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true, - "optional": true + "dev": true }, "micromatch": { "version": "3.1.10", diff --git a/package.json b/package.json index 410e98ae3..679b8bcc6 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "@react-native-community/async-storage": "1.4.0", "@react-native-community/netinfo": "3.1.3", "analytics-react-native": "1.2.0", - "commonmark": "github:mattermost/commonmark.js#6c3136c18ae8bb7842f8491d160f370a334fd903", + "commonmark": "github:mattermost/commonmark.js#4224e725f14b5d4e340a62d7e56d5ad451e9f8cf", "commonmark-react-renderer": "github:mattermost/commonmark-react-renderer#3a2ac19cab725ad28b170fdc1d397dddedcf87eb", "deep-equal": "1.0.1", "emoji-regex": "8.0.0", From 1d215deea6576ee2d6e0b74dd276ffc17b597fcd Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Tue, 4 Jun 2019 00:02:26 +0800 Subject: [PATCH 7/8] fix server version for Android telemetry (#2857) --- app/telemetry/telemetry.android.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/telemetry/telemetry.android.js b/app/telemetry/telemetry.android.js index 40eb56c58..cd6dd4fc4 100644 --- a/app/telemetry/telemetry.android.js +++ b/app/telemetry/telemetry.android.js @@ -146,7 +146,7 @@ class Telemetry { const {config} = store.getState().entities.general; const deviceInfo = getDeviceInfo(); - deviceInfo.serverVersion = config.Version; + deviceInfo.server_version = config.Version; saveToTelemetryServer({trace_events: metrics, device_info: deviceInfo}); From b81cd49fb476495be34d0f94aa4c64fa2f3fa542 Mon Sep 17 00:00:00 2001 From: Woolim Cho <2680v4@gmail.com> Date: Wed, 5 Jun 2019 17:11:42 +0900 Subject: [PATCH 8/8] [MM-13879] Add Edit profile button to RHS menu and own profile pop-over (#2832) * Add Edit Profile button to right panel menu * Make user info of right panel menu opens the users own profile * Add an Edit button of the users own profile * handle transitions * Add commandType to propTypes * Update test codes * add unit tests for user_profile * Assign commandType manually * Remove async, set delay to 0 --- .../sidebars/settings/settings_sidebar.js | 25 ++++++- .../__snapshots__/edit_profile.test.js.snap | 6 -- app/screens/edit_profile/edit_profile.js | 18 +++-- app/screens/edit_profile/edit_profile.test.js | 1 + app/screens/user_profile/index.js | 2 + app/screens/user_profile/user_profile.js | 67 ++++++++++++++++++ app/screens/user_profile/user_profile.test.js | 69 +++++++++++++++++++ 7 files changed, 170 insertions(+), 18 deletions(-) diff --git a/app/components/sidebars/settings/settings_sidebar.js b/app/components/sidebars/settings/settings_sidebar.js index ffade1249..9d552978b 100644 --- a/app/components/sidebars/settings/settings_sidebar.js +++ b/app/components/sidebars/settings/settings_sidebar.js @@ -153,11 +153,12 @@ export default class SettingsDrawer extends PureComponent { goToEditProfile = preventDoubleTap(() => { const {currentUser} = this.props; const {formatMessage} = this.context.intl; + const commandType = 'ShowModal'; this.openModal( 'EditProfile', formatMessage({id: 'mobile.routes.edit_profile', defaultMessage: 'Edit Profile'}), - {currentUser} + {currentUser, commandType} ); }); @@ -179,6 +180,17 @@ export default class SettingsDrawer extends PureComponent { ); }); + goToUserProfile = preventDoubleTap(() => { + const userId = this.props.currentUser.id; + const {formatMessage} = this.context.intl; + + this.openModal( + 'UserProfile', + formatMessage({id: 'mobile.routes.user_profile', defaultMessage: 'Profile'}), + {userId, fromSettings: true} + ); + }); + goToSettings = preventDoubleTap(() => { const {intl} = this.context; @@ -258,7 +270,7 @@ export default class SettingsDrawer extends PureComponent { contentContainerStyle={style.wrapper} > @@ -293,6 +305,15 @@ export default class SettingsDrawer extends PureComponent { + { - this.props.navigator.dismissModal({ - animationType: 'slide-down', - }); + if (this.props.commandType === 'Push') { + this.props.navigator.pop(); + } else { + this.props.navigator.dismissModal({ + animationType: 'slide-down', + }); + } }; emitCanUpdateAccount = (enabled) => { diff --git a/app/screens/edit_profile/edit_profile.test.js b/app/screens/edit_profile/edit_profile.test.js index 249fedf10..69682f745 100644 --- a/app/screens/edit_profile/edit_profile.test.js +++ b/app/screens/edit_profile/edit_profile.test.js @@ -45,6 +45,7 @@ describe('edit_profile', () => { nickname: 'Dragon', position: 'position', }, + commandType: 'ShowModal', }; test('should match snapshot', async () => { diff --git a/app/screens/user_profile/index.js b/app/screens/user_profile/index.js index a9d6ba836..27b466ed1 100644 --- a/app/screens/user_profile/index.js +++ b/app/screens/user_profile/index.js @@ -12,6 +12,7 @@ import {getConfig} from 'mattermost-redux/selectors/entities/general'; import Preferences from 'mattermost-redux/constants/preferences'; import {loadBot} from 'mattermost-redux/actions/bots'; import {getBotAccounts} from 'mattermost-redux/selectors/entities/bots'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; import {isTimezoneEnabled} from 'app/utils/timezone'; @@ -33,6 +34,7 @@ function mapStateToProps(state, ownProps) { enableTimezone, militaryTime, theme: getTheme(state), + isMyUser: getCurrentUserId(state) === ownProps.userId, }; } diff --git a/app/screens/user_profile/user_profile.js b/app/screens/user_profile/user_profile.js index 9a6ea0e66..f1bf1ba34 100644 --- a/app/screens/user_profile/user_profile.js +++ b/app/screens/user_profile/user_profile.js @@ -42,12 +42,34 @@ export default class UserProfile extends PureComponent { bot: PropTypes.object, militaryTime: PropTypes.bool.isRequired, enableTimezone: PropTypes.bool.isRequired, + isMyUser: PropTypes.bool.isRequired, + fromSettings: PropTypes.bool, }; static contextTypes = { intl: intlShape.isRequired, }; + rightButton = { + id: 'edit-profile', + showAsAction: 'always', + }; + + constructor(props, context) { + super(props); + + if (props.isMyUser) { + this.rightButton.title = context.intl.formatMessage({id: 'mobile.routes.user_profile.edit', defaultMessage: 'Edit'}); + + const buttons = { + rightButtons: [this.rightButton], + }; + + props.navigator.setOnNavigatorEvent(this.onNavigatorEvent); + props.navigator.setButtons(buttons); + } + } + componentWillReceiveProps(nextProps) { if (this.props.theme !== nextProps.theme) { setNavigatorStyles(this.props.navigator, nextProps.theme); @@ -63,6 +85,13 @@ export default class UserProfile extends PureComponent { close = () => { const {navigator, theme} = this.props; + if (this.props.fromSettings) { + navigator.dismissModal({ + animationType: 'slide-down', + }); + return; + } + navigator.resetTo({ screen: 'Channel', animated: true, @@ -187,6 +216,44 @@ export default class UserProfile extends PureComponent { }; }; + goToEditProfile = () => { + const {user: currentUser} = this.props; + const {formatMessage} = this.context.intl; + const commandType = 'Push'; + + const {navigator, theme} = this.props; + const options = { + screen: 'EditProfile', + title: formatMessage({id: 'mobile.routes.edit_profile', defaultMessage: 'Edit Profile'}), + animated: true, + backButtonTitle: '', + passProps: {currentUser, commandType}, + navigatorStyle: { + navBarTextColor: theme.sidebarHeaderTextColor, + navBarBackgroundColor: theme.sidebarHeaderBg, + navBarButtonColor: theme.sidebarHeaderTextColor, + screenBackgroundColor: theme.centerChannelBg, + }, + }; + + requestAnimationFrame(() => { + navigator.push(options); + }); + }; + + onNavigatorEvent = (event) => { + if (event.type === 'NavBarButtonPress') { + switch (event.id) { + case this.rightButton.id: + this.goToEditProfile(); + break; + case 'close-settings': + this.close(); + break; + } + } + }; + renderAdditionalOptions = () => { if (!Config.ExperimentalProfileLinks) { return null; diff --git a/app/screens/user_profile/user_profile.test.js b/app/screens/user_profile/user_profile.test.js index 6b61fe051..e1dac798e 100644 --- a/app/screens/user_profile/user_profile.test.js +++ b/app/screens/user_profile/user_profile.test.js @@ -31,11 +31,14 @@ describe('user_profile', () => { teammateNameDisplay: 'username', navigator: { resetTo: jest.fn(), + push: jest.fn(), + dismissModal: jest.fn(), }, teams: [], theme: Preferences.THEMES.default, enableTimezone: false, militaryTime: false, + isMyUser: false, }; const user = { @@ -84,4 +87,70 @@ describe('user_profile', () => { /> )).toEqual(true); }); + + test('should push EditProfile', async () => { + const props = { + ...baseProps, + navigator: { + push: jest.fn(), + }, + }; + + const wrapper = shallow( + , + {context: {intl: {formatMessage: jest.fn()}}}, + ); + + wrapper.instance().goToEditProfile(); + setTimeout(() => { + expect(props.navigator.push).toHaveBeenCalledTimes(1); + }, 16); + }); + + test('should call goToEditProfile', () => { + const props = { + ...baseProps, + navigator: { + push: jest.fn(), + }, + }; + + const wrapper = shallow( + , + {context: {intl: {formatMessage: jest.fn()}}}, + ); + + const event = {type: 'NavBarButtonPress', id: wrapper.instance().rightButton.id}; + wrapper.instance().onNavigatorEvent(event); + setTimeout(() => { + expect(props.navigator.push).toHaveBeenCalledTimes(1); + }, 0); + }); + + test('should close', async () => { + const props = {...baseProps, fromSettings: true}; + + const wrapper = shallow( + , + {context: {intl: {formatMessage: jest.fn()}}}, + ); + + const event = {type: 'NavBarButtonPress', id: 'close-settings'}; + wrapper.instance().onNavigatorEvent(event); + expect(props.navigator.dismissModal).toHaveBeenCalledTimes(1); + + props.fromSettings = false; + wrapper.setProps({...props}); + wrapper.instance().onNavigatorEvent(event); + expect(props.navigator.resetTo).toHaveBeenCalledTimes(1); + }); });