diff --git a/__mocks__/react-native-device-info.js b/__mocks__/react-native-device-info.js index c1a00e2de..427998a17 100644 --- a/__mocks__/react-native-device-info.js +++ b/__mocks__/react-native-device-info.js @@ -1,7 +1,3 @@ -export default { - getModel: () => '', - getReadableVersion: () => '', - getBundleId: () => '', - isTablet: () => false, - hasNotch: () => false -}; +import mockDeviceInfo from 'react-native-device-info/jest/react-native-device-info-mock'; + +export default mockDeviceInfo; diff --git a/android/Gemfile.lock b/android/Gemfile.lock index 5488439fc..ccb3b4a5f 100644 --- a/android/Gemfile.lock +++ b/android/Gemfile.lock @@ -1,78 +1,102 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.2) - addressable (2.7.0) + CFPropertyList (3.0.5) + rexml + addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) + artifactory (3.0.15) atomos (0.1.3) - aws-eventstream (1.0.3) - aws-partitions (1.294.0) - aws-sdk-core (3.92.0) - aws-eventstream (~> 1.0, >= 1.0.2) - aws-partitions (~> 1, >= 1.239.0) + aws-eventstream (1.2.0) + aws-partitions (1.600.0) + aws-sdk-core (3.131.2) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) - jmespath (~> 1.0) - aws-sdk-kms (1.30.0) - aws-sdk-core (~> 3, >= 3.71.0) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.57.0) + aws-sdk-core (~> 3, >= 3.127.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.61.2) - aws-sdk-core (~> 3, >= 3.83.0) + aws-sdk-s3 (1.114.0) + aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.1) - aws-eventstream (~> 1.0, >= 1.0.2) - babosa (1.0.3) - claide (1.0.3) + aws-sigv4 (~> 1.4) + aws-sigv4 (1.5.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + claide (1.1.0) colored (1.2) colored2 (3.1.2) - commander-fastlane (4.4.6) - highline (~> 1.7.2) - declarative (0.0.10) - declarative-option (0.1.0) - digest-crc (0.5.1) + commander (4.6.0) + highline (~> 2.0.0) + declarative (0.0.20) + digest-crc (0.6.4) + rake (>= 12.0.0, < 14.0.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.5) - emoji_regex (1.0.1) - excon (0.73.0) - faraday (0.17.3) - multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.6) - faraday (>= 0.7.4) + dotenv (2.7.6) + emoji_regex (3.2.3) + excon (0.92.3) + faraday (1.10.0) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) http-cookie (~> 1.0.0) - faraday_middleware (0.13.1) - faraday (>= 0.7.4, < 1.0) - fastimage (2.1.7) - fastlane (2.145.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.2.6) + fastlane (2.206.2) CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.3, < 3.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) aws-sdk-s3 (~> 1.0) - babosa (>= 1.0.2, < 2.0.0) + babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) colored - commander-fastlane (>= 4.4.6, < 5.0.0) + commander (~> 4.6) dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 2.0) + emoji_regex (>= 0.1, < 4.0) excon (>= 0.71.0, < 1.0.0) - faraday (~> 0.17) + faraday (~> 1.0) faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 0.13.1) + faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) - google-api-client (>= 0.29.2, < 0.37.0) - google-cloud-storage (>= 1.15.0, < 2.0.0) - highline (>= 1.7.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) + highline (~> 2.0) json (< 3.0.0) - jwt (~> 2.1.0) + jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) - multi_xml (~> 0.5) multipart-post (~> 2.0.0) + naturally (~> 2.2) + optparse (~> 0.1.1) plist (>= 3.1.0, < 4.0.0) - public_suffix (~> 2.0.0) - rubyzip (>= 1.3.0, < 2.0.0) + rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.3) simctl (~> 1.6.3) - slack-notifier (>= 2.0.0, < 3.0.0) terminal-notifier (>= 2.0.0, < 3.0.0) terminal-table (>= 1.4.5, < 2.0.0) tty-screen (>= 0.6.3, < 1.0.0) @@ -82,92 +106,106 @@ GEM xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) gh_inspector (1.1.3) - google-api-client (0.36.4) + google-apis-androidpublisher_v3 (0.22.0) + google-apis-core (>= 0.5, < 2.a) + google-apis-core (0.6.0) addressable (~> 2.5, >= 2.5.1) - googleauth (~> 0.9) - httpclient (>= 2.8.1, < 3.0) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) mini_mime (~> 1.0) representable (~> 3.0) - retriable (>= 2.0, < 4.0) - signet (~> 0.12) - google-cloud-core (1.5.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-iamcredentials_v1 (0.12.0) + google-apis-core (>= 0.6, < 2.a) + google-apis-playcustomapp_v1 (0.9.0) + google-apis-core (>= 0.6, < 2.a) + google-apis-storage_v1 (0.15.0) + google-apis-core (>= 0.5, < 2.a) + google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) - google-cloud-env (1.3.1) - faraday (>= 0.17.3, < 2.0) - google-cloud-errors (1.0.0) - google-cloud-storage (1.25.1) - addressable (~> 2.5) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.2.0) + google-cloud-storage (1.36.2) + addressable (~> 2.8) digest-crc (~> 0.4) - google-api-client (~> 0.33) - google-cloud-core (~> 1.2) - googleauth (~> 0.9) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.1) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (0.11.0) - faraday (>= 0.17.3, < 2.0) + googleauth (1.2.0) + faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) - signet (~> 0.12) - highline (1.7.10) - http-cookie (1.0.3) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - jmespath (1.4.0) - json (2.3.0) - jwt (2.1.0) + jmespath (1.6.1) + json (2.6.2) + jwt (2.4.1) memoist (0.16.2) - mini_magick (4.10.1) - mini_mime (1.0.2) - multi_json (1.14.1) - multi_xml (0.6.0) + mini_magick (4.11.0) + mini_mime (1.1.2) + multi_json (1.15.0) multipart-post (2.0.0) - nanaimo (0.2.6) - naturally (2.2.0) - os (1.1.0) - plist (3.5.0) - public_suffix (2.0.5) - representable (3.0.4) + nanaimo (0.3.0) + naturally (2.2.1) + optparse (0.1.1) + os (1.1.4) + plist (3.6.0) + public_suffix (4.0.7) + rake (13.0.6) + representable (3.2.0) declarative (< 0.1.0) - declarative-option (< 0.2.0) + trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) + rexml (3.2.5) rouge (2.0.7) - rubyzip (1.3.0) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) security (0.1.3) - signet (0.14.0) - addressable (~> 2.3) - faraday (>= 0.17.3, < 2.0) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) simctl (1.6.8) CFPropertyList naturally - slack-notifier (2.3.2) terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) + trailblazer-option (0.1.2) tty-cursor (0.7.1) - tty-screen (0.7.1) + tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) uber (0.1.0) unf (0.1.4) unf_ext - unf_ext (0.0.7.7) - unf_ext (0.0.7.7-x64-mingw32) - unicode-display_width (1.7.0) + unf_ext (0.0.8.2) + unicode-display_width (1.8.0) + webrick (1.7.0) word_wrap (1.0.0) - xcodeproj (1.15.0) + xcodeproj (1.22.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.6) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) xcpretty (0.3.0) rouge (~> 2.0.7) - xcpretty-travis-formatter (1.0.0) + xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) PLATFORMS @@ -178,4 +216,4 @@ DEPENDENCIES fastlane BUNDLED WITH - 2.0.2 + 2.3.11 diff --git a/android/app/build.gradle b/android/app/build.gradle index a44f99069..4455d876c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -144,7 +144,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode VERSIONCODE as Integer - versionName "4.28.0" + versionName "4.29.0" vectorDrawables.useSupportLibrary = true if (!isFoss) { manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String] diff --git a/android/app/src/main/assets/fonts/custom.ttf b/android/app/src/main/assets/fonts/custom.ttf index 4088f7c38..67c42d9e3 100644 Binary files a/android/app/src/main/assets/fonts/custom.ttf and b/android/app/src/main/assets/fonts/custom.ttf differ diff --git a/android/app/src/main/java/chat/rocket/reactnative/MainActivity.java b/android/app/src/main/java/chat/rocket/reactnative/MainActivity.java index e93eb3f96..e67d24c91 100644 --- a/android/app/src/main/java/chat/rocket/reactnative/MainActivity.java +++ b/android/app/src/main/java/chat/rocket/reactnative/MainActivity.java @@ -12,7 +12,6 @@ import com.facebook.react.ReactRootView; import com.facebook.react.ReactActivityDelegate; import com.facebook.react.ReactFragmentActivity; -import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; import com.zoontek.rnbootsplash.RNBootSplash; import com.google.gson.Gson; @@ -51,16 +50,6 @@ public class MainActivity extends ReactFragmentActivity { return "RocketChatRN"; } - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new ReactActivityDelegate(this, getMainComponentName()) { - @Override - protected ReactRootView createRootView() { - return new RNGestureHandlerEnabledRootView(MainActivity.this); - } - }; - } - // from react-native-orientation @Override public void onConfigurationChanged(Configuration newConfig) { diff --git a/android/app/src/main/java/chat/rocket/reactnative/share/ShareActivity.java b/android/app/src/main/java/chat/rocket/reactnative/share/ShareActivity.java index 873db3473..547ec7da6 100644 --- a/android/app/src/main/java/chat/rocket/reactnative/share/ShareActivity.java +++ b/android/app/src/main/java/chat/rocket/reactnative/share/ShareActivity.java @@ -3,21 +3,10 @@ package chat.rocket.reactnative.share; import com.facebook.react.ReactActivity; import com.facebook.react.ReactActivityDelegate; import com.facebook.react.ReactRootView; -import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; public class ShareActivity extends ReactActivity { @Override protected String getMainComponentName() { return "ShareRocketChatRN"; } - - @Override - protected ReactActivityDelegate createReactActivityDelegate() { - return new ReactActivityDelegate(this, getMainComponentName()) { - @Override - protected ReactRootView createRootView() { - return new RNGestureHandlerEnabledRootView(ShareActivity.this); - } - }; - } } \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 626e7564e..6399e02bd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -14,7 +14,7 @@ buildscript { targetSdkVersion = 30 ndkVersion = "20.1.5948944" glideVersion = "4.11.0" - kotlin_version = "1.3.50" + kotlin_version = "1.6.10" supportLibVersion = "28.0.0" libre_build = !(isPlay.toBoolean()) jitsi_url = isPlay ? "https://github.com/RocketChat/jitsi-maven-repository/raw/master/releases" : "https://github.com/RocketChat/jitsi-maven-repository/raw/libre/releases" diff --git a/android/gradle.properties b/android/gradle.properties index 0d28e92b4..e1b8237fc 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -36,7 +36,4 @@ BugsnagAPIKey="" KEYSTORE=my-upload-key.keystore KEY_ALIAS=my-key-alias KEYSTORE_PASSWORD= -KEY_PASSWORD= - -# Version of flipper SDK to use with React Native -FLIPPER_VERSION=0.75.1 +KEY_PASSWORD= \ No newline at end of file diff --git a/app/AppContainer.tsx b/app/AppContainer.tsx index f67b38c7f..90e48eecb 100644 --- a/app/AppContainer.tsx +++ b/app/AppContainer.tsx @@ -5,7 +5,7 @@ import { connect } from 'react-redux'; import { SetUsernameStackParamList, StackParamList } from './definitions/navigationTypes'; import Navigation from './lib/navigation/appNavigation'; -import { defaultHeader, getActiveRouteName, navigationTheme } from './utils/navigation'; +import { defaultHeader, getActiveRouteName, navigationTheme } from './lib/methods/helpers/navigation'; import { RootEnum } from './definitions'; // Stacks import AuthLoadingView from './views/AuthLoadingView'; @@ -15,7 +15,7 @@ import OutsideStack from './stacks/OutsideStack'; import InsideStack from './stacks/InsideStack'; import MasterDetailStack from './stacks/MasterDetailStack'; import { ThemeContext } from './theme'; -import { setCurrentScreen } from './utils/log'; +import { setCurrentScreen } from './lib/methods/helpers/log'; // SetUsernameStack const SetUsername = createStackNavigator(); diff --git a/app/actions/actionsTypes.ts b/app/actions/actionsTypes.ts index a920e27e2..f33c9ec7f 100644 --- a/app/actions/actionsTypes.ts +++ b/app/actions/actionsTypes.ts @@ -27,7 +27,6 @@ export const ROOM = createRequestTypes('ROOM', [ 'LEAVE', 'DELETE', 'REMOVED', - 'CLOSE', 'FORWARD', 'USER_TYPING' ]); @@ -54,6 +53,7 @@ export const SERVER = createRequestTypes('SERVER', [ ]); export const METEOR = createRequestTypes('METEOR_CONNECT', [...defaultTypes, 'DISCONNECT']); export const LOGOUT = 'LOGOUT'; // logout is always success +export const DELETE_ACCOUNT = 'DELETE_ACCOUNT'; export const SNIPPETED_MESSAGES = createRequestTypes('SNIPPETED_MESSAGES', ['OPEN', 'READY', 'CLOSE', 'MESSAGES_RECEIVED']); export const DEEP_LINKING = createRequestTypes('DEEP_LINKING', ['OPEN']); export const SORT_PREFERENCES = createRequestTypes('SORT_PREFERENCES', ['SET_ALL', 'SET']); diff --git a/app/actions/login.ts b/app/actions/login.ts index 990c9f858..17174145c 100644 --- a/app/actions/login.ts +++ b/app/actions/login.ts @@ -121,3 +121,9 @@ export function setLocalAuthenticated(isLocalAuthenticated: boolean): ISetLocalA isLocalAuthenticated }; } + +export function deleteAccount(): Action { + return { + type: types.DELETE_ACCOUNT + }; +} diff --git a/app/actions/room.ts b/app/actions/room.ts index f0d5ed81b..168110199 100644 --- a/app/actions/room.ts +++ b/app/actions/room.ts @@ -19,7 +19,6 @@ interface IBaseReturn extends Action { type TSubscribeRoom = IBaseReturn; type TUnsubscribeRoom = IBaseReturn; -type TCloseRoom = IBaseReturn; type TRoom = Record; @@ -45,7 +44,7 @@ interface IUserTyping extends Action { status: boolean; } -export type TActionsRoom = TSubscribeRoom & TUnsubscribeRoom & TCloseRoom & ILeaveRoom & IDeleteRoom & IForwardRoom & IUserTyping; +export type TActionsRoom = TSubscribeRoom & TUnsubscribeRoom & ILeaveRoom & IDeleteRoom & IForwardRoom & IUserTyping; export function subscribeRoom(rid: string): TSubscribeRoom { return { @@ -79,13 +78,6 @@ export function deleteRoom(roomType: ERoomType, room: TRoom, selected?: ISelecte }; } -export function closeRoom(rid: string): TCloseRoom { - return { - type: ROOM.CLOSE, - rid - }; -} - export function forwardRoom(rid: string, transferData: ITransferData): IForwardRoom { return { type: ROOM.FORWARD, diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index c028bada6..fb00d5267 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -8,7 +8,7 @@ import BottomSheet, { BottomSheetBackdrop } from '@gorhom/bottom-sheet'; import { useDimensions, useOrientation } from '../../dimensions'; import { useTheme } from '../../theme'; -import { isIOS, isTablet } from '../../utils/deviceInfo'; +import { isIOS, isTablet } from '../../lib/methods/helpers'; import { Handle } from './Handle'; import { TActionSheetOptions } from './Provider'; import BottomSheetContent from './BottomSheetContent'; @@ -101,6 +101,11 @@ const ActionSheet = React.memo( ); + const onClose = () => { + toggleVisible(); + data?.onClose && data?.onClose(); + }; + const renderBackdrop = useCallback( props => ( {children} @@ -130,7 +139,8 @@ const ActionSheet = React.memo( enablePanDownToClose style={{ ...styles.container, ...bottomSheet }} backgroundStyle={{ backgroundColor: colors.focusedBackground }} - onChange={index => index === -1 && toggleVisible()}> + onChange={index => index === -1 && onClose()} + {...androidTablet}> )} diff --git a/app/containers/ActionSheet/ActionSheetContentWithInputAndSubmit/index.tsx b/app/containers/ActionSheet/ActionSheetContentWithInputAndSubmit/index.tsx new file mode 100644 index 000000000..b3562c484 --- /dev/null +++ b/app/containers/ActionSheet/ActionSheetContentWithInputAndSubmit/index.tsx @@ -0,0 +1,141 @@ +import React, { useState } from 'react'; +import { StyleSheet, Text, View } from 'react-native'; + +import { CustomIcon, TIconsName } from '../../CustomIcon'; +import i18n from '../../../i18n'; +import { isIOS } from '../../../lib/methods/helpers'; +import { useTheme } from '../../../theme'; +import sharedStyles from '../../../views/Styles'; +import Button from '../../Button'; +import { FormTextInput } from '../../TextInput/FormTextInput'; +import { useActionSheet } from '../Provider'; + +const styles = StyleSheet.create({ + subtitleText: { + fontSize: 14, + ...sharedStyles.textRegular, + marginBottom: 10 + }, + buttonSeparator: { + marginRight: 8 + }, + footerButtonsContainer: { + flexDirection: 'row', + paddingTop: 16 + }, + titleContainerText: { + fontSize: 16, + ...sharedStyles.textSemibold + }, + titleContainer: { + paddingRight: 80, + marginBottom: 16, + flexDirection: 'row', + alignItems: 'center' + } +}); + +const FooterButtons = ({ + cancelAction = () => {}, + confirmAction = () => {}, + cancelTitle = '', + confirmTitle = '', + disabled = false, + cancelBackgroundColor = '', + confirmBackgroundColor = '' +}): React.ReactElement => { + const { colors } = useTheme(); + return ( + +