From 595a1b0a6809dceabe4f6942c142db8de731c6e3 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 12:08:53 +0100 Subject: [PATCH 001/128] add required changes to run hybrid app --- package-lock.json | 14 ++-- package.json | 2 +- ...react-native-image-manipulator+1.0.5.patch | 4 +- patches/@onfido+react-native-sdk+8.3.0.patch | 46 ++++++++++ .../@react-native+gradle-plugin+0.72.11.patch | 83 +++++++++++++++++++ ...-async-storage+async-storage+1.17.11.patch | 13 +++ ...native-camera-roll+camera-roll+5.4.0.patch | 15 ++++ ...ommunity+cli-platform-android+11.3.6.patch | 57 +++++++++++++ ...ve-community+cli-platform-ios+11.3.6.patch | 51 ++++++++++++ ...act-native-firebase+analytics+12.9.3.patch | 18 ++++ .../@react-native-firebase+app+12.9.3.patch | 25 ++++++ ...t-native-firebase+crashlytics+12.9.3.patch | 17 ++++ .../@react-native-firebase+perf+12.9.3.patch | 17 ++++ patches/react-native-reanimated+3.5.4.patch | 17 ++++ src/App.js | 77 ++++++++++------- src/InitialUrlContext.ts | 5 ++ src/libs/Navigation/AppNavigator/index.js | 17 +++- src/pages/LogOutPreviousUserPage.js | 14 ++-- 18 files changed, 445 insertions(+), 47 deletions(-) create mode 100644 patches/@react-native+gradle-plugin+0.72.11.patch create mode 100644 patches/@react-native-async-storage+async-storage+1.17.11.patch create mode 100644 patches/@react-native-camera-roll+camera-roll+5.4.0.patch create mode 100644 patches/@react-native-community+cli-platform-android+11.3.6.patch create mode 100644 patches/@react-native-community+cli-platform-ios+11.3.6.patch create mode 100644 patches/@react-native-firebase+analytics+12.9.3.patch create mode 100644 patches/@react-native-firebase+app+12.9.3.patch create mode 100644 patches/@react-native-firebase+crashlytics+12.9.3.patch create mode 100644 patches/@react-native-firebase+perf+12.9.3.patch create mode 100644 patches/react-native-reanimated+3.5.4.patch create mode 100644 src/InitialUrlContext.ts diff --git a/package-lock.json b/package-lock.json index 1d6333ad719e..cccdd27c6bcd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -108,7 +108,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", - "react-native-vision-camera": "^2.16.2", + "react-native-vision-camera": "2.16.5", "react-native-web": "^0.19.9", "react-native-web-linear-gradient": "^1.1.2", "react-native-webview": "^11.17.2", @@ -44717,9 +44717,9 @@ } }, "node_modules/react-native-vision-camera": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.2.tgz", - "integrity": "sha512-QIpG33l3QB0AkTfX/ccRknwNRu1APNUkokVKF1lpRO2+tBnkXnGL0UapgXg5u9KIONZtrpupeDeO+J5B2TeQVw==", + "version": "2.16.5", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.5.tgz", + "integrity": "sha512-MzXhNd597OyMQSEGhqWI4DufWkdr7PR7U9B30E3gXnln7cnvjMVIp4j3eIW9BIrgvEyUcEeL7nZM5NLhTmO/fA==", "peerDependencies": { "react": "*", "react-native": "*" @@ -84992,9 +84992,9 @@ "requires": {} }, "react-native-vision-camera": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.2.tgz", - "integrity": "sha512-QIpG33l3QB0AkTfX/ccRknwNRu1APNUkokVKF1lpRO2+tBnkXnGL0UapgXg5u9KIONZtrpupeDeO+J5B2TeQVw==", + "version": "2.16.5", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.5.tgz", + "integrity": "sha512-MzXhNd597OyMQSEGhqWI4DufWkdr7PR7U9B30E3gXnln7cnvjMVIp4j3eIW9BIrgvEyUcEeL7nZM5NLhTmO/fA==", "requires": {} }, "react-native-web": { diff --git a/package.json b/package.json index 1453e85fef53..79a74d05a281 100644 --- a/package.json +++ b/package.json @@ -155,7 +155,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", - "react-native-vision-camera": "^2.16.2", + "react-native-vision-camera": "2.16.5", "react-native-web": "^0.19.9", "react-native-web-linear-gradient": "^1.1.2", "react-native-webview": "^11.17.2", diff --git a/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch b/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch index c613a47a3072..eb5ef2da6247 100644 --- a/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch +++ b/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch @@ -7,13 +7,13 @@ index 3a1a548..fe030bb 100644 android { - compileSdkVersion 28 -+ compileSdkVersion 30 ++ compileSdkVersion 33 buildToolsVersion "28.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 28 -+ targetSdkVersion 30 ++ targetSdkVersion 33 versionCode 1 versionName "1.0" } diff --git a/patches/@onfido+react-native-sdk+8.3.0.patch b/patches/@onfido+react-native-sdk+8.3.0.patch index 12245cb58355..940c40eb9bb0 100644 --- a/patches/@onfido+react-native-sdk+8.3.0.patch +++ b/patches/@onfido+react-native-sdk+8.3.0.patch @@ -15,3 +15,49 @@ index b4c7106..d5083d3 100644 } classDirectories.setFrom(fileTree( dir: 'build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/onfido/reactnative/sdk', +diff --git a/node_modules/@onfido/react-native-sdk/android/publish.gradle b/node_modules/@onfido/react-native-sdk/android/publish.gradle +index 216d52d..1f1c17f 100644 +--- a/node_modules/@onfido/react-native-sdk/android/publish.gradle ++++ b/node_modules/@onfido/react-native-sdk/android/publish.gradle +@@ -4,41 +4,5 @@ afterEvaluate { + archiveClassifier = "sources" + } + +- publishing { +- def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) + +- publications { +- mavenJava(MavenPublication) { +- // The new gradle publish plugin doesn't allow the @onfido/ prefix +- artifactId = packageJson.name.replace("@onfido/", "onfido-") +- groupId = 'com.onfido.reactnative.sdk' +- version = packageJson.version +- +- from components.release +- +- artifact sourceJar +- +- pom { +- name = packageJson.title +- description = packageJson.description +- url = packageJson.repository.baseUrl +- +- licenses { +- license { +- name = packageJson.license +- url = packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename +- distribution = 'repo' +- } +- } +- +- developers { +- developer { +- id = packageJson.author.email +- name = packageJson.author.name +- } +- } +- } +- } +- } +- } + } diff --git a/patches/@react-native+gradle-plugin+0.72.11.patch b/patches/@react-native+gradle-plugin+0.72.11.patch new file mode 100644 index 000000000000..8609c992b4d6 --- /dev/null +++ b/patches/@react-native+gradle-plugin+0.72.11.patch @@ -0,0 +1,83 @@ +diff --git a/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt b/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +index 062dcc7..cb400ec 100644 +--- a/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt ++++ b/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +@@ -15,6 +15,7 @@ import com.facebook.react.tasks.GenerateCodegenArtifactsTask + import com.facebook.react.tasks.GenerateCodegenSchemaTask + import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFields + import com.facebook.react.utils.AgpConfiguratorUtils.configureDevPorts ++import com.facebook.react.utils.AgpConfiguratorUtils.configureNamespaceForLibraries + import com.facebook.react.utils.BackwardCompatUtils.configureBackwardCompatibilityReactMap + import com.facebook.react.utils.DependencyUtils.configureDependencies + import com.facebook.react.utils.DependencyUtils.configureRepositories +@@ -64,6 +65,7 @@ class ReactPlugin : Plugin { + + configureReactNativeNdk(project, extension) + configureBuildConfigFields(project) ++ configureNamespaceForLibraries(project) + configureDevPorts(project) + configureBackwardCompatibilityReactMap(project) + +diff --git a/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt b/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt +index 3bf0085..59397b4 100644 +--- a/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt ++++ b/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt +@@ -8,11 +8,17 @@ + package com.facebook.react.utils + + import com.android.build.api.variant.AndroidComponentsExtension ++import com.facebook.react.ReactExtension + import com.facebook.react.utils.ProjectUtils.isHermesEnabled + import com.facebook.react.utils.ProjectUtils.isNewArchEnabled + import org.gradle.api.Action + import org.gradle.api.Project + import org.gradle.api.plugins.AppliedPlugin ++import java.io.File ++import com.android.build.gradle.LibraryExtension ++import javax.xml.parsers.DocumentBuilder ++import javax.xml.parsers.DocumentBuilderFactory ++import org.w3c.dom.Element + + @Suppress("UnstableApiUsage") + internal object AgpConfiguratorUtils { +@@ -49,6 +55,40 @@ internal object AgpConfiguratorUtils { + project.pluginManager.withPlugin("com.android.application", action) + project.pluginManager.withPlugin("com.android.library", action) + } ++ ++ fun configureNamespaceForLibraries(appProject: Project) { ++ appProject.rootProject.allprojects { subproject -> ++ subproject.pluginManager.withPlugin("com.android.library") { ++ subproject.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext -> ++ if(ext.namespace == null){ ++ val android = subproject.extensions.getByType(LibraryExtension::class.java) ++ val manifestFile = android.sourceSets.getByName("main").manifest.srcFile ++ ++ manifestFile.takeIf { it.exists() }?.let { file -> ++ getPackageNameFromManifest(file)?.let { packageName -> ++ ext.namespace = packageName ++ } ++ } ++ } ++ } ++ } ++ } ++ } ++ fun getPackageNameFromManifest(manifest: File): String? { ++ val factory: DocumentBuilderFactory = DocumentBuilderFactory.newInstance() ++ val builder: DocumentBuilder = factory.newDocumentBuilder() ++ ++ try { ++ val xmlDocument = builder.parse(manifest) ++ ++ val manifestElement = xmlDocument.getElementsByTagName("manifest").item(0) as? Element ++ val packageName = manifestElement?.getAttribute("package") ++ ++ return if (packageName.isNullOrEmpty()) null else packageName ++ } catch (e: Exception) { ++ return null ++ } ++ } + } + + const val DEFAULT_DEV_SERVER_PORT = "8081" diff --git a/patches/@react-native-async-storage+async-storage+1.17.11.patch b/patches/@react-native-async-storage+async-storage+1.17.11.patch new file mode 100644 index 000000000000..1c8a139bc10f --- /dev/null +++ b/patches/@react-native-async-storage+async-storage+1.17.11.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/@react-native-async-storage/async-storage/android/build.gradle b/node_modules/@react-native-async-storage/async-storage/android/build.gradle +index ff1baa4..32d8020 100644 +--- a/node_modules/@react-native-async-storage/async-storage/android/build.gradle ++++ b/node_modules/@react-native-async-storage/async-storage/android/build.gradle +@@ -112,7 +112,7 @@ repositories { + dependencies { + + if (useNextStorage) { +- def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.2') ++ def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.3') + def coroutines_version = "1.6.0" + def coroutinesTest_version = "1.6.0" + // if we don't provide explicit dependency on reflection, kotlin plugin \ No newline at end of file diff --git a/patches/@react-native-camera-roll+camera-roll+5.4.0.patch b/patches/@react-native-camera-roll+camera-roll+5.4.0.patch new file mode 100644 index 000000000000..f0429bc10125 --- /dev/null +++ b/patches/@react-native-camera-roll+camera-roll+5.4.0.patch @@ -0,0 +1,15 @@ +diff --git a/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle b/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle +index 3f76132..63dc946 100644 +--- a/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle ++++ b/node_modules/@react-native-camera-roll/camera-roll/android/build.gradle +@@ -81,7 +81,9 @@ def findNodeModulePath(baseDir, packageName) { + } + + def resolveReactNativeDirectory() { +- def reactNative = file("${findNodeModulePath(rootProject.projectDir, "react-native")}") ++ def projectDir = this.hasProperty('reactNativeProject') ? this.reactNativeProject : rootProject.projectDir ++ def modulePath = file(projectDir); ++ def reactNative = file("${findNodeModulePath(modulePath, 'react-native')}") + if (reactNative.exists()) { + return reactNative + } diff --git a/patches/@react-native-community+cli-platform-android+11.3.6.patch b/patches/@react-native-community+cli-platform-android+11.3.6.patch new file mode 100644 index 000000000000..ddebb53db36d --- /dev/null +++ b/patches/@react-native-community+cli-platform-android+11.3.6.patch @@ -0,0 +1,57 @@ +diff --git a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle +index 8a218d5..8deb9c0 100644 +--- a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle ++++ b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle +@@ -140,6 +140,7 @@ class ReactNativeModules { + private Logger logger + private String packageName + private File root ++ private File rnRoot + private ArrayList> reactNativeModules + private ArrayList unstable_reactLegacyComponentNames + private HashMap reactNativeModulesBuildVariants +@@ -147,8 +148,13 @@ class ReactNativeModules { + private static String LOG_PREFIX = ":ReactNative:" + + ReactNativeModules(Logger logger, File root) { ++ this(logger, root, root) ++ } ++ ++ ReactNativeModules(Logger logger, File root, File rnRoot) { + this.logger = logger + this.root = root ++ this.rnRoot = rnRoot + + def (nativeModules, reactNativeModulesBuildVariants, androidProject) = this.getReactNativeConfig() + this.reactNativeModules = nativeModules +@@ -413,11 +419,12 @@ class ReactNativeModules { + * @todo: `fastlane` has been reported to not work too. + */ + def cliResolveScript = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" ++ + String[] nodeCommand = ["node", "-e", cliResolveScript] +- def cliPath = this.getCommandOutput(nodeCommand, this.root) ++ def cliPath = this.getCommandOutput(nodeCommand, this.rnRoot) + + String[] reactNativeConfigCommand = ["node", cliPath, "config"] +- def reactNativeConfigOutput = this.getCommandOutput(reactNativeConfigCommand, this.root) ++ def reactNativeConfigOutput = this.getCommandOutput(reactNativeConfigCommand, this.rnRoot) + + def json + try { +@@ -482,8 +489,14 @@ class ReactNativeModules { + * where build files of an active project are located. + */ + def projectRoot = rootProject.projectDir ++def autoModules ++ ++if(this.hasProperty('reactNativeProject')){ ++ autoModules = new ReactNativeModules(logger, projectRoot, new File(projectRoot, reactNativeProject)) ++} else { ++ autoModules = new ReactNativeModules(logger, projectRoot) ++} + +-def autoModules = new ReactNativeModules(logger, projectRoot) + + /** ----------------------- + * Exported Extensions diff --git a/patches/@react-native-community+cli-platform-ios+11.3.6.patch b/patches/@react-native-community+cli-platform-ios+11.3.6.patch new file mode 100644 index 000000000000..9c97b8666ef2 --- /dev/null +++ b/patches/@react-native-community+cli-platform-ios+11.3.6.patch @@ -0,0 +1,51 @@ +diff --git a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb +index 1b6eece..914039e 100644 +--- a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb ++++ b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb +@@ -12,7 +12,7 @@ + require 'pathname' + require 'cocoapods' + +-def use_native_modules!(config = nil) ++def updateConfig(config = nil) + if (config.is_a? String) + Pod::UI.warn("Passing custom root to use_native_modules! is deprecated.", + [ +@@ -24,7 +24,6 @@ def use_native_modules!(config = nil) + # Resolving the path the RN CLI. The `@react-native-community/cli` module may not be there for certain package managers, so we fall back to resolving it through `react-native` package, that's always present in RN projects + cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" + cli_bin = Pod::Executable.execute_command("node", ["-e", cli_resolve_script], true).strip +- + if (!config) + json = [] + +@@ -36,10 +35,29 @@ def use_native_modules!(config = nil) + + config = JSON.parse(json.join("\n")) + end ++end ++ ++def use_native_modules!(config = nil) ++ if (ENV['REACT_NATIVE_DIR']) ++ Dir.chdir(ENV['REACT_NATIVE_DIR']) do ++ config = updateConfig(config) ++ end ++ else ++ config = updateConfig(config) ++ end + + project_root = Pathname.new(config["project"]["ios"]["sourceDir"]) ++ if(ENV["PROJECT_ROOT_DIR"]) ++ project_root = File.join(Dir.pwd, ENV["PROJECT_ROOT_DIR"]) ++ ++ end + + packages = config["dependencies"] ++ ++ if (ENV["NO_FLIPPER"]) ++ packages["react-native-flipper"]["platforms"]["ios"] = nil ++ end ++ + found_pods = [] + + packages.each do |package_name, package| diff --git a/patches/@react-native-firebase+analytics+12.9.3.patch b/patches/@react-native-firebase+analytics+12.9.3.patch new file mode 100644 index 000000000000..74d3e2a8005a --- /dev/null +++ b/patches/@react-native-firebase+analytics+12.9.3.patch @@ -0,0 +1,18 @@ +diff --git a/node_modules/@react-native-firebase/analytics/android/build.gradle b/node_modules/@react-native-firebase/analytics/android/build.gradle +index d223ebf..821b730 100644 +--- a/node_modules/@react-native-firebase/analytics/android/build.gradle ++++ b/node_modules/@react-native-firebase/analytics/android/build.gradle +@@ -45,6 +45,8 @@ if (coreVersionDetected != coreVersionRequired) { + } + } + ++apply plugin: 'com.android.library' ++ + project.ext { + set('react-native', [ + versions: [ +@@ -144,4 +146,3 @@ dependencies { + ReactNative.shared.applyPackageVersion() + ReactNative.shared.applyDefaultExcludes() + ReactNative.module.applyAndroidVersions() +-ReactNative.module.applyReactNativeDependency("api") diff --git a/patches/@react-native-firebase+app+12.9.3.patch b/patches/@react-native-firebase+app+12.9.3.patch new file mode 100644 index 000000000000..312fdacf4432 --- /dev/null +++ b/patches/@react-native-firebase+app+12.9.3.patch @@ -0,0 +1,25 @@ +diff --git a/node_modules/@react-native-firebase/app/android/build.gradle b/node_modules/@react-native-firebase/app/android/build.gradle +index 05f629a..7c36693 100644 +--- a/node_modules/@react-native-firebase/app/android/build.gradle ++++ b/node_modules/@react-native-firebase/app/android/build.gradle +@@ -18,6 +18,7 @@ buildscript { + + plugins { + id "io.invertase.gradle.build" version "1.5" ++ id 'com.android.library' + } + + def packageJson = PackageJson.getForProject(project) +@@ -91,6 +92,7 @@ repositories { + } + + dependencies { ++ api 'com.facebook.react:react-native:+' + implementation platform("com.google.firebase:firebase-bom:${ReactNative.ext.getVersion("firebase", "bom")}") + implementation "com.google.firebase:firebase-common" + implementation "com.google.android.gms:play-services-auth:${ReactNative.ext.getVersion("play", "play-services-auth")}" +@@ -99,4 +101,3 @@ dependencies { + ReactNative.shared.applyPackageVersion() + ReactNative.shared.applyDefaultExcludes() + ReactNative.module.applyAndroidVersions() +-ReactNative.module.applyReactNativeDependency("api") diff --git a/patches/@react-native-firebase+crashlytics+12.9.3.patch b/patches/@react-native-firebase+crashlytics+12.9.3.patch new file mode 100644 index 000000000000..560f462731dc --- /dev/null +++ b/patches/@react-native-firebase+crashlytics+12.9.3.patch @@ -0,0 +1,17 @@ +diff --git a/node_modules/@react-native-firebase/crashlytics/android/build.gradle b/node_modules/@react-native-firebase/crashlytics/android/build.gradle +index 6b6de57..9b89ae7 100644 +--- a/node_modules/@react-native-firebase/crashlytics/android/build.gradle ++++ b/node_modules/@react-native-firebase/crashlytics/android/build.gradle +@@ -18,6 +18,7 @@ buildscript { + + plugins { + id "io.invertase.gradle.build" version "1.5" ++ id 'com.android.library' + } + + def appProject +@@ -92,4 +93,3 @@ dependencies { + ReactNative.shared.applyPackageVersion() + ReactNative.shared.applyDefaultExcludes() + ReactNative.module.applyAndroidVersions() +-ReactNative.module.applyReactNativeDependency("api") diff --git a/patches/@react-native-firebase+perf+12.9.3.patch b/patches/@react-native-firebase+perf+12.9.3.patch new file mode 100644 index 000000000000..7d8a9f4f23b5 --- /dev/null +++ b/patches/@react-native-firebase+perf+12.9.3.patch @@ -0,0 +1,17 @@ +diff --git a/node_modules/@react-native-firebase/perf/android/build.gradle b/node_modules/@react-native-firebase/perf/android/build.gradle +index b4a9c7b..5835e3d 100644 +--- a/node_modules/@react-native-firebase/perf/android/build.gradle ++++ b/node_modules/@react-native-firebase/perf/android/build.gradle +@@ -19,6 +19,7 @@ buildscript { + + plugins { + id "io.invertase.gradle.build" version "1.5" ++ id 'com.android.library' + } + + def appProject +@@ -129,4 +130,3 @@ dependencies { + ReactNative.shared.applyPackageVersion() + ReactNative.shared.applyDefaultExcludes() + ReactNative.module.applyAndroidVersions() +-ReactNative.module.applyReactNativeDependency("api") diff --git a/patches/react-native-reanimated+3.5.4.patch b/patches/react-native-reanimated+3.5.4.patch new file mode 100644 index 000000000000..3b40360d5860 --- /dev/null +++ b/patches/react-native-reanimated+3.5.4.patch @@ -0,0 +1,17 @@ +diff --git a/node_modules/react-native-reanimated/scripts/reanimated_utils.rb b/node_modules/react-native-reanimated/scripts/reanimated_utils.rb +index af0935f..ccd2a9e 100644 +--- a/node_modules/react-native-reanimated/scripts/reanimated_utils.rb ++++ b/node_modules/react-native-reanimated/scripts/reanimated_utils.rb +@@ -17,7 +17,11 @@ def find_config() + :react_native_common_dir => nil, + } + +- react_native_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`), '..') ++ root_project = Pod::Config.instance.installation_root.to_s ++ if(ENV['PROJECT_ROOT_DIR']) ++ root_project = ENV['PROJECT_ROOT_DIR'] ++ end ++ react_native_node_modules_dir = File.join(File.dirname(`cd "#{root_project}" && node --print "require.resolve('react-native/package.json')"`), '..') + react_native_json = try_to_parse_react_native_package_json(react_native_node_modules_dir) + + if react_native_json == nil diff --git a/src/App.js b/src/App.js index 2caa6b9ffc29..6479e05e13da 100644 --- a/src/App.js +++ b/src/App.js @@ -1,4 +1,5 @@ import {PortalProvider} from '@gorhom/portal'; +import PropTypes from 'prop-types'; import React from 'react'; import {LogBox} from 'react-native'; import {GestureHandlerRootView} from 'react-native-gesture-handler'; @@ -22,6 +23,7 @@ import {KeyboardStateProvider} from './components/withKeyboardState'; import {WindowDimensionsProvider} from './components/withWindowDimensions'; import Expensify from './Expensify'; import useDefaultDragAndDrop from './hooks/useDefaultDragAndDrop'; +import InitialUrlContext from './InitialUrlContext'; import OnyxUpdateManager from './libs/actions/OnyxUpdateManager'; import * as Session from './libs/actions/Session'; import * as Environment from './libs/Environment/Environment'; @@ -30,6 +32,15 @@ import ThemeIllustrationsProvider from './styles/illustrations/ThemeIllustration import ThemeProvider from './styles/themes/ThemeProvider'; import ThemeStylesProvider from './styles/ThemeStylesProvider'; +const propTypes = { + /** If we have an authToken this is true */ + url: PropTypes.string, +}; + +const defaultProps = { + url: null, +}; + // For easier debugging and development, when we are in web we expose Onyx to the window, so you can more easily set data into Onyx if (window && Environment.isDevelopment()) { window.Onyx = Onyx; @@ -45,43 +56,47 @@ LogBox.ignoreLogs([ const fill = {flex: 1}; -function App() { +function App(props) { useDefaultDragAndDrop(); OnyxUpdateManager(); return ( - - - - - - - - - - + + + + + + + + + + + + ); } +App.propTypes = propTypes; +App.defaultProps = defaultProps; App.displayName = 'App'; export default App; diff --git a/src/InitialUrlContext.ts b/src/InitialUrlContext.ts new file mode 100644 index 000000000000..eabf099dafe0 --- /dev/null +++ b/src/InitialUrlContext.ts @@ -0,0 +1,5 @@ +import {createContext} from 'react'; + +const InitialUrlContext = createContext<{initialUrl: string | null}>({initialUrl: null}); + +export default InitialUrlContext; diff --git a/src/libs/Navigation/AppNavigator/index.js b/src/libs/Navigation/AppNavigator/index.js index 0d03badf37bc..0a39a0bafeb9 100644 --- a/src/libs/Navigation/AppNavigator/index.js +++ b/src/libs/Navigation/AppNavigator/index.js @@ -1,5 +1,8 @@ import PropTypes from 'prop-types'; -import React from 'react'; +import React, {useContext, useEffect} from 'react'; +import {NativeModules} from 'react-native'; +import Navigation from '@libs/Navigation/Navigation'; +import InitialUrlContext from '@src/InitialUrlContext'; const propTypes = { /** If we have an authToken this is true */ @@ -7,6 +10,18 @@ const propTypes = { }; function AppNavigator(props) { + const initUrl = useContext(InitialUrlContext); + + useEffect(() => { + if (!NativeModules.ReactNativeModule) { + return; + } + + Navigation.isNavigationReady().then(() => { + Navigation.navigate(initUrl); + }); + }, [initUrl]); + if (props.authenticated) { const AuthScreens = require('./AuthScreens').default; diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index df38c28e561a..81fe480ffcce 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -1,12 +1,14 @@ import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; -import React, {useEffect} from 'react'; -import {Linking} from 'react-native'; +import React, {useContext, useEffect} from 'react'; +import {Linking, NativeModules} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import * as SessionUtils from '@libs/SessionUtils'; import Navigation from '@navigation/Navigation'; import * as Session from '@userActions/Session'; +import CONST from '@src/CONST'; +import InitialUrlContext from '@src/InitialUrlContext'; import ONYXKEYS from '@src/ONYXKEYS'; const propTypes = { @@ -33,10 +35,12 @@ const defaultProps = { }; function LogOutPreviousUserPage(props) { + const initUrl = useContext(InitialUrlContext); useEffect(() => { - Linking.getInitialURL().then((transitionURL) => { + Linking.getInitialURL().then((url) => { const sessionEmail = props.session.email; - const isLoggingInAsNewUser = SessionUtils.isLoggingInAsNewUser(transitionURL, sessionEmail); + const transitionUrl = NativeModules.ReactNativeModule ? CONST.DEEPLINK_BASE_URL + initUrl : url; + const isLoggingInAsNewUser = SessionUtils.isLoggingInAsNewUser(transitionUrl, sessionEmail); if (isLoggingInAsNewUser) { Session.signOutAndRedirectToSignIn(); @@ -60,7 +64,7 @@ function LogOutPreviousUserPage(props) { }); } }); - }, [props]); + }, [initUrl, props]); return ; } From cd14eca4326575f36d5b6fb39649fc7f5eae3e61 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 12:28:15 +0100 Subject: [PATCH 002/128] update comment for appjs prop --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index c12f2654b5c9..b88d9b564864 100644 --- a/src/App.js +++ b/src/App.js @@ -33,7 +33,7 @@ import ThemeProvider from './styles/themes/ThemeProvider'; import ThemeStylesProvider from './styles/ThemeStylesProvider'; const propTypes = { - /** If we have an authToken this is true */ + /** Initial url that may be passed as deeplink from Hybrid App */ url: PropTypes.string, }; From a818a6bf212b910869627d85222c537476cada25 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 12:34:13 +0100 Subject: [PATCH 003/128] move InitialUrlContext --- src/App.js | 3 ++- src/{InitialUrlContext.ts => libs/InitialUrlContext/index.ts} | 0 src/libs/Navigation/AppNavigator/index.js | 2 +- src/pages/LogOutPreviousUserPage.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) rename src/{InitialUrlContext.ts => libs/InitialUrlContext/index.ts} (100%) diff --git a/src/App.js b/src/App.js index b88d9b564864..19e9d45a530c 100644 --- a/src/App.js +++ b/src/App.js @@ -23,7 +23,7 @@ import {KeyboardStateProvider} from './components/withKeyboardState'; import {WindowDimensionsProvider} from './components/withWindowDimensions'; import Expensify from './Expensify'; import useDefaultDragAndDrop from './hooks/useDefaultDragAndDrop'; -import InitialUrlContext from './InitialUrlContext'; + import OnyxUpdateManager from './libs/actions/OnyxUpdateManager'; import * as Session from './libs/actions/Session'; import * as Environment from './libs/Environment/Environment'; @@ -31,6 +31,7 @@ import {ReportAttachmentsProvider} from './pages/home/report/ReportAttachmentsCo import ThemeIllustrationsProvider from './styles/illustrations/ThemeIllustrationsProvider'; import ThemeProvider from './styles/themes/ThemeProvider'; import ThemeStylesProvider from './styles/ThemeStylesProvider'; +import InitialUrlContext from './libs/InitialUrlContext'; const propTypes = { /** Initial url that may be passed as deeplink from Hybrid App */ diff --git a/src/InitialUrlContext.ts b/src/libs/InitialUrlContext/index.ts similarity index 100% rename from src/InitialUrlContext.ts rename to src/libs/InitialUrlContext/index.ts diff --git a/src/libs/Navigation/AppNavigator/index.js b/src/libs/Navigation/AppNavigator/index.js index 0a39a0bafeb9..b56e2dcf57e6 100644 --- a/src/libs/Navigation/AppNavigator/index.js +++ b/src/libs/Navigation/AppNavigator/index.js @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import React, {useContext, useEffect} from 'react'; import {NativeModules} from 'react-native'; import Navigation from '@libs/Navigation/Navigation'; -import InitialUrlContext from '@src/InitialUrlContext'; +import InitialUrlContext from '@libs/InitialUrlContext'; const propTypes = { /** If we have an authToken this is true */ diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 81fe480ffcce..e1c18f8211d4 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -8,7 +8,7 @@ import * as SessionUtils from '@libs/SessionUtils'; import Navigation from '@navigation/Navigation'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; -import InitialUrlContext from '@src/InitialUrlContext'; +import InitialUrlContext from '@libs/InitialUrlContext'; import ONYXKEYS from '@src/ONYXKEYS'; const propTypes = { From 0e228ca18b9ec48b9cf9d82c5a1847349e52fa96 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 13:57:12 +0100 Subject: [PATCH 004/128] add short explanation to InitialurlContext --- src/libs/InitialUrlContext/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/InitialUrlContext/index.ts b/src/libs/InitialUrlContext/index.ts index eabf099dafe0..e0593c7cf152 100644 --- a/src/libs/InitialUrlContext/index.ts +++ b/src/libs/InitialUrlContext/index.ts @@ -1,5 +1,6 @@ import {createContext} from 'react'; +// Context to keep the initial url that will be opened when NewDot is embedded into Hybrid App const InitialUrlContext = createContext<{initialUrl: string | null}>({initialUrl: null}); export default InitialUrlContext; From 3ab29cc77597a8263ebe61cb624797f545fc94a4 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 13:58:58 +0100 Subject: [PATCH 005/128] add last lint to async storage patch --- patches/@react-native-async-storage+async-storage+1.17.11.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/@react-native-async-storage+async-storage+1.17.11.patch b/patches/@react-native-async-storage+async-storage+1.17.11.patch index 1c8a139bc10f..4f695d4607b1 100644 --- a/patches/@react-native-async-storage+async-storage+1.17.11.patch +++ b/patches/@react-native-async-storage+async-storage+1.17.11.patch @@ -10,4 +10,4 @@ index ff1baa4..32d8020 100644 + def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.3') def coroutines_version = "1.6.0" def coroutinesTest_version = "1.6.0" - // if we don't provide explicit dependency on reflection, kotlin plugin \ No newline at end of file + // if we don't provide explicit dependency on reflection, kotlin plugin From 7ce52547cc41f913fbb0a1ac8c7cb54ed21172e4 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 13:59:34 +0100 Subject: [PATCH 006/128] remove line from App.js --- src/App.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/App.js b/src/App.js index 19e9d45a530c..db6a41cc11ec 100644 --- a/src/App.js +++ b/src/App.js @@ -23,7 +23,6 @@ import {KeyboardStateProvider} from './components/withKeyboardState'; import {WindowDimensionsProvider} from './components/withWindowDimensions'; import Expensify from './Expensify'; import useDefaultDragAndDrop from './hooks/useDefaultDragAndDrop'; - import OnyxUpdateManager from './libs/actions/OnyxUpdateManager'; import * as Session from './libs/actions/Session'; import * as Environment from './libs/Environment/Environment'; From 4da5437979a32d8a86de13001a49b1cbcc82f607 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 14:00:10 +0100 Subject: [PATCH 007/128] run prettier --- src/App.js | 2 +- src/libs/Navigation/AppNavigator/index.js | 2 +- src/pages/LogOutPreviousUserPage.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index db6a41cc11ec..6f2f61a11061 100644 --- a/src/App.js +++ b/src/App.js @@ -26,11 +26,11 @@ import useDefaultDragAndDrop from './hooks/useDefaultDragAndDrop'; import OnyxUpdateManager from './libs/actions/OnyxUpdateManager'; import * as Session from './libs/actions/Session'; import * as Environment from './libs/Environment/Environment'; +import InitialUrlContext from './libs/InitialUrlContext'; import {ReportAttachmentsProvider} from './pages/home/report/ReportAttachmentsContext'; import ThemeIllustrationsProvider from './styles/illustrations/ThemeIllustrationsProvider'; import ThemeProvider from './styles/themes/ThemeProvider'; import ThemeStylesProvider from './styles/ThemeStylesProvider'; -import InitialUrlContext from './libs/InitialUrlContext'; const propTypes = { /** Initial url that may be passed as deeplink from Hybrid App */ diff --git a/src/libs/Navigation/AppNavigator/index.js b/src/libs/Navigation/AppNavigator/index.js index b56e2dcf57e6..b89f2aa5071e 100644 --- a/src/libs/Navigation/AppNavigator/index.js +++ b/src/libs/Navigation/AppNavigator/index.js @@ -1,8 +1,8 @@ import PropTypes from 'prop-types'; import React, {useContext, useEffect} from 'react'; import {NativeModules} from 'react-native'; -import Navigation from '@libs/Navigation/Navigation'; import InitialUrlContext from '@libs/InitialUrlContext'; +import Navigation from '@libs/Navigation/Navigation'; const propTypes = { /** If we have an authToken this is true */ diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index e1c18f8211d4..77d282611da7 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -4,11 +4,11 @@ import React, {useContext, useEffect} from 'react'; import {Linking, NativeModules} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; +import InitialUrlContext from '@libs/InitialUrlContext'; import * as SessionUtils from '@libs/SessionUtils'; import Navigation from '@navigation/Navigation'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; -import InitialUrlContext from '@libs/InitialUrlContext'; import ONYXKEYS from '@src/ONYXKEYS'; const propTypes = { From d33702c1fe8e0b9afeed6da672a9149c56f27c6c Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 14:09:38 +0100 Subject: [PATCH 008/128] cleanup --- src/libs/InitialUrlContext/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/InitialUrlContext/index.ts b/src/libs/InitialUrlContext/index.ts index e0593c7cf152..432a2f6c583b 100644 --- a/src/libs/InitialUrlContext/index.ts +++ b/src/libs/InitialUrlContext/index.ts @@ -1,6 +1,6 @@ import {createContext} from 'react'; -// Context to keep the initial url that will be opened when NewDot is embedded into Hybrid App -const InitialUrlContext = createContext<{initialUrl: string | null}>({initialUrl: null}); +/** Initial url that will be opened when NewDot is embedded into Hybrid App. */ +const InitialUrlContext = createContext(null); export default InitialUrlContext; From ae2bec1410b98c334ea0164b0448b791e9e5f242 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 15:01:17 +0100 Subject: [PATCH 009/128] improve if statement --- src/libs/Navigation/AppNavigator/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/Navigation/AppNavigator/index.js b/src/libs/Navigation/AppNavigator/index.js index b89f2aa5071e..4cfb24a3f34b 100644 --- a/src/libs/Navigation/AppNavigator/index.js +++ b/src/libs/Navigation/AppNavigator/index.js @@ -13,7 +13,7 @@ function AppNavigator(props) { const initUrl = useContext(InitialUrlContext); useEffect(() => { - if (!NativeModules.ReactNativeModule) { + if (!NativeModules.ReactNativeModule || initUrl === null) { return; } From 7796468797db46f34461490bdbbd90aea0bf71d5 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 15:25:47 +0100 Subject: [PATCH 010/128] rename ReactNativeModule to HybridAppModule --- src/libs/InitialUrlContext/index.ts | 2 +- src/libs/Navigation/AppNavigator/index.js | 2 +- src/pages/LogOutPreviousUserPage.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/InitialUrlContext/index.ts b/src/libs/InitialUrlContext/index.ts index 432a2f6c583b..684af2bb2b60 100644 --- a/src/libs/InitialUrlContext/index.ts +++ b/src/libs/InitialUrlContext/index.ts @@ -1,6 +1,6 @@ import {createContext} from 'react'; /** Initial url that will be opened when NewDot is embedded into Hybrid App. */ -const InitialUrlContext = createContext(null); +const InitialUrlContext = createContext(undefined); export default InitialUrlContext; diff --git a/src/libs/Navigation/AppNavigator/index.js b/src/libs/Navigation/AppNavigator/index.js index 4cfb24a3f34b..5f4958f61f70 100644 --- a/src/libs/Navigation/AppNavigator/index.js +++ b/src/libs/Navigation/AppNavigator/index.js @@ -13,7 +13,7 @@ function AppNavigator(props) { const initUrl = useContext(InitialUrlContext); useEffect(() => { - if (!NativeModules.ReactNativeModule || initUrl === null) { + if (!NativeModules.HybridAppModule || initUrl === undefined) { return; } diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 77d282611da7..36dce86b3be7 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -39,7 +39,7 @@ function LogOutPreviousUserPage(props) { useEffect(() => { Linking.getInitialURL().then((url) => { const sessionEmail = props.session.email; - const transitionUrl = NativeModules.ReactNativeModule ? CONST.DEEPLINK_BASE_URL + initUrl : url; + const transitionUrl = NativeModules.HybridAppModule ? CONST.DEEPLINK_BASE_URL + initUrl : url; const isLoggingInAsNewUser = SessionUtils.isLoggingInAsNewUser(transitionUrl, sessionEmail); if (isLoggingInAsNewUser) { From 405c29bb1b9518ef028fea5f9ef4d07fdad46489 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 5 Dec 2023 17:20:20 +0100 Subject: [PATCH 011/128] update patch for onfido --- patches/@onfido+react-native-sdk+8.3.0.patch | 64 +++++--------------- 1 file changed, 16 insertions(+), 48 deletions(-) diff --git a/patches/@onfido+react-native-sdk+8.3.0.patch b/patches/@onfido+react-native-sdk+8.3.0.patch index 940c40eb9bb0..5d3fd51bf826 100644 --- a/patches/@onfido+react-native-sdk+8.3.0.patch +++ b/patches/@onfido+react-native-sdk+8.3.0.patch @@ -1,8 +1,22 @@ diff --git a/node_modules/@onfido/react-native-sdk/android/build.gradle b/node_modules/@onfido/react-native-sdk/android/build.gradle -index b4c7106..d5083d3 100644 +index b4c7106..c6efb0f 100644 --- a/node_modules/@onfido/react-native-sdk/android/build.gradle +++ b/node_modules/@onfido/react-native-sdk/android/build.gradle -@@ -135,9 +135,9 @@ afterEvaluate { project -> +@@ -84,6 +84,13 @@ android { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } ++ ++ publishing { ++ singleVariant('release') { ++ withSourcesJar() ++ withJavadocJar() ++ } ++ } + } + + repositories { +@@ -135,9 +142,9 @@ afterEvaluate { project -> group = "Reporting" description = "Generate Jacoco coverage reports after running tests." reports { @@ -15,49 +29,3 @@ index b4c7106..d5083d3 100644 } classDirectories.setFrom(fileTree( dir: 'build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/onfido/reactnative/sdk', -diff --git a/node_modules/@onfido/react-native-sdk/android/publish.gradle b/node_modules/@onfido/react-native-sdk/android/publish.gradle -index 216d52d..1f1c17f 100644 ---- a/node_modules/@onfido/react-native-sdk/android/publish.gradle -+++ b/node_modules/@onfido/react-native-sdk/android/publish.gradle -@@ -4,41 +4,5 @@ afterEvaluate { - archiveClassifier = "sources" - } - -- publishing { -- def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) - -- publications { -- mavenJava(MavenPublication) { -- // The new gradle publish plugin doesn't allow the @onfido/ prefix -- artifactId = packageJson.name.replace("@onfido/", "onfido-") -- groupId = 'com.onfido.reactnative.sdk' -- version = packageJson.version -- -- from components.release -- -- artifact sourceJar -- -- pom { -- name = packageJson.title -- description = packageJson.description -- url = packageJson.repository.baseUrl -- -- licenses { -- license { -- name = packageJson.license -- url = packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename -- distribution = 'repo' -- } -- } -- -- developers { -- developer { -- id = packageJson.author.email -- name = packageJson.author.name -- } -- } -- } -- } -- } -- } - } From 486533054bb6aab94d4fe9036dc9c7de59a89961 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 6 Dec 2023 10:08:45 +0100 Subject: [PATCH 012/128] add way to go back to Expensify Classic --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + src/pages/settings/InitialSettingsPage.js | 22 ++++++++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index b03e5d228a55..63cadbe4245f 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -750,6 +750,7 @@ export default { phrase3: 'and', phrase4: 'Privacy', }, + returnToClassic: 'Return to Expensify Classic', help: 'Help', }, closeAccountPage: { diff --git a/src/languages/es.ts b/src/languages/es.ts index c6bc77681b21..63c10d4556e7 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -744,6 +744,7 @@ export default { phrase3: 'y', phrase4: 'Privacidad', }, + returnToClassic: 'Volver a Expensify Clásico', help: 'Ayuda', }, closeAccountPage: { diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index 8ca1f96b3796..0bf34a99b91f 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -1,7 +1,7 @@ import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; -import {View} from 'react-native'; +import {NativeModules, View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import Avatar from '@components/Avatar'; @@ -187,7 +187,7 @@ function InitialSettingsPage(props) { const paymentCardList = props.fundList || {}; - return [ + const defaultMenuItems = [ { translationKey: 'common.shareCode', icon: Expensicons.QrCode, @@ -264,6 +264,24 @@ function InitialSettingsPage(props) { }, }, ]; + + if (NativeModules.HybridAppModule) { + // eslint-disable-next-line rulesdir/prefer-underscore-method + const hybridAppMenuItems = [ + { + translationKey: 'initialSettingsPage.returnToClassic', + icon: Expensicons.RotateLeft, + shouldShowRightIcon: true, + iconRight: Expensicons.NewWindow, + action: () => NativeModules.HybridAppModule.closeReactNativeApp(), + }, + ...defaultMenuItems, + ].filter((item) => item.translationKey !== 'initialSettingsPage.signOut'); + + return hybridAppMenuItems; + } + + return defaultMenuItems; }, [ props.allPolicyMembers, props.bankAccountList, From c75ea5653d2fcd1103ded0955f5c2b9f5996feeb Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 6 Dec 2023 11:27:57 +0100 Subject: [PATCH 013/128] tweak BootSplash to work with Hybrid App --- ios/NewExpensify/RCTBootSplash.h | 1 + ios/NewExpensify/RCTBootSplash.m | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/ios/NewExpensify/RCTBootSplash.h b/ios/NewExpensify/RCTBootSplash.h index df38a5eb35bf..c25c676feb4a 100644 --- a/ios/NewExpensify/RCTBootSplash.h +++ b/ios/NewExpensify/RCTBootSplash.h @@ -10,6 +10,7 @@ @interface RCTBootSplash : NSObject ++ (void)invalidateBootSplash; + (void)initWithStoryboard:(NSString * _Nonnull)storyboardName rootView:(RCTRootView * _Nullable)rootView; diff --git a/ios/NewExpensify/RCTBootSplash.m b/ios/NewExpensify/RCTBootSplash.m index bceac70efdcf..6c2baaed4ee0 100644 --- a/ios/NewExpensify/RCTBootSplash.m +++ b/ios/NewExpensify/RCTBootSplash.m @@ -26,6 +26,12 @@ - (dispatch_queue_t)methodQueue { return dispatch_get_main_queue(); } ++ (void)invalidateBootSplash { + _resolverQueue = nil; + _rootView = nil; + _nativeHidden = false; +} + + (void)initWithStoryboard:(NSString * _Nonnull)storyboardName rootView:(RCTRootView * _Nullable)rootView { if (rootView == nil || _rootView != nil || RCTRunningInAppExtension()) @@ -102,6 +108,9 @@ + (void)onContentDidAppear { block:^(NSTimer * _Nonnull timer) { [timer invalidate]; + if (_rootView == nil) + return; + if (_resolverQueue == nil) _resolverQueue = [[NSMutableArray alloc] init]; From 4dc32d4d6ff6120baa66af9ef0358df12a44ecd1 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 6 Dec 2023 14:06:33 +0100 Subject: [PATCH 014/128] switch to lodash filter --- src/pages/settings/InitialSettingsPage.js | 24 ++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index 0bf34a99b91f..4039768cacf4 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -266,17 +266,19 @@ function InitialSettingsPage(props) { ]; if (NativeModules.HybridAppModule) { - // eslint-disable-next-line rulesdir/prefer-underscore-method - const hybridAppMenuItems = [ - { - translationKey: 'initialSettingsPage.returnToClassic', - icon: Expensicons.RotateLeft, - shouldShowRightIcon: true, - iconRight: Expensicons.NewWindow, - action: () => NativeModules.HybridAppModule.closeReactNativeApp(), - }, - ...defaultMenuItems, - ].filter((item) => item.translationKey !== 'initialSettingsPage.signOut'); + const hybridAppMenuItems = _.filter( + [ + { + translationKey: 'initialSettingsPage.returnToClassic', + icon: Expensicons.RotateLeft, + shouldShowRightIcon: true, + iconRight: Expensicons.NewWindow, + action: () => NativeModules.HybridAppModule.closeReactNativeApp(), + }, + ...defaultMenuItems, + ], + (item) => item.translationKey !== 'initialSettingsPage.signOut', + ); return hybridAppMenuItems; } From b53412c8f2faf1ac7035967438d05822c7363705 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 6 Dec 2023 14:12:18 +0100 Subject: [PATCH 015/128] update InitialUrlContext --- src/libs/InitialUrlContext/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/InitialUrlContext/index.ts b/src/libs/InitialUrlContext/index.ts index 684af2bb2b60..989f3369585f 100644 --- a/src/libs/InitialUrlContext/index.ts +++ b/src/libs/InitialUrlContext/index.ts @@ -1,6 +1,7 @@ import {createContext} from 'react'; +import {Route} from '@src/ROUTES'; /** Initial url that will be opened when NewDot is embedded into Hybrid App. */ -const InitialUrlContext = createContext(undefined); +const InitialUrlContext = createContext(undefined); export default InitialUrlContext; From fd1e6447fa7f5f8cc738617bcc42ee0d9f194c5e Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 7 Dec 2023 15:30:53 +0100 Subject: [PATCH 016/128] upgrade async storage and remove patch --- package-lock.json | 13 ++++++++----- package.json | 2 +- ...native-async-storage+async-storage+1.17.11.patch | 13 ------------- 3 files changed, 9 insertions(+), 19 deletions(-) delete mode 100644 patches/@react-native-async-storage+async-storage+1.17.11.patch diff --git a/package-lock.json b/package-lock.json index 2e78d6b02264..3d879b57220a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@kie/mock-github": "^1.0.0", "@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", "@onfido/react-native-sdk": "8.3.0", - "@react-native-async-storage/async-storage": "^1.17.10", + "@react-native-async-storage/async-storage": "1.21.0", "@react-native-camera-roll/camera-roll": "5.4.0", "@react-native-clipboard/clipboard": "^1.12.1", "@react-native-community/geolocation": "^3.0.6", @@ -6648,13 +6648,14 @@ } }, "node_modules/@react-native-async-storage/async-storage": { - "version": "1.17.11", - "license": "MIT", + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.21.0.tgz", + "integrity": "sha512-JL0w36KuFHFCvnbOXRekqVAUplmOyT/OuCQkogo6X98MtpSaJOKEAeZnYO8JB0U/RIEixZaGI5px73YbRm/oag==", "dependencies": { "merge-options": "^3.0.4" }, "peerDependencies": { - "react-native": "^0.0.0-0 || 0.60 - 0.71 || 1000.0.0" + "react-native": "^0.0.0-0 || >=0.60 <1.0" } }, "node_modules/@react-native-camera-roll/camera-roll": { @@ -57465,7 +57466,9 @@ } }, "@react-native-async-storage/async-storage": { - "version": "1.17.11", + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.21.0.tgz", + "integrity": "sha512-JL0w36KuFHFCvnbOXRekqVAUplmOyT/OuCQkogo6X98MtpSaJOKEAeZnYO8JB0U/RIEixZaGI5px73YbRm/oag==", "requires": { "merge-options": "^3.0.4" } diff --git a/package.json b/package.json index 968bea8c8abf..c876fd441465 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@kie/mock-github": "^1.0.0", "@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52", "@onfido/react-native-sdk": "8.3.0", - "@react-native-async-storage/async-storage": "^1.17.10", + "@react-native-async-storage/async-storage": "1.21.0", "@react-native-camera-roll/camera-roll": "5.4.0", "@react-native-clipboard/clipboard": "^1.12.1", "@react-native-community/geolocation": "^3.0.6", diff --git a/patches/@react-native-async-storage+async-storage+1.17.11.patch b/patches/@react-native-async-storage+async-storage+1.17.11.patch deleted file mode 100644 index 4f695d4607b1..000000000000 --- a/patches/@react-native-async-storage+async-storage+1.17.11.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/@react-native-async-storage/async-storage/android/build.gradle b/node_modules/@react-native-async-storage/async-storage/android/build.gradle -index ff1baa4..32d8020 100644 ---- a/node_modules/@react-native-async-storage/async-storage/android/build.gradle -+++ b/node_modules/@react-native-async-storage/async-storage/android/build.gradle -@@ -112,7 +112,7 @@ repositories { - dependencies { - - if (useNextStorage) { -- def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.2') -+ def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.3') - def coroutines_version = "1.6.0" - def coroutinesTest_version = "1.6.0" - // if we don't provide explicit dependency on reflection, kotlin plugin From 48d422ae495d134a953de5a050d8daf59f21dc45 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 18 Dec 2023 16:21:41 +0700 Subject: [PATCH 017/128] fix: add singleExecution for menu items --- src/components/MenuItemGroup.js | 35 +++++++++++++++++++ .../PersonalDetailsInitialPage.js | 3 ++ 2 files changed, 38 insertions(+) create mode 100644 src/components/MenuItemGroup.js diff --git a/src/components/MenuItemGroup.js b/src/components/MenuItemGroup.js new file mode 100644 index 000000000000..60d27247a45f --- /dev/null +++ b/src/components/MenuItemGroup.js @@ -0,0 +1,35 @@ +import useSingleExecution from '@hooks/useSingleExecution'; +import _ from 'lodash'; +import PropTypes from 'prop-types'; +import React, {Children, cloneElement} from 'react'; + +const propTypes = { + /* Actual content wrapped by this component */ + children: PropTypes.node.isRequired, + + /** Whether or not to use the single execution hook */ + shouldUseSingleExecution: PropTypes.bool, +}; +const defaultProps = { + shouldUseSingleExecution: true +}; + +function MenuItemGroup(props){ + const {isExecuting, singleExecution} = useSingleExecution(); + const arrayChildren = Children.toArray(props.children); + + return <> + {Children.map(arrayChildren, (child, index) => { + return cloneElement(child,{ + ...child.props, + onPress: props.shouldUseSingleExecution ? singleExecution(child.props.onPress) : child.props.onPress + }) + })} + +} + +MenuItemGroup.displayName = 'MenuItemGroup'; +MenuItemGroup.propTypes = propTypes; +MenuItemGroup.defaultProps = defaultProps; + +export default MenuItemGroup; \ No newline at end of file diff --git a/src/pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage.js b/src/pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage.js index cf6887b7e04c..a35ad78836b8 100644 --- a/src/pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage.js +++ b/src/pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage.js @@ -17,6 +17,7 @@ import Navigation from '@libs/Navigation/Navigation'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; +import MenuItemGroup from '@components/MenuItemGroup'; const propTypes = { /* Onyx Props */ @@ -77,6 +78,7 @@ function PersonalDetailsInitialPage(props) { {props.translate('privatePersonalDetails.privateDataMessage')} + Navigation.navigate(ROUTES.SETTINGS_PERSONAL_DETAILS_ADDRESS)} /> + )} From b81373faf01130e8f568e2bc3a63141933b28d78 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 18 Dec 2023 16:32:51 +0700 Subject: [PATCH 018/128] disable when is executing --- src/components/MenuItemGroup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MenuItemGroup.js b/src/components/MenuItemGroup.js index 60d27247a45f..4fe5adf989b6 100644 --- a/src/components/MenuItemGroup.js +++ b/src/components/MenuItemGroup.js @@ -1,5 +1,4 @@ import useSingleExecution from '@hooks/useSingleExecution'; -import _ from 'lodash'; import PropTypes from 'prop-types'; import React, {Children, cloneElement} from 'react'; @@ -22,7 +21,8 @@ function MenuItemGroup(props){ {Children.map(arrayChildren, (child, index) => { return cloneElement(child,{ ...child.props, - onPress: props.shouldUseSingleExecution ? singleExecution(child.props.onPress) : child.props.onPress + onPress: props.shouldUseSingleExecution ? singleExecution(child.props.onPress) : child.props.onPress, + disabled: child.props.disabled || isExecuting }) })} From 4d9d193f09ef42b84d728615b1853993b7474b56 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 5 Jan 2024 16:13:22 +0700 Subject: [PATCH 019/128] set default category for distance request --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index d41442edd670..3ff22ba218ab 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -115,6 +115,15 @@ function IOURequestStepConfirmation({ IOU.setMoneyRequestBillable_temporaryForRefactor(transactionID, defaultBillable); }, [transactionID, defaultBillable]); + const defaultCategory = _.chain(policy) + .get('customUnits') + .find((customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE) + .get('defaultCategory') + .value(); + useEffect(() => { + IOU.setMoneyRequestCategory_temporaryForRefactor(transactionID, defaultCategory); + }, [transactionID, defaultCategory]); + const navigateBack = useCallback(() => { // If there is not a report attached to the IOU with a reportID, then the participants were manually selected and the user needs taken // back to the participants step From 62f1fb19cf7f9c62ed0245876ba6f5551961ed5d Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 5 Jan 2024 16:26:21 +0700 Subject: [PATCH 020/128] use lodashGet instead --- .../iou/request/step/IOURequestStepConfirmation.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index 3ff22ba218ab..27d284eb4965 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -115,11 +115,11 @@ function IOURequestStepConfirmation({ IOU.setMoneyRequestBillable_temporaryForRefactor(transactionID, defaultBillable); }, [transactionID, defaultBillable]); - const defaultCategory = _.chain(policy) - .get('customUnits') - .find((customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE) - .get('defaultCategory') - .value(); + const defaultCategory = lodashGet( + _.find(lodashGet(policy, 'customUnits', {}), (customUnit) => customUnit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE), + 'defaultCategory', + '', + ); useEffect(() => { IOU.setMoneyRequestCategory_temporaryForRefactor(transactionID, defaultCategory); }, [transactionID, defaultCategory]); From c3de7d1faf23f915b781b29eef7e978fe08dd983 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 8 Jan 2024 08:45:39 +0100 Subject: [PATCH 021/128] bump minor of vision camera --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index b10078ee7e6b..4a3b55d65205 100644 --- a/package-lock.json +++ b/package-lock.json @@ -111,7 +111,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", - "react-native-vision-camera": "2.16.5", + "react-native-vision-camera": "2.16.6", "react-native-web": "^0.19.9", "react-native-web-linear-gradient": "^1.1.2", "react-native-webview": "^11.17.2", @@ -47872,9 +47872,9 @@ } }, "node_modules/react-native-vision-camera": { - "version": "2.16.5", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.5.tgz", - "integrity": "sha512-MzXhNd597OyMQSEGhqWI4DufWkdr7PR7U9B30E3gXnln7cnvjMVIp4j3eIW9BIrgvEyUcEeL7nZM5NLhTmO/fA==", + "version": "2.16.6", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.6.tgz", + "integrity": "sha512-rhlRC+yLB1fIB5eVjtnbjgTqNzihFqvoc4B0n+PlytYvHeK3BpD3Shawmy8Me/nBVL5k4Ay+QOd4niFOir+6YQ==", "peerDependencies": { "react": "*", "react-native": "*" @@ -90688,9 +90688,9 @@ "requires": {} }, "react-native-vision-camera": { - "version": "2.16.5", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.5.tgz", - "integrity": "sha512-MzXhNd597OyMQSEGhqWI4DufWkdr7PR7U9B30E3gXnln7cnvjMVIp4j3eIW9BIrgvEyUcEeL7nZM5NLhTmO/fA==", + "version": "2.16.6", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.6.tgz", + "integrity": "sha512-rhlRC+yLB1fIB5eVjtnbjgTqNzihFqvoc4B0n+PlytYvHeK3BpD3Shawmy8Me/nBVL5k4Ay+QOd4niFOir+6YQ==", "requires": {} }, "react-native-web": { diff --git a/package.json b/package.json index 2c25c863f49f..446a815d4f79 100644 --- a/package.json +++ b/package.json @@ -159,7 +159,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", - "react-native-vision-camera": "2.16.5", + "react-native-vision-camera": "2.16.6", "react-native-web": "^0.19.9", "react-native-web-linear-gradient": "^1.1.2", "react-native-webview": "^11.17.2", From a7e9e5aec49d03ba0fb95fad080deadcdd026425 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 8 Jan 2024 15:12:13 +0100 Subject: [PATCH 022/128] add patches and fixes for expo --- package-lock.json | 14 ++-- package.json | 2 +- patches/expo+49.0.21.patch | 32 ++++++++ patches/expo-modules-autolinking+1.5.1.patch | 82 ++++++++++++++++++++ patches/expo-modules-core+1.5.12.patch | 16 ++++ 5 files changed, 138 insertions(+), 8 deletions(-) create mode 100644 patches/expo+49.0.21.patch create mode 100644 patches/expo-modules-autolinking+1.5.1.patch create mode 100644 patches/expo-modules-core+1.5.12.patch diff --git a/package-lock.json b/package-lock.json index 4a3b55d65205..b10078ee7e6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -111,7 +111,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", - "react-native-vision-camera": "2.16.6", + "react-native-vision-camera": "2.16.5", "react-native-web": "^0.19.9", "react-native-web-linear-gradient": "^1.1.2", "react-native-webview": "^11.17.2", @@ -47872,9 +47872,9 @@ } }, "node_modules/react-native-vision-camera": { - "version": "2.16.6", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.6.tgz", - "integrity": "sha512-rhlRC+yLB1fIB5eVjtnbjgTqNzihFqvoc4B0n+PlytYvHeK3BpD3Shawmy8Me/nBVL5k4Ay+QOd4niFOir+6YQ==", + "version": "2.16.5", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.5.tgz", + "integrity": "sha512-MzXhNd597OyMQSEGhqWI4DufWkdr7PR7U9B30E3gXnln7cnvjMVIp4j3eIW9BIrgvEyUcEeL7nZM5NLhTmO/fA==", "peerDependencies": { "react": "*", "react-native": "*" @@ -90688,9 +90688,9 @@ "requires": {} }, "react-native-vision-camera": { - "version": "2.16.6", - "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.6.tgz", - "integrity": "sha512-rhlRC+yLB1fIB5eVjtnbjgTqNzihFqvoc4B0n+PlytYvHeK3BpD3Shawmy8Me/nBVL5k4Ay+QOd4niFOir+6YQ==", + "version": "2.16.5", + "resolved": "https://registry.npmjs.org/react-native-vision-camera/-/react-native-vision-camera-2.16.5.tgz", + "integrity": "sha512-MzXhNd597OyMQSEGhqWI4DufWkdr7PR7U9B30E3gXnln7cnvjMVIp4j3eIW9BIrgvEyUcEeL7nZM5NLhTmO/fA==", "requires": {} }, "react-native-web": { diff --git a/package.json b/package.json index 446a815d4f79..2c25c863f49f 100644 --- a/package.json +++ b/package.json @@ -159,7 +159,7 @@ "react-native-tab-view": "^3.5.2", "react-native-url-polyfill": "^2.0.0", "react-native-view-shot": "^3.6.0", - "react-native-vision-camera": "2.16.6", + "react-native-vision-camera": "2.16.5", "react-native-web": "^0.19.9", "react-native-web-linear-gradient": "^1.1.2", "react-native-webview": "^11.17.2", diff --git a/patches/expo+49.0.21.patch b/patches/expo+49.0.21.patch new file mode 100644 index 000000000000..0e246b301c28 --- /dev/null +++ b/patches/expo+49.0.21.patch @@ -0,0 +1,32 @@ +diff --git a/node_modules/expo/scripts/autolinking.gradle b/node_modules/expo/scripts/autolinking.gradle +index 0505395..08098e0 100644 +--- a/node_modules/expo/scripts/autolinking.gradle ++++ b/node_modules/expo/scripts/autolinking.gradle +@@ -1,2 +1,3 @@ + def autolinkingPath = ["node", "--print", "require.resolve('expo-modules-autolinking/package.json')"].execute(null, rootDir).text.trim() +-apply from: new File(autolinkingPath, "../scripts/android/autolinking_implementation.gradle"); ++ ++apply from: hasProperty("reactNativeProject") ? file('../../expo-modules-autolinking/scripts/android/autolinking_implementation.gradle') : new File(autolinkingPath, "../scripts/android/autolinking_implementation.gradle"); +diff --git a/node_modules/expo/scripts/autolinking.rb b/node_modules/expo/scripts/autolinking.rb +index 0617de5..584364f 100644 +--- a/node_modules/expo/scripts/autolinking.rb ++++ b/node_modules/expo/scripts/autolinking.rb +@@ -2,13 +2,14 @@ require 'json' + require 'pathname' + require 'colored2' # dependency of CocoaPods + +-require File.join(File.dirname(`node --print "require.resolve('expo-modules-autolinking/package.json')"`), "scripts/ios/autolinking_manager") +-require File.join(File.dirname(`node --print "require.resolve('expo-modules-autolinking/package.json')"`), "scripts/ios/xcode_env_generator") +-require File.join(File.dirname(`node --print "require.resolve('expo-modules-autolinking/package.json')"`), "scripts/ios/react_import_patcher") ++AUTOLINKING_PATH = ENV['REACT_NATIVE_DIR'] ? `node --print "require.resolve('#{ENV['REACT_NATIVE_DIR']}/node_modules/expo-modules-autolinking/package.json')"` : `node --print "require.resolve('expo-modules-autolinking/package.json')"` ++ ++require File.join(File.dirname(AUTOLINKING_PATH), "scripts/ios/autolinking_manager") ++require File.join(File.dirname(AUTOLINKING_PATH), "scripts/ios/xcode_env_generator") ++require File.join(File.dirname(AUTOLINKING_PATH), "scripts/ios/react_import_patcher") + + def use_expo_modules!(options = {}) + # When run from the Podfile, `self` points to Pod::Podfile object +- + if @current_target_definition.autolinking_manager.present? + Pod::UI.message 'Expo modules are already being used in this target definition'.red + return diff --git a/patches/expo-modules-autolinking+1.5.1.patch b/patches/expo-modules-autolinking+1.5.1.patch new file mode 100644 index 000000000000..312c1aa8967e --- /dev/null +++ b/patches/expo-modules-autolinking+1.5.1.patch @@ -0,0 +1,82 @@ +diff --git a/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle b/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle +index 5f4cd8e..bdbea02 100644 +--- a/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle ++++ b/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle +@@ -135,6 +135,7 @@ class ExpoAutolinkingManager { + } + + static String exec(String[] commandArgs, File dir) { ++ print(dir) + Process proc = commandArgs.execute(null, dir) + StringBuffer outputStream = new StringBuffer() + proc.waitForProcessOutput(outputStream, System.err) +@@ -142,11 +143,12 @@ class ExpoAutolinkingManager { + } + + static private String[] convertOptionsToCommandArgs(String command, Map options) { ++ def expoModulesPath = options.searchPaths ? "../react-native/node_modules/expo-modules-autolinking" : "expo-modules-autolinking" + String[] args = [ + 'node', + '--no-warnings', + '--eval', +- 'require(\'expo-modules-autolinking\')(process.argv.slice(1))', ++ "require(\'${expoModulesPath}\')(process.argv.slice(1))", + '--', + command, + '--platform', +diff --git a/node_modules/expo-modules-autolinking/scripts/ios/autolinking_manager.rb b/node_modules/expo-modules-autolinking/scripts/ios/autolinking_manager.rb +index d570ad2..b9c5350 100644 +--- a/node_modules/expo-modules-autolinking/scripts/ios/autolinking_manager.rb ++++ b/node_modules/expo-modules-autolinking/scripts/ios/autolinking_manager.rb +@@ -26,7 +26,6 @@ module Expo + if has_packages? + return + end +- + global_flags = @options.fetch(:flags, {}) + tests_only = @options.fetch(:testsOnly, false) + include_tests = @options.fetch(:includeTests, false) +@@ -174,11 +173,12 @@ module Expo + end + + private def node_command_args(command_name) ++ autolinking_path = ENV['REACT_NATIVE_DIR'] ? "#{ENV['REACT_NATIVE_DIR']}/node_modules/expo-modules-autolinking" : "expo-modules-autolinking" + eval_command_args = [ + 'node', + '--no-warnings', + '--eval', +- 'require(\'expo-modules-autolinking\')(process.argv.slice(1))', ++ "require(\'#{autolinking_path}\')(process.argv.slice(1))", + command_name, + '--platform', + 'ios' +diff --git a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb +index bddfa0d..3ae2c6c 100644 +--- a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb ++++ b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb +@@ -213,6 +213,7 @@ module Expo + # Generates the support script that is executed by the build script phase. + def self.generate_support_script(autolinking_manager, modules_provider_path) + args = autolinking_manager.base_command_args.map { |arg| "\"#{arg}\"" }.join(' ') ++ autolinking_path = ENV['REACT_NATIVE_DIR'] ? "#{ENV['REACT_NATIVE_DIR']}/node_modules/expo-modules-autolinking" : "expo-modules-autolinking" + + <<~SUPPORT_SCRIPT + #!/usr/bin/env bash +@@ -245,7 +246,6 @@ module Expo + You can set this up quickly by running: + + echo "export NODE_BINARY=\\$(command -v node)" >> .xcode.env +- + in the ios folder of your project. + NODE_NOT_FOUND + +@@ -257,8 +257,7 @@ module Expo + "$NODE_BINARY" "$@" + fi + } +- +- with_node --no-warnings --eval "require(\'expo-modules-autolinking\')(process.argv.slice(1))" generate-package-list #{args} --target "#{modules_provider_path}" ++ with_node --no-warnings --eval "require(\'#{autolinking_path}\')(process.argv.slice(1))" generate-package-list #{args} --target "#{modules_provider_path}" + SUPPORT_SCRIPT + end + diff --git a/patches/expo-modules-core+1.5.12.patch b/patches/expo-modules-core+1.5.12.patch new file mode 100644 index 000000000000..93383f04440c --- /dev/null +++ b/patches/expo-modules-core+1.5.12.patch @@ -0,0 +1,16 @@ +diff --git a/node_modules/expo-modules-core/android/build.gradle b/node_modules/expo-modules-core/android/build.gradle +index 8f9e0dc..539a201 100644 +--- a/node_modules/expo-modules-core/android/build.gradle ++++ b/node_modules/expo-modules-core/android/build.gradle +@@ -54,9 +54,10 @@ def downloadsDir = customDownloadsDir ? new File(customDownloadsDir) : new File( + def thirdPartyNdkDir = new File("$buildDir/third-party-ndk") + + def REACT_NATIVE_BUILD_FROM_SOURCE = findProject(":packages:react-native:ReactAndroid") != null ++def FALLBACK_REACT_NATIVE_DIR = ext.has("customRNProjectPath") ? ext.customRNProjectPath : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent) + def REACT_NATIVE_DIR = REACT_NATIVE_BUILD_FROM_SOURCE + ? findProject(":packages:react-native:ReactAndroid").getProjectDir().parent +- : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent ++ : FALLBACK_REACT_NATIVE_DIR + def REACT_NATIVE_SO_DIR = REACT_NATIVE_BUILD_FROM_SOURCE + ? Paths.get(findProject(":packages:react-native:ReactAndroid").getProjectDir().toString(), "build", "intermediates", "library_*", "*", "jni") + : "${buildDir}/react/jni" From d17163a1b7e019dc292aff09f3aacae255cd0045 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 8 Jan 2024 15:18:49 +0100 Subject: [PATCH 023/128] one more fix --- patches/expo-modules-autolinking+1.5.1.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/patches/expo-modules-autolinking+1.5.1.patch b/patches/expo-modules-autolinking+1.5.1.patch index 312c1aa8967e..20fed8608ebd 100644 --- a/patches/expo-modules-autolinking+1.5.1.patch +++ b/patches/expo-modules-autolinking+1.5.1.patch @@ -80,3 +80,21 @@ index bddfa0d..3ae2c6c 100644 SUPPORT_SCRIPT end +diff --git a/node_modules/expo-modules-autolinking/scripts/ios/react_import_patcher.rb b/node_modules/expo-modules-autolinking/scripts/ios/react_import_patcher.rb +index 4acf193..b54ea94 100644 +--- a/node_modules/expo-modules-autolinking/scripts/ios/react_import_patcher.rb ++++ b/node_modules/expo-modules-autolinking/scripts/ios/react_import_patcher.rb +@@ -10,11 +10,12 @@ module Expo + end + + public def run! ++ autolinking_path = ENV['REACT_NATIVE_DIR'] ? "#{ENV['REACT_NATIVE_DIR']}/node_modules/expo-modules-autolinking" : "expo-modules-autolinking" + args = [ + 'node', + '--no-warnings', + '--eval', +- 'require(\'expo-modules-autolinking\')(process.argv.slice(1))', ++ "require(\'#{autolinking_path}\')(process.argv.slice(1))", + 'patch-react-imports', + '--pods-root', + File.expand_path(@root), From 1c1fa2638917145e489f91ea80571b294a0e78df Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 10 Jan 2024 10:58:13 +0100 Subject: [PATCH 024/128] fix patch --- patches/expo-modules-core+1.5.12.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/expo-modules-core+1.5.12.patch b/patches/expo-modules-core+1.5.12.patch index 93383f04440c..9025a7c42d9f 100644 --- a/patches/expo-modules-core+1.5.12.patch +++ b/patches/expo-modules-core+1.5.12.patch @@ -1,12 +1,12 @@ diff --git a/node_modules/expo-modules-core/android/build.gradle b/node_modules/expo-modules-core/android/build.gradle -index 8f9e0dc..539a201 100644 +index 8f9e0dc..af5b5d6 100644 --- a/node_modules/expo-modules-core/android/build.gradle +++ b/node_modules/expo-modules-core/android/build.gradle @@ -54,9 +54,10 @@ def downloadsDir = customDownloadsDir ? new File(customDownloadsDir) : new File( def thirdPartyNdkDir = new File("$buildDir/third-party-ndk") def REACT_NATIVE_BUILD_FROM_SOURCE = findProject(":packages:react-native:ReactAndroid") != null -+def FALLBACK_REACT_NATIVE_DIR = ext.has("customRNProjectPath") ? ext.customRNProjectPath : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent) ++def FALLBACK_REACT_NATIVE_DIR = hasProperty("reactNativeProject") ? file('../../react-native') : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent def REACT_NATIVE_DIR = REACT_NATIVE_BUILD_FROM_SOURCE ? findProject(":packages:react-native:ReactAndroid").getProjectDir().parent - : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent From 812dd2f2c6df21ecaf123eb06f45e64048b037b4 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 11 Jan 2024 09:55:47 +0100 Subject: [PATCH 025/128] update commend --- android/app/src/main/res/values/colors.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml index b4d8c2181b0b..8d5bfbf4eed7 100644 --- a/android/app/src/main/res/values/colors.xml +++ b/android/app/src/main/res/values/colors.xml @@ -1,4 +1,5 @@ + #03D47C #FFFFFF #03D47C From 402e85f1786e4b64766d0c060b26531d5387024f Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 11 Jan 2024 10:00:30 +0100 Subject: [PATCH 026/128] add quick fix for nav --- src/pages/LogOutPreviousUserPage.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 3ed803cb0b32..a1f5ed035763 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -64,6 +64,8 @@ function LogOutPreviousUserPage(props) { // which is already called when AuthScreens mounts. if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) { Navigation.isNavigationReady().then(() => { + // temporary until finding clean solution + Navigation.goBack(); Navigation.navigate(exitTo); }); } From e2173e13a89785f7250bf7b975b363b11304efbf Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 16 Jan 2024 10:28:58 +0100 Subject: [PATCH 027/128] apply changes to work with rn 73 --- ...mmunity+cli-platform-android+12.3.0.patch} | 34 +++--- ...ve-community+cli-platform-ios+11.3.6.patch | 51 --------- patches/expo+49.0.21.patch | 32 ------ patches/expo+50.0.0-preview.7.patch | 10 ++ patches/expo-modules-autolinking+1.5.1.patch | 100 ------------------ patches/expo-modules-autolinking+1.9.0.patch | 21 ++++ ...2.patch => expo-modules-core+1.11.4.patch} | 12 +-- ...era+2.16.5+001+fix-boost-dependency.patch} | 13 ++- src/pages/LogOutPreviousUserPage.js | 18 +++- 9 files changed, 78 insertions(+), 213 deletions(-) rename patches/{@react-native-community+cli-platform-android+11.3.6.patch => @react-native-community+cli-platform-android+12.3.0.patch} (68%) delete mode 100644 patches/@react-native-community+cli-platform-ios+11.3.6.patch delete mode 100644 patches/expo+49.0.21.patch create mode 100644 patches/expo+50.0.0-preview.7.patch delete mode 100644 patches/expo-modules-autolinking+1.5.1.patch create mode 100644 patches/expo-modules-autolinking+1.9.0.patch rename patches/{expo-modules-core+1.5.12.patch => expo-modules-core+1.11.4.patch} (66%) rename patches/{react-native-vision-camera+2.16.2+001+fix-boost-dependency.patch => react-native-vision-camera+2.16.5+001+fix-boost-dependency.patch} (56%) diff --git a/patches/@react-native-community+cli-platform-android+11.3.6.patch b/patches/@react-native-community+cli-platform-android+12.3.0.patch similarity index 68% rename from patches/@react-native-community+cli-platform-android+11.3.6.patch rename to patches/@react-native-community+cli-platform-android+12.3.0.patch index ddebb53db36d..b6805a4fd93e 100644 --- a/patches/@react-native-community+cli-platform-android+11.3.6.patch +++ b/patches/@react-native-community+cli-platform-android+12.3.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle -index 8a218d5..8deb9c0 100644 +index bbfa7f7..6e024fd 100644 --- a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle +++ b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle @@ -140,6 +140,7 @@ class ReactNativeModules { @@ -10,25 +10,24 @@ index 8a218d5..8deb9c0 100644 private ArrayList> reactNativeModules private ArrayList unstable_reactLegacyComponentNames private HashMap reactNativeModulesBuildVariants -@@ -147,8 +148,13 @@ class ReactNativeModules { +@@ -147,9 +148,10 @@ class ReactNativeModules { + private static String LOG_PREFIX = ":ReactNative:" - ReactNativeModules(Logger logger, File root) { -+ this(logger, root, root) -+ } -+ +- ReactNativeModules(Logger logger, File root) { + ReactNativeModules(Logger logger, File root, File rnRoot) { this.logger = logger this.root = root + this.rnRoot = rnRoot - def (nativeModules, reactNativeModulesBuildVariants, androidProject) = this.getReactNativeConfig() + def (nativeModules, reactNativeModulesBuildVariants, androidProject, reactNativeVersion) = this.getReactNativeConfig() this.reactNativeModules = nativeModules -@@ -413,11 +419,12 @@ class ReactNativeModules { +@@ -414,12 +416,12 @@ class ReactNativeModules { + * * @todo: `fastlane` has been reported to not work too. */ - def cliResolveScript = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" -+ +- def cliResolveScript = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" ++ def cliResolveScript = "try {console.log(require('../react-native/node_modules/@react-native-community/cli').bin);} catch (e) {console.log(require('../react-native/node_modules/react-native/cli').bin);}" String[] nodeCommand = ["node", "-e", cliResolveScript] - def cliPath = this.getCommandOutput(nodeCommand, this.root) + def cliPath = this.getCommandOutput(nodeCommand, this.rnRoot) @@ -39,19 +38,18 @@ index 8a218d5..8deb9c0 100644 def json try { -@@ -482,8 +489,14 @@ class ReactNativeModules { - * where build files of an active project are located. +@@ -486,7 +488,13 @@ class ReactNativeModules { */ def projectRoot = rootProject.projectDir + +-def autoModules = new ReactNativeModules(logger, projectRoot) +def autoModules + +if(this.hasProperty('reactNativeProject')){ -+ autoModules = new ReactNativeModules(logger, projectRoot, new File(projectRoot, reactNativeProject)) ++ autoModules = new ReactNativeModules(logger, projectRoot, new File(projectRoot, reactNativeProject)) +} else { -+ autoModules = new ReactNativeModules(logger, projectRoot) ++ autoModules = new ReactNativeModules(logger, projectRoot) +} --def autoModules = new ReactNativeModules(logger, projectRoot) - - /** ----------------------- - * Exported Extensions + def reactNativeVersionRequireNewArchEnabled(autoModules) { + def rnVersion = autoModules.reactNativeVersion diff --git a/patches/@react-native-community+cli-platform-ios+11.3.6.patch b/patches/@react-native-community+cli-platform-ios+11.3.6.patch deleted file mode 100644 index 9c97b8666ef2..000000000000 --- a/patches/@react-native-community+cli-platform-ios+11.3.6.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb -index 1b6eece..914039e 100644 ---- a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb -+++ b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb -@@ -12,7 +12,7 @@ - require 'pathname' - require 'cocoapods' - --def use_native_modules!(config = nil) -+def updateConfig(config = nil) - if (config.is_a? String) - Pod::UI.warn("Passing custom root to use_native_modules! is deprecated.", - [ -@@ -24,7 +24,6 @@ def use_native_modules!(config = nil) - # Resolving the path the RN CLI. The `@react-native-community/cli` module may not be there for certain package managers, so we fall back to resolving it through `react-native` package, that's always present in RN projects - cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" - cli_bin = Pod::Executable.execute_command("node", ["-e", cli_resolve_script], true).strip -- - if (!config) - json = [] - -@@ -36,10 +35,29 @@ def use_native_modules!(config = nil) - - config = JSON.parse(json.join("\n")) - end -+end -+ -+def use_native_modules!(config = nil) -+ if (ENV['REACT_NATIVE_DIR']) -+ Dir.chdir(ENV['REACT_NATIVE_DIR']) do -+ config = updateConfig(config) -+ end -+ else -+ config = updateConfig(config) -+ end - - project_root = Pathname.new(config["project"]["ios"]["sourceDir"]) -+ if(ENV["PROJECT_ROOT_DIR"]) -+ project_root = File.join(Dir.pwd, ENV["PROJECT_ROOT_DIR"]) -+ -+ end - - packages = config["dependencies"] -+ -+ if (ENV["NO_FLIPPER"]) -+ packages["react-native-flipper"]["platforms"]["ios"] = nil -+ end -+ - found_pods = [] - - packages.each do |package_name, package| diff --git a/patches/expo+49.0.21.patch b/patches/expo+49.0.21.patch deleted file mode 100644 index 0e246b301c28..000000000000 --- a/patches/expo+49.0.21.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/node_modules/expo/scripts/autolinking.gradle b/node_modules/expo/scripts/autolinking.gradle -index 0505395..08098e0 100644 ---- a/node_modules/expo/scripts/autolinking.gradle -+++ b/node_modules/expo/scripts/autolinking.gradle -@@ -1,2 +1,3 @@ - def autolinkingPath = ["node", "--print", "require.resolve('expo-modules-autolinking/package.json')"].execute(null, rootDir).text.trim() --apply from: new File(autolinkingPath, "../scripts/android/autolinking_implementation.gradle"); -+ -+apply from: hasProperty("reactNativeProject") ? file('../../expo-modules-autolinking/scripts/android/autolinking_implementation.gradle') : new File(autolinkingPath, "../scripts/android/autolinking_implementation.gradle"); -diff --git a/node_modules/expo/scripts/autolinking.rb b/node_modules/expo/scripts/autolinking.rb -index 0617de5..584364f 100644 ---- a/node_modules/expo/scripts/autolinking.rb -+++ b/node_modules/expo/scripts/autolinking.rb -@@ -2,13 +2,14 @@ require 'json' - require 'pathname' - require 'colored2' # dependency of CocoaPods - --require File.join(File.dirname(`node --print "require.resolve('expo-modules-autolinking/package.json')"`), "scripts/ios/autolinking_manager") --require File.join(File.dirname(`node --print "require.resolve('expo-modules-autolinking/package.json')"`), "scripts/ios/xcode_env_generator") --require File.join(File.dirname(`node --print "require.resolve('expo-modules-autolinking/package.json')"`), "scripts/ios/react_import_patcher") -+AUTOLINKING_PATH = ENV['REACT_NATIVE_DIR'] ? `node --print "require.resolve('#{ENV['REACT_NATIVE_DIR']}/node_modules/expo-modules-autolinking/package.json')"` : `node --print "require.resolve('expo-modules-autolinking/package.json')"` -+ -+require File.join(File.dirname(AUTOLINKING_PATH), "scripts/ios/autolinking_manager") -+require File.join(File.dirname(AUTOLINKING_PATH), "scripts/ios/xcode_env_generator") -+require File.join(File.dirname(AUTOLINKING_PATH), "scripts/ios/react_import_patcher") - - def use_expo_modules!(options = {}) - # When run from the Podfile, `self` points to Pod::Podfile object -- - if @current_target_definition.autolinking_manager.present? - Pod::UI.message 'Expo modules are already being used in this target definition'.red - return diff --git a/patches/expo+50.0.0-preview.7.patch b/patches/expo+50.0.0-preview.7.patch new file mode 100644 index 000000000000..95157e1d73c6 --- /dev/null +++ b/patches/expo+50.0.0-preview.7.patch @@ -0,0 +1,10 @@ +diff --git a/node_modules/expo/scripts/autolinking.gradle b/node_modules/expo/scripts/autolinking.gradle +index 60d6ef8..3ed90a4 100644 +--- a/node_modules/expo/scripts/autolinking.gradle ++++ b/node_modules/expo/scripts/autolinking.gradle +@@ -1,4 +1,4 @@ + // Resolve `expo` > `expo-modules-autolinking` dependency chain + def autolinkingPath = ["node", "--print", "require.resolve('expo-modules-autolinking/package.json', { paths: [require.resolve('expo/package.json')] })"].execute(null, rootDir).text.trim() +-apply from: new File(autolinkingPath, "../scripts/android/autolinking_implementation.gradle"); + ++apply from: hasProperty("reactNativeProject") ? file('../../expo-modules-autolinking/scripts/android/autolinking_implementation.gradle') : new File(autolinkingPath, "../scripts/android/autolinking_implementation.gradle"); diff --git a/patches/expo-modules-autolinking+1.5.1.patch b/patches/expo-modules-autolinking+1.5.1.patch deleted file mode 100644 index 20fed8608ebd..000000000000 --- a/patches/expo-modules-autolinking+1.5.1.patch +++ /dev/null @@ -1,100 +0,0 @@ -diff --git a/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle b/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle -index 5f4cd8e..bdbea02 100644 ---- a/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle -+++ b/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle -@@ -135,6 +135,7 @@ class ExpoAutolinkingManager { - } - - static String exec(String[] commandArgs, File dir) { -+ print(dir) - Process proc = commandArgs.execute(null, dir) - StringBuffer outputStream = new StringBuffer() - proc.waitForProcessOutput(outputStream, System.err) -@@ -142,11 +143,12 @@ class ExpoAutolinkingManager { - } - - static private String[] convertOptionsToCommandArgs(String command, Map options) { -+ def expoModulesPath = options.searchPaths ? "../react-native/node_modules/expo-modules-autolinking" : "expo-modules-autolinking" - String[] args = [ - 'node', - '--no-warnings', - '--eval', -- 'require(\'expo-modules-autolinking\')(process.argv.slice(1))', -+ "require(\'${expoModulesPath}\')(process.argv.slice(1))", - '--', - command, - '--platform', -diff --git a/node_modules/expo-modules-autolinking/scripts/ios/autolinking_manager.rb b/node_modules/expo-modules-autolinking/scripts/ios/autolinking_manager.rb -index d570ad2..b9c5350 100644 ---- a/node_modules/expo-modules-autolinking/scripts/ios/autolinking_manager.rb -+++ b/node_modules/expo-modules-autolinking/scripts/ios/autolinking_manager.rb -@@ -26,7 +26,6 @@ module Expo - if has_packages? - return - end -- - global_flags = @options.fetch(:flags, {}) - tests_only = @options.fetch(:testsOnly, false) - include_tests = @options.fetch(:includeTests, false) -@@ -174,11 +173,12 @@ module Expo - end - - private def node_command_args(command_name) -+ autolinking_path = ENV['REACT_NATIVE_DIR'] ? "#{ENV['REACT_NATIVE_DIR']}/node_modules/expo-modules-autolinking" : "expo-modules-autolinking" - eval_command_args = [ - 'node', - '--no-warnings', - '--eval', -- 'require(\'expo-modules-autolinking\')(process.argv.slice(1))', -+ "require(\'#{autolinking_path}\')(process.argv.slice(1))", - command_name, - '--platform', - 'ios' -diff --git a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb -index bddfa0d..3ae2c6c 100644 ---- a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb -+++ b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb -@@ -213,6 +213,7 @@ module Expo - # Generates the support script that is executed by the build script phase. - def self.generate_support_script(autolinking_manager, modules_provider_path) - args = autolinking_manager.base_command_args.map { |arg| "\"#{arg}\"" }.join(' ') -+ autolinking_path = ENV['REACT_NATIVE_DIR'] ? "#{ENV['REACT_NATIVE_DIR']}/node_modules/expo-modules-autolinking" : "expo-modules-autolinking" - - <<~SUPPORT_SCRIPT - #!/usr/bin/env bash -@@ -245,7 +246,6 @@ module Expo - You can set this up quickly by running: - - echo "export NODE_BINARY=\\$(command -v node)" >> .xcode.env -- - in the ios folder of your project. - NODE_NOT_FOUND - -@@ -257,8 +257,7 @@ module Expo - "$NODE_BINARY" "$@" - fi - } -- -- with_node --no-warnings --eval "require(\'expo-modules-autolinking\')(process.argv.slice(1))" generate-package-list #{args} --target "#{modules_provider_path}" -+ with_node --no-warnings --eval "require(\'#{autolinking_path}\')(process.argv.slice(1))" generate-package-list #{args} --target "#{modules_provider_path}" - SUPPORT_SCRIPT - end - -diff --git a/node_modules/expo-modules-autolinking/scripts/ios/react_import_patcher.rb b/node_modules/expo-modules-autolinking/scripts/ios/react_import_patcher.rb -index 4acf193..b54ea94 100644 ---- a/node_modules/expo-modules-autolinking/scripts/ios/react_import_patcher.rb -+++ b/node_modules/expo-modules-autolinking/scripts/ios/react_import_patcher.rb -@@ -10,11 +10,12 @@ module Expo - end - - public def run! -+ autolinking_path = ENV['REACT_NATIVE_DIR'] ? "#{ENV['REACT_NATIVE_DIR']}/node_modules/expo-modules-autolinking" : "expo-modules-autolinking" - args = [ - 'node', - '--no-warnings', - '--eval', -- 'require(\'expo-modules-autolinking\')(process.argv.slice(1))', -+ "require(\'#{autolinking_path}\')(process.argv.slice(1))", - 'patch-react-imports', - '--pods-root', - File.expand_path(@root), diff --git a/patches/expo-modules-autolinking+1.9.0.patch b/patches/expo-modules-autolinking+1.9.0.patch new file mode 100644 index 000000000000..363dd5dc3dab --- /dev/null +++ b/patches/expo-modules-autolinking+1.9.0.patch @@ -0,0 +1,21 @@ +diff --git a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb +index c3047a8..6eff107 100644 +--- a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb ++++ b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb +@@ -212,6 +212,7 @@ module Expo + + # Generates the support script that is executed by the build script phase. + def self.generate_support_script(autolinking_manager, modules_provider_path) ++ expo_path = ENV['REACT_NATIVE_DIR'] ? "#{ENV['REACT_NATIVE_DIR']}/node_modules/expo" : "expo" + args = autolinking_manager.base_command_args.map { |arg| "\"#{arg}\"" }.join(' ') + + <<~SUPPORT_SCRIPT +@@ -258,7 +259,7 @@ module Expo + fi + } + +- with_node --no-warnings --eval "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))" generate-package-list #{args} --target "#{modules_provider_path}" ++ with_node --no-warnings --eval "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'#{expo_path}/package.json\')] }))(process.argv.slice(1))" generate-package-list #{args} --target "#{modules_provider_path}" + SUPPORT_SCRIPT + end + diff --git a/patches/expo-modules-core+1.5.12.patch b/patches/expo-modules-core+1.11.4.patch similarity index 66% rename from patches/expo-modules-core+1.5.12.patch rename to patches/expo-modules-core+1.11.4.patch index 9025a7c42d9f..fe8c5ed7b9cc 100644 --- a/patches/expo-modules-core+1.5.12.patch +++ b/patches/expo-modules-core+1.11.4.patch @@ -1,9 +1,9 @@ diff --git a/node_modules/expo-modules-core/android/build.gradle b/node_modules/expo-modules-core/android/build.gradle -index 8f9e0dc..af5b5d6 100644 +index 3603ffd..1599a69 100644 --- a/node_modules/expo-modules-core/android/build.gradle +++ b/node_modules/expo-modules-core/android/build.gradle -@@ -54,9 +54,10 @@ def downloadsDir = customDownloadsDir ? new File(customDownloadsDir) : new File( - def thirdPartyNdkDir = new File("$buildDir/third-party-ndk") +@@ -53,9 +53,10 @@ def isExpoModulesCoreTests = { + }.call() def REACT_NATIVE_BUILD_FROM_SOURCE = findProject(":packages:react-native:ReactAndroid") != null +def FALLBACK_REACT_NATIVE_DIR = hasProperty("reactNativeProject") ? file('../../react-native') : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent @@ -11,6 +11,6 @@ index 8f9e0dc..af5b5d6 100644 ? findProject(":packages:react-native:ReactAndroid").getProjectDir().parent - : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent + : FALLBACK_REACT_NATIVE_DIR - def REACT_NATIVE_SO_DIR = REACT_NATIVE_BUILD_FROM_SOURCE - ? Paths.get(findProject(":packages:react-native:ReactAndroid").getProjectDir().toString(), "build", "intermediates", "library_*", "*", "jni") - : "${buildDir}/react/jni" + + def reactProperties = new Properties() + file("$REACT_NATIVE_DIR/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) } diff --git a/patches/react-native-vision-camera+2.16.2+001+fix-boost-dependency.patch b/patches/react-native-vision-camera+2.16.5+001+fix-boost-dependency.patch similarity index 56% rename from patches/react-native-vision-camera+2.16.2+001+fix-boost-dependency.patch rename to patches/react-native-vision-camera+2.16.5+001+fix-boost-dependency.patch index ef4fbf1d5084..3afc4573985d 100644 --- a/patches/react-native-vision-camera+2.16.2+001+fix-boost-dependency.patch +++ b/patches/react-native-vision-camera+2.16.5+001+fix-boost-dependency.patch @@ -1,8 +1,17 @@ diff --git a/node_modules/react-native-vision-camera/android/build.gradle b/node_modules/react-native-vision-camera/android/build.gradle -index d308e15..2d87d8e 100644 +index ddfa243..bafffc3 100644 --- a/node_modules/react-native-vision-camera/android/build.gradle +++ b/node_modules/react-native-vision-camera/android/build.gradle -@@ -347,7 +347,7 @@ if (ENABLE_FRAME_PROCESSORS) { +@@ -334,7 +334,7 @@ if (ENABLE_FRAME_PROCESSORS) { + def thirdPartyVersions = new Properties() + thirdPartyVersions.load(new FileInputStream(thirdPartyVersionsFile)) + +- def BOOST_VERSION = thirdPartyVersions["BOOST_VERSION"] ++ def BOOST_VERSION = thirdPartyVersions["BOOST_VERSION"] ?: "1.83.0" + def boost_file = new File(downloadsDir, "boost_${BOOST_VERSION}.tar.gz") + def DOUBLE_CONVERSION_VERSION = thirdPartyVersions["DOUBLE_CONVERSION_VERSION"] + def double_conversion_file = new File(downloadsDir, "double-conversion-${DOUBLE_CONVERSION_VERSION}.tar.gz") +@@ -352,7 +352,7 @@ if (ENABLE_FRAME_PROCESSORS) { task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) { def transformedVersion = BOOST_VERSION.replace("_", ".") diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 32a98fa47a65..156e01be6ec6 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -9,6 +9,8 @@ import * as SessionUtils from '@libs/SessionUtils'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; +import ROUTES from '@src/ROUTES'; +import Navigation from '@libs/Navigation/Navigation'; const propTypes = { /** The details about the account that the user is signing in with */ @@ -59,11 +61,19 @@ function LogOutPreviousUserPage(props) { const shortLivedAuthToken = lodashGet(props, 'route.params.shortLivedAuthToken', ''); Session.signInWithShortLivedAuthToken(email, shortLivedAuthToken); } - }); - // We only want to run this effect once on mount (when the page first loads after transitioning from OldDot) - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [initUrl]); + const exitTo = lodashGet(props, 'route.params.exitTo', ''); + // We don't want to navigate to the exitTo route when creating a new workspace from a deep link, + // because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate, + // which is already called when AuthScreens mounts. + if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) { + Navigation.isNavigationReady().then(() => { + Navigation.goBack(); + Navigation.navigate(exitTo); + }); + } + }); + }, [initUrl, props]); return ; } From fcae238b58cffc976cceafa20ddcaa00aeddcf9c Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 16 Jan 2024 10:38:38 +0100 Subject: [PATCH 028/128] fix nav --- src/pages/LogOutPreviousUserPage.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 156e01be6ec6..a69403d8c916 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -68,8 +68,7 @@ function LogOutPreviousUserPage(props) { // which is already called when AuthScreens mounts. if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) { Navigation.isNavigationReady().then(() => { - Navigation.goBack(); - Navigation.navigate(exitTo); + Navigation.navigate(exitTo, "FORCED_UP"); }); } }); From 6f91c905b1a12495f8a16eca8190dde7f2f3cb8d Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 16 Jan 2024 10:44:35 +0100 Subject: [PATCH 029/128] fix lint type --- src/libs/InitialUrlContext/index.ts | 2 +- src/pages/LogOutPreviousUserPage.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/InitialUrlContext/index.ts b/src/libs/InitialUrlContext/index.ts index 989f3369585f..a87417fe4cc6 100644 --- a/src/libs/InitialUrlContext/index.ts +++ b/src/libs/InitialUrlContext/index.ts @@ -1,5 +1,5 @@ import {createContext} from 'react'; -import {Route} from '@src/ROUTES'; +import type {Route} from '@src/ROUTES'; /** Initial url that will be opened when NewDot is embedded into Hybrid App. */ const InitialUrlContext = createContext(undefined); diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index a69403d8c916..5efe9926e270 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -5,12 +5,12 @@ import {Linking, NativeModules} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import InitialUrlContext from '@libs/InitialUrlContext'; +import Navigation from '@libs/Navigation/Navigation'; import * as SessionUtils from '@libs/SessionUtils'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import Navigation from '@libs/Navigation/Navigation'; const propTypes = { /** The details about the account that the user is signing in with */ @@ -68,7 +68,7 @@ function LogOutPreviousUserPage(props) { // which is already called when AuthScreens mounts. if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) { Navigation.isNavigationReady().then(() => { - Navigation.navigate(exitTo, "FORCED_UP"); + Navigation.navigate(exitTo, 'FORCED_UP'); }); } }); From f6d681cb66cf6df5dbc1fbe068b67b0b5e21c14a Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 16 Jan 2024 11:06:27 +0100 Subject: [PATCH 030/128] fix nav --- src/pages/LogOutPreviousUserPage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 5efe9926e270..801e8352e8e1 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -68,7 +68,9 @@ function LogOutPreviousUserPage(props) { // which is already called when AuthScreens mounts. if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) { Navigation.isNavigationReady().then(() => { - Navigation.navigate(exitTo, 'FORCED_UP'); + // remove this screen and navigate to exit route + Navigation.goBack() + Navigation.navigate(exitTo); }); } }); From 20cef421721c3bbfe48ef638eb5ea132ccca99db Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 16 Jan 2024 11:14:43 +0100 Subject: [PATCH 031/128] prettier --- src/pages/LogOutPreviousUserPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 801e8352e8e1..e38c41aed29d 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -69,7 +69,7 @@ function LogOutPreviousUserPage(props) { if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) { Navigation.isNavigationReady().then(() => { // remove this screen and navigate to exit route - Navigation.goBack() + Navigation.goBack(); Navigation.navigate(exitTo); }); } From af0257b967be6bc46ea5c4a6f4dce23d712680bb Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 16 Jan 2024 11:27:53 +0100 Subject: [PATCH 032/128] adjustments --- .../@oguzhnatly+react-native-image-manipulator+1.0.5.patch | 4 ++-- src/pages/settings/InitialSettingsPage.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch b/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch index eb5ef2da6247..d5a390daf201 100644 --- a/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch +++ b/patches/@oguzhnatly+react-native-image-manipulator+1.0.5.patch @@ -7,13 +7,13 @@ index 3a1a548..fe030bb 100644 android { - compileSdkVersion 28 -+ compileSdkVersion 33 ++ compileSdkVersion 34 buildToolsVersion "28.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 28 -+ targetSdkVersion 33 ++ targetSdkVersion 34 versionCode 1 versionName "1.0" } diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index ffecf9cd2095..e01157b53570 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -294,7 +294,7 @@ function InitialSettingsPage(props) { }, ...defaultMenuItems, ], - (item) => item.translationKey !== 'initialSettingsPage.signOut', + (item) => item.translationKey !== 'initialSettingsPage.signOut' && item.translationKey !== 'initialSettingsPage.goToExpensifyClassic', ); return hybridAppMenuItems; From a41114b54e5d82296fb5b871f8f9d0834da625be Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 16 Jan 2024 13:17:56 +0100 Subject: [PATCH 033/128] fix patches --- .../@react-native+gradle-plugin+0.72.11.patch | 83 ------------------- ...ve-community+cli-platform-ios+12.3.0.patch | 52 ++++++++++++ patches/expo-modules-autolinking+1.9.0.patch | 19 +++++ 3 files changed, 71 insertions(+), 83 deletions(-) delete mode 100644 patches/@react-native+gradle-plugin+0.72.11.patch create mode 100644 patches/@react-native-community+cli-platform-ios+12.3.0.patch diff --git a/patches/@react-native+gradle-plugin+0.72.11.patch b/patches/@react-native+gradle-plugin+0.72.11.patch deleted file mode 100644 index 8609c992b4d6..000000000000 --- a/patches/@react-native+gradle-plugin+0.72.11.patch +++ /dev/null @@ -1,83 +0,0 @@ -diff --git a/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt b/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt -index 062dcc7..cb400ec 100644 ---- a/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt -+++ b/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt -@@ -15,6 +15,7 @@ import com.facebook.react.tasks.GenerateCodegenArtifactsTask - import com.facebook.react.tasks.GenerateCodegenSchemaTask - import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFields - import com.facebook.react.utils.AgpConfiguratorUtils.configureDevPorts -+import com.facebook.react.utils.AgpConfiguratorUtils.configureNamespaceForLibraries - import com.facebook.react.utils.BackwardCompatUtils.configureBackwardCompatibilityReactMap - import com.facebook.react.utils.DependencyUtils.configureDependencies - import com.facebook.react.utils.DependencyUtils.configureRepositories -@@ -64,6 +65,7 @@ class ReactPlugin : Plugin { - - configureReactNativeNdk(project, extension) - configureBuildConfigFields(project) -+ configureNamespaceForLibraries(project) - configureDevPorts(project) - configureBackwardCompatibilityReactMap(project) - -diff --git a/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt b/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt -index 3bf0085..59397b4 100644 ---- a/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt -+++ b/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt -@@ -8,11 +8,17 @@ - package com.facebook.react.utils - - import com.android.build.api.variant.AndroidComponentsExtension -+import com.facebook.react.ReactExtension - import com.facebook.react.utils.ProjectUtils.isHermesEnabled - import com.facebook.react.utils.ProjectUtils.isNewArchEnabled - import org.gradle.api.Action - import org.gradle.api.Project - import org.gradle.api.plugins.AppliedPlugin -+import java.io.File -+import com.android.build.gradle.LibraryExtension -+import javax.xml.parsers.DocumentBuilder -+import javax.xml.parsers.DocumentBuilderFactory -+import org.w3c.dom.Element - - @Suppress("UnstableApiUsage") - internal object AgpConfiguratorUtils { -@@ -49,6 +55,40 @@ internal object AgpConfiguratorUtils { - project.pluginManager.withPlugin("com.android.application", action) - project.pluginManager.withPlugin("com.android.library", action) - } -+ -+ fun configureNamespaceForLibraries(appProject: Project) { -+ appProject.rootProject.allprojects { subproject -> -+ subproject.pluginManager.withPlugin("com.android.library") { -+ subproject.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext -> -+ if(ext.namespace == null){ -+ val android = subproject.extensions.getByType(LibraryExtension::class.java) -+ val manifestFile = android.sourceSets.getByName("main").manifest.srcFile -+ -+ manifestFile.takeIf { it.exists() }?.let { file -> -+ getPackageNameFromManifest(file)?.let { packageName -> -+ ext.namespace = packageName -+ } -+ } -+ } -+ } -+ } -+ } -+ } -+ fun getPackageNameFromManifest(manifest: File): String? { -+ val factory: DocumentBuilderFactory = DocumentBuilderFactory.newInstance() -+ val builder: DocumentBuilder = factory.newDocumentBuilder() -+ -+ try { -+ val xmlDocument = builder.parse(manifest) -+ -+ val manifestElement = xmlDocument.getElementsByTagName("manifest").item(0) as? Element -+ val packageName = manifestElement?.getAttribute("package") -+ -+ return if (packageName.isNullOrEmpty()) null else packageName -+ } catch (e: Exception) { -+ return null -+ } -+ } - } - - const val DEFAULT_DEV_SERVER_PORT = "8081" diff --git a/patches/@react-native-community+cli-platform-ios+12.3.0.patch b/patches/@react-native-community+cli-platform-ios+12.3.0.patch new file mode 100644 index 000000000000..cfae504e44fa --- /dev/null +++ b/patches/@react-native-community+cli-platform-ios+12.3.0.patch @@ -0,0 +1,52 @@ +diff --git a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb +index 82f537c..f5e2cda 100644 +--- a/node_modules/@react-native-community/cli-platform-ios/native_modules.rb ++++ b/node_modules/@react-native-community/cli-platform-ios/native_modules.rb +@@ -12,7 +12,7 @@ + require 'pathname' + require 'cocoapods' + +-def use_native_modules!(config = nil) ++def updateConfig(config = nil) + if (config.is_a? String) + Pod::UI.warn("Passing custom root to use_native_modules! is deprecated.", + [ +@@ -24,7 +24,6 @@ def use_native_modules!(config = nil) + # Resolving the path the RN CLI. The `@react-native-community/cli` module may not be there for certain package managers, so we fall back to resolving it through `react-native` package, that's always present in RN projects + cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" + cli_bin = Pod::Executable.execute_command("node", ["-e", cli_resolve_script], true).strip +- + if (!config) + json = [] + +@@ -36,10 +35,30 @@ def use_native_modules!(config = nil) + + config = JSON.parse(json.join("\n")) + end ++end ++ ++def use_native_modules!(config = nil) ++ if (ENV['REACT_NATIVE_DIR']) ++ Dir.chdir(ENV['REACT_NATIVE_DIR']) do ++ config = updateConfig(config) ++ end ++ else ++ config = updateConfig(config) ++ end + + project_root = Pathname.new(config["project"]["ios"]["sourceDir"]) + ++ if(ENV["PROJECT_ROOT_DIR"]) ++ project_root = File.join(Dir.pwd, ENV["PROJECT_ROOT_DIR"]) ++ ++ end ++ + packages = config["dependencies"] ++ ++ if (ENV["NO_FLIPPER"]) ++ packages = {**packages, "react-native-flipper" => {"platforms" => {"ios" => nil}}} ++ end ++ + found_pods = [] + + packages.each do |package_name, package| diff --git a/patches/expo-modules-autolinking+1.9.0.patch b/patches/expo-modules-autolinking+1.9.0.patch index 363dd5dc3dab..7b171339efc5 100644 --- a/patches/expo-modules-autolinking+1.9.0.patch +++ b/patches/expo-modules-autolinking+1.9.0.patch @@ -1,3 +1,22 @@ +diff --git a/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle b/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle +index 92f1fd6..ada01ad 100644 +--- a/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle ++++ b/node_modules/expo-modules-autolinking/scripts/android/autolinking_implementation.gradle +@@ -149,12 +149,13 @@ class ExpoAutolinkingManager { + } + + static private String[] convertOptionsToCommandArgs(String command, Map options) { ++ def expoPath = options.searchPaths ? "../react-native/node_modules/expo" : "expo" + String[] args = [ + 'node', + '--no-warnings', + '--eval', + // Resolve the `expo` > `expo-modules-autolinking` chain from the project root +- 'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo\')] }))(process.argv.slice(1))', ++ "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'${expoPath}\')] }))(process.argv.slice(1))", + '--', + command, + '--platform', diff --git a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb index c3047a8..6eff107 100644 --- a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb From cb27d13570a371ee539f1f170b09c34ed0bc3999 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 16 Jan 2024 13:29:28 +0100 Subject: [PATCH 034/128] fix cli patch --- ...ct-native-community+cli-platform-android+12.3.0.patch | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/patches/@react-native-community+cli-platform-android+12.3.0.patch b/patches/@react-native-community+cli-platform-android+12.3.0.patch index b6805a4fd93e..7289f652232a 100644 --- a/patches/@react-native-community+cli-platform-android+12.3.0.patch +++ b/patches/@react-native-community+cli-platform-android+12.3.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle -index bbfa7f7..6e024fd 100644 +index bbfa7f7..00d14dd 100644 --- a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle +++ b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle @@ -140,6 +140,7 @@ class ReactNativeModules { @@ -22,12 +22,9 @@ index bbfa7f7..6e024fd 100644 def (nativeModules, reactNativeModulesBuildVariants, androidProject, reactNativeVersion) = this.getReactNativeConfig() this.reactNativeModules = nativeModules -@@ -414,12 +416,12 @@ class ReactNativeModules { - * - * @todo: `fastlane` has been reported to not work too. +@@ -416,10 +418,10 @@ class ReactNativeModules { */ -- def cliResolveScript = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" -+ def cliResolveScript = "try {console.log(require('../react-native/node_modules/@react-native-community/cli').bin);} catch (e) {console.log(require('../react-native/node_modules/react-native/cli').bin);}" + def cliResolveScript = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}" String[] nodeCommand = ["node", "-e", cliResolveScript] - def cliPath = this.getCommandOutput(nodeCommand, this.root) + def cliPath = this.getCommandOutput(nodeCommand, this.rnRoot) From 2e905f70c40b9368674b23b90a5e1cca68ecca47 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 17 Jan 2024 11:36:15 +0100 Subject: [PATCH 035/128] fix nav for smart scan hybrid --- src/pages/LogInWithShortLivedAuthTokenPage.js | 9 ++++++++- src/pages/LogOutPreviousUserPage.js | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/pages/LogInWithShortLivedAuthTokenPage.js b/src/pages/LogInWithShortLivedAuthTokenPage.js index 1fe9b67eef16..3be9ad64e8eb 100644 --- a/src/pages/LogInWithShortLivedAuthTokenPage.js +++ b/src/pages/LogInWithShortLivedAuthTokenPage.js @@ -13,8 +13,11 @@ import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; +import * as ReportUtils from '@libs/ReportUtils'; import * as Session from '@userActions/Session'; +import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; +import ROUTES from '@src/ROUTES'; const propTypes = { /** The parameters needed to authenticate with a short-lived token are in the URL */ @@ -71,7 +74,11 @@ function LogInWithShortLivedAuthTokenPage(props) { const exitTo = lodashGet(props, 'route.params.exitTo', ''); if (exitTo) { Navigation.isNavigationReady().then(() => { - Navigation.navigate(exitTo); + if (exitTo === '/request/new/scan') { + Navigation.navigate(ROUTES.MONEY_REQUEST_CREATE.getRoute(CONST.IOU.TYPE.REQUEST, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, ReportUtils.generateReportID())); + } else { + Navigation.navigate(exitTo); + } }); } // The only dependencies of the effect are based on props.route diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index e38c41aed29d..9438b8663a14 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -6,6 +6,7 @@ import {withOnyx} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import InitialUrlContext from '@libs/InitialUrlContext'; import Navigation from '@libs/Navigation/Navigation'; +import * as ReportUtils from '@libs/ReportUtils'; import * as SessionUtils from '@libs/SessionUtils'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; @@ -70,7 +71,11 @@ function LogOutPreviousUserPage(props) { Navigation.isNavigationReady().then(() => { // remove this screen and navigate to exit route Navigation.goBack(); - Navigation.navigate(exitTo); + if (exitTo === '/request/new/scan') { + Navigation.navigate(ROUTES.MONEY_REQUEST_CREATE.getRoute(CONST.IOU.TYPE.REQUEST, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, ReportUtils.generateReportID())) + } else { + Navigation.navigate(exitTo); + } }); } }); From a3c1eab307999e0efc6bfd3071c2f05d03b5a5d3 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 18 Jan 2024 11:01:48 +0100 Subject: [PATCH 036/128] clean up --- src/ROUTES.ts | 17 +++++++++++++++-- src/languages/en.ts | 2 +- src/libs/Navigation/Navigation.ts | 19 +++++++++++++++++-- src/pages/LogInWithShortLivedAuthTokenPage.js | 9 +++------ src/pages/LogOutPreviousUserPage.js | 7 ++----- 5 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 37003a09a0cd..69e8f534e395 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -474,7 +474,16 @@ const ROUTES = { PROCESS_MONEY_REQUEST_HOLD: 'hold-request-educational', } as const; -export {getUrlWithBackToParam}; +/** + * Proxy routes can be used to generate a correct url with dynamic values + * + * It will be used by HybridApp, that has no access to methods generating dynamic routes in NewDot + */ +const HYBRID_APP_ROUTES = { + MONEY_REQUEST_CREATE: '/request/new/scan', +} + +export {getUrlWithBackToParam, HYBRID_APP_ROUTES}; export default ROUTES; // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -494,4 +503,8 @@ type RouteIsPlainString = IsEqual; */ type Route = RouteIsPlainString extends true ? never : AllRoutes; -export type {Route}; +type HybridAppRoute = { + [K in keyof typeof HYBRID_APP_ROUTES]: ExtractRouteName<(typeof HYBRID_APP_ROUTES)[K]>; +}[keyof typeof HYBRID_APP_ROUTES]; + +export type {Route, HybridAppRoute}; diff --git a/src/languages/en.ts b/src/languages/en.ts index 49749fd79a5a..3be5336c9aa5 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -800,7 +800,7 @@ export default { phrase3: 'and', phrase4: 'Privacy', }, - returnToClassic: 'Return to Expensify Classic', + returnToClassic: 'Switch to Expensify Classic', help: 'Help', }, closeAccountPage: { diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index 91285821fe9f..083039332215 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -2,10 +2,11 @@ import {findFocusedRoute} from '@react-navigation/core'; import type {EventArg, NavigationContainerEventMap, NavigationState, PartialState} from '@react-navigation/native'; import {CommonActions, getPathFromState, StackActions} from '@react-navigation/native'; import Log from '@libs/Log'; +import * as ReportUtils from '@libs/ReportUtils'; import CONST from '@src/CONST'; import NAVIGATORS from '@src/NAVIGATORS'; -import type {Route} from '@src/ROUTES'; -import ROUTES from '@src/ROUTES'; +import type {HybridAppRoute, Route} from '@src/ROUTES'; +import ROUTES, {HYBRID_APP_ROUTES} from '@src/ROUTES'; import {PROTECTED_SCREENS} from '@src/SCREENS'; import originalDismissModal from './dismissModal'; import originalGetTopmostReportActionId from './getTopmostReportActionID'; @@ -67,6 +68,18 @@ function getActiveRouteIndex(stateOrRoute: StateOrRoute, index?: number): number return index; } +/** + * Function that generates dynamic urls from paths passed from OldDot + */ +function parseHybridAppUrl(url: HybridAppRoute | Route): Route { + switch (url) { + case HYBRID_APP_ROUTES.MONEY_REQUEST_CREATE: + return ROUTES.MONEY_REQUEST_CREATE.getRoute(CONST.IOU.TYPE.REQUEST, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, ReportUtils.generateReportID()); + default: + return url as Route; + } +} + /** * Gets distance from the path in root navigator. In other words how much screen you have to pop to get to the route with this path. * The search is limited to 5 screens from the top for performance reasons. @@ -134,6 +147,7 @@ function isActiveRoute(routePath: Route): boolean { * @param [type] - Type of action to perform. Currently UP is supported. */ function navigate(route: Route = ROUTES.HOME, type?: string) { + console.log('route', route); if (!canNavigate('navigate', {route})) { // Store intended route if the navigator is not yet available, // we will try again after the NavigationContainer is ready @@ -313,6 +327,7 @@ export default { getRouteNameFromStateEvent, getTopmostReportActionId, waitForProtectedRoutes, + parseHybridAppUrl, }; export {navigationRef}; diff --git a/src/pages/LogInWithShortLivedAuthTokenPage.js b/src/pages/LogInWithShortLivedAuthTokenPage.js index 3be9ad64e8eb..2f937fe50c9a 100644 --- a/src/pages/LogInWithShortLivedAuthTokenPage.js +++ b/src/pages/LogInWithShortLivedAuthTokenPage.js @@ -1,7 +1,7 @@ import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import React, {useEffect} from 'react'; -import {View} from 'react-native'; +import {NativeModules, View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import Icon from '@components/Icon'; @@ -74,11 +74,8 @@ function LogInWithShortLivedAuthTokenPage(props) { const exitTo = lodashGet(props, 'route.params.exitTo', ''); if (exitTo) { Navigation.isNavigationReady().then(() => { - if (exitTo === '/request/new/scan') { - Navigation.navigate(ROUTES.MONEY_REQUEST_CREATE.getRoute(CONST.IOU.TYPE.REQUEST, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, ReportUtils.generateReportID())); - } else { - Navigation.navigate(exitTo); - } + const url = NativeModules.HybridAppModule ? Navigation.parseHybridAppUrl(exitTo) : exitTo + Navigation.navigate(url); }); } // The only dependencies of the effect are based on props.route diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 9438b8663a14..50e584a28c78 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -70,12 +70,9 @@ function LogOutPreviousUserPage(props) { if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) { Navigation.isNavigationReady().then(() => { // remove this screen and navigate to exit route + const exitUrl = NativeModules.HybridAppModule ? Navigation.parseHybridAppUrl(exitTo) : exitTo Navigation.goBack(); - if (exitTo === '/request/new/scan') { - Navigation.navigate(ROUTES.MONEY_REQUEST_CREATE.getRoute(CONST.IOU.TYPE.REQUEST, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, ReportUtils.generateReportID())) - } else { - Navigation.navigate(exitTo); - } + Navigation.navigate(exitUrl); }); } }); From ec972f632875fea77a358f411eb703bd0aee21bb Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 18 Jan 2024 11:03:13 +0100 Subject: [PATCH 037/128] remove console.log --- src/libs/Navigation/Navigation.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index 083039332215..3f41a38ba221 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -147,7 +147,6 @@ function isActiveRoute(routePath: Route): boolean { * @param [type] - Type of action to perform. Currently UP is supported. */ function navigate(route: Route = ROUTES.HOME, type?: string) { - console.log('route', route); if (!canNavigate('navigate', {route})) { // Store intended route if the navigator is not yet available, // we will try again after the NavigationContainer is ready From c564b5c38f362fa3d2821d3a355e8de3e6956a7d Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 18 Jan 2024 12:29:10 +0100 Subject: [PATCH 038/128] prettier --- src/ROUTES.ts | 2 +- src/pages/LogInWithShortLivedAuthTokenPage.tsx | 2 +- src/pages/LogOutPreviousUserPage.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 69e8f534e395..1897661c794d 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -481,7 +481,7 @@ const ROUTES = { */ const HYBRID_APP_ROUTES = { MONEY_REQUEST_CREATE: '/request/new/scan', -} +}; export {getUrlWithBackToParam, HYBRID_APP_ROUTES}; export default ROUTES; diff --git a/src/pages/LogInWithShortLivedAuthTokenPage.tsx b/src/pages/LogInWithShortLivedAuthTokenPage.tsx index c1dd039229ff..55739977f5f3 100644 --- a/src/pages/LogInWithShortLivedAuthTokenPage.tsx +++ b/src/pages/LogInWithShortLivedAuthTokenPage.tsx @@ -50,7 +50,7 @@ function LogInWithShortLivedAuthTokenPage({route, account}: LogInWithShortLivedA if (exitTo) { Navigation.isNavigationReady().then(() => { - const url = NativeModules.HybridAppModule ? Navigation.parseHybridAppUrl(exitTo) : exitTo + const url = NativeModules.HybridAppModule ? Navigation.parseHybridAppUrl(exitTo) : exitTo; Navigation.navigate(url); }); } diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 50e584a28c78..9bd28f76de31 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -70,7 +70,7 @@ function LogOutPreviousUserPage(props) { if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) { Navigation.isNavigationReady().then(() => { // remove this screen and navigate to exit route - const exitUrl = NativeModules.HybridAppModule ? Navigation.parseHybridAppUrl(exitTo) : exitTo + const exitUrl = NativeModules.HybridAppModule ? Navigation.parseHybridAppUrl(exitTo) : exitTo; Navigation.goBack(); Navigation.navigate(exitUrl); }); From cafec680f97ba700f60e7c8279578b524da1263b Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 18 Jan 2024 15:50:21 +0100 Subject: [PATCH 039/128] fiox linter --- src/ROUTES.ts | 6 ++---- src/libs/Navigation/Navigation.ts | 2 +- src/pages/LogInWithShortLivedAuthTokenPage.tsx | 1 - src/pages/LogOutPreviousUserPage.js | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 1897661c794d..dc856f5ca782 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -481,7 +481,7 @@ const ROUTES = { */ const HYBRID_APP_ROUTES = { MONEY_REQUEST_CREATE: '/request/new/scan', -}; +} as const; export {getUrlWithBackToParam, HYBRID_APP_ROUTES}; export default ROUTES; @@ -503,8 +503,6 @@ type RouteIsPlainString = IsEqual; */ type Route = RouteIsPlainString extends true ? never : AllRoutes; -type HybridAppRoute = { - [K in keyof typeof HYBRID_APP_ROUTES]: ExtractRouteName<(typeof HYBRID_APP_ROUTES)[K]>; -}[keyof typeof HYBRID_APP_ROUTES]; +type HybridAppRoute = typeof HYBRID_APP_ROUTES[keyof typeof HYBRID_APP_ROUTES]; export type {Route, HybridAppRoute}; diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index 3f41a38ba221..5dfd3c5d145b 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -71,7 +71,7 @@ function getActiveRouteIndex(stateOrRoute: StateOrRoute, index?: number): number /** * Function that generates dynamic urls from paths passed from OldDot */ -function parseHybridAppUrl(url: HybridAppRoute | Route): Route { +function parseHybridAppUrl(url: HybridAppRoute & Route): Route { switch (url) { case HYBRID_APP_ROUTES.MONEY_REQUEST_CREATE: return ROUTES.MONEY_REQUEST_CREATE.getRoute(CONST.IOU.TYPE.REQUEST, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, ReportUtils.generateReportID()); diff --git a/src/pages/LogInWithShortLivedAuthTokenPage.tsx b/src/pages/LogInWithShortLivedAuthTokenPage.tsx index 55739977f5f3..cce487a188b7 100644 --- a/src/pages/LogInWithShortLivedAuthTokenPage.tsx +++ b/src/pages/LogInWithShortLivedAuthTokenPage.tsx @@ -15,7 +15,6 @@ import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; import type {PublicScreensParamList} from '@libs/Navigation/types'; import * as Session from '@userActions/Session'; -import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type SCREENS from '@src/SCREENS'; import type {Account} from '@src/types/onyx'; diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js index 9bd28f76de31..db0c7a6d806c 100644 --- a/src/pages/LogOutPreviousUserPage.js +++ b/src/pages/LogOutPreviousUserPage.js @@ -6,7 +6,6 @@ import {withOnyx} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import InitialUrlContext from '@libs/InitialUrlContext'; import Navigation from '@libs/Navigation/Navigation'; -import * as ReportUtils from '@libs/ReportUtils'; import * as SessionUtils from '@libs/SessionUtils'; import * as Session from '@userActions/Session'; import CONST from '@src/CONST'; From 8d79efbb23a375dad0588c389cff5488ea2c80aa Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 18 Jan 2024 15:57:22 +0100 Subject: [PATCH 040/128] fix tsc? --- src/libs/Navigation/Navigation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index 5dfd3c5d145b..3f41a38ba221 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -71,7 +71,7 @@ function getActiveRouteIndex(stateOrRoute: StateOrRoute, index?: number): number /** * Function that generates dynamic urls from paths passed from OldDot */ -function parseHybridAppUrl(url: HybridAppRoute & Route): Route { +function parseHybridAppUrl(url: HybridAppRoute | Route): Route { switch (url) { case HYBRID_APP_ROUTES.MONEY_REQUEST_CREATE: return ROUTES.MONEY_REQUEST_CREATE.getRoute(CONST.IOU.TYPE.REQUEST, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, ReportUtils.generateReportID()); From b6b42325d8612a87b5a10aacdffd3f9d3c6481a6 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 18 Jan 2024 16:03:32 +0100 Subject: [PATCH 041/128] one more fix --- src/ROUTES.ts | 2 +- src/libs/Navigation/Navigation.ts | 2 +- src/libs/Navigation/types.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ROUTES.ts b/src/ROUTES.ts index dc856f5ca782..3269dac6d124 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -503,6 +503,6 @@ type RouteIsPlainString = IsEqual; */ type Route = RouteIsPlainString extends true ? never : AllRoutes; -type HybridAppRoute = typeof HYBRID_APP_ROUTES[keyof typeof HYBRID_APP_ROUTES]; +type HybridAppRoute = (typeof HYBRID_APP_ROUTES)[keyof typeof HYBRID_APP_ROUTES]; export type {Route, HybridAppRoute}; diff --git a/src/libs/Navigation/Navigation.ts b/src/libs/Navigation/Navigation.ts index 3f41a38ba221..15c2ea289b3d 100644 --- a/src/libs/Navigation/Navigation.ts +++ b/src/libs/Navigation/Navigation.ts @@ -76,7 +76,7 @@ function parseHybridAppUrl(url: HybridAppRoute | Route): Route { case HYBRID_APP_ROUTES.MONEY_REQUEST_CREATE: return ROUTES.MONEY_REQUEST_CREATE.getRoute(CONST.IOU.TYPE.REQUEST, CONST.IOU.OPTIMISTIC_TRANSACTION_ID, ReportUtils.generateReportID()); default: - return url as Route; + return url; } } diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 8d227fa6f697..a3470e39b2c0 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -3,7 +3,7 @@ import type {CommonActions, NavigationContainerRefWithCurrent, NavigationHelpers import type {ValueOf} from 'type-fest'; import type CONST from '@src/CONST'; import type NAVIGATORS from '@src/NAVIGATORS'; -import type {Route as Routes} from '@src/ROUTES'; +import type {HybridAppRoute, Route as Routes} from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; type NavigationRef = NavigationContainerRefWithCurrent; @@ -383,7 +383,7 @@ type PublicScreensParamList = { error?: string; shortLivedAuthToken?: string; shortLivedToken?: string; - exitTo?: Routes; + exitTo?: Routes | HybridAppRoute; }; [SCREENS.VALIDATE_LOGIN]: { accountID: string; From 556b831303bbc594b0c682f1bb993b2623fd0d27 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 19 Jan 2024 01:36:30 +0700 Subject: [PATCH 042/128] set default category only when unset --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index ee2a151c7876..0f535cb60e14 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -121,6 +121,9 @@ function IOURequestStepConfirmation({ '', ); useEffect(() => { + if (!_.isEmpty(transaction.category)) { + return; + } IOU.setMoneyRequestCategory_temporaryForRefactor(transactionID, defaultCategory); }, [transactionID, defaultCategory]); From d2f5a1d8c92fa2443dc6e9f7ca4ea91b7aa1643f Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 22 Jan 2024 01:42:49 +0700 Subject: [PATCH 043/128] context approach --- src/components/MenuItem.tsx | 14 +++++-- src/components/MenuItemGroup.js | 35 ---------------- src/components/MenuItemGroup.tsx | 30 ++++++++++++++ .../PersonalDetailsInitialPage.js | 40 +++++++++---------- 4 files changed, 61 insertions(+), 58 deletions(-) delete mode 100644 src/components/MenuItemGroup.js create mode 100644 src/components/MenuItemGroup.tsx diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index 334fa9895205..31c07724975a 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -1,7 +1,7 @@ import ExpensiMark from 'expensify-common/lib/ExpensiMark'; import type {ImageContentFit} from 'expo-image'; import type {ForwardedRef, ReactNode} from 'react'; -import React, {forwardRef, useEffect, useMemo, useRef, useState} from 'react'; +import React, {forwardRef, useContext, useEffect, useMemo, useRef, useState} from 'react'; import type {GestureResponderEvent, StyleProp, TextStyle, ViewStyle} from 'react-native'; import {View} from 'react-native'; import type {AnimatedStyle} from 'react-native-reanimated'; @@ -14,6 +14,8 @@ import ControlSelection from '@libs/ControlSelection'; import convertToLTR from '@libs/convertToLTR'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import getButtonState from '@libs/getButtonState'; +// import useWaitForNavigation from '@hooks/useWaitForNavigation'; +import Navigation from '@libs/Navigation/Navigation'; import type {AvatarSource} from '@libs/UserUtils'; import variables from '@styles/variables'; import * as Session from '@userActions/Session'; @@ -29,6 +31,7 @@ import Hoverable from './Hoverable'; import Icon from './Icon'; import * as Expensicons from './Icon/Expensicons'; import * as defaultWorkspaceAvatars from './Icon/WorkspaceDefaultAvatars'; +import {MenuItemGroupContext} from './MenuItemGroup'; import MultipleAvatars from './MultipleAvatars'; import PressableWithSecondaryInteraction from './PressableWithSecondaryInteraction'; import RenderHTML from './RenderHTML'; @@ -295,6 +298,7 @@ function MenuItem( const {isSmallScreenWidth} = useWindowDimensions(); const [html, setHtml] = useState(''); const titleRef = useRef(''); + const {isExecuting, singleExecution, waitForNavigate} = useContext(MenuItemGroupContext) ?? {}; const isDeleted = style && Array.isArray(style) ? style.includes(styles.offlineFeedback.deleted) : false; const descriptionVerticalMargin = shouldShowDescriptionOnTop ? styles.mb1 : styles.mt1; @@ -370,7 +374,11 @@ function MenuItem( } if (onPress && event) { - onPress(event); + if (!singleExecution || !waitForNavigate) { + onPress(event); + return; + } + singleExecution(waitForNavigate(() => onPress(event))); } }; @@ -394,7 +402,7 @@ function MenuItem( shouldGreyOutWhenDisabled && disabled && styles.buttonOpacityDisabled, ] as StyleProp } - disabled={disabled} + disabled={disabled || isExecuting} ref={ref} role={CONST.ROLE.MENUITEM} accessibilityLabel={title ? title.toString() : ''} diff --git a/src/components/MenuItemGroup.js b/src/components/MenuItemGroup.js deleted file mode 100644 index 4fe5adf989b6..000000000000 --- a/src/components/MenuItemGroup.js +++ /dev/null @@ -1,35 +0,0 @@ -import useSingleExecution from '@hooks/useSingleExecution'; -import PropTypes from 'prop-types'; -import React, {Children, cloneElement} from 'react'; - -const propTypes = { - /* Actual content wrapped by this component */ - children: PropTypes.node.isRequired, - - /** Whether or not to use the single execution hook */ - shouldUseSingleExecution: PropTypes.bool, -}; -const defaultProps = { - shouldUseSingleExecution: true -}; - -function MenuItemGroup(props){ - const {isExecuting, singleExecution} = useSingleExecution(); - const arrayChildren = Children.toArray(props.children); - - return <> - {Children.map(arrayChildren, (child, index) => { - return cloneElement(child,{ - ...child.props, - onPress: props.shouldUseSingleExecution ? singleExecution(child.props.onPress) : child.props.onPress, - disabled: child.props.disabled || isExecuting - }) - })} - -} - -MenuItemGroup.displayName = 'MenuItemGroup'; -MenuItemGroup.propTypes = propTypes; -MenuItemGroup.defaultProps = defaultProps; - -export default MenuItemGroup; \ No newline at end of file diff --git a/src/components/MenuItemGroup.tsx b/src/components/MenuItemGroup.tsx new file mode 100644 index 000000000000..995efc962921 --- /dev/null +++ b/src/components/MenuItemGroup.tsx @@ -0,0 +1,30 @@ +import React, {createContext} from 'react'; +import useSingleExecution from '@hooks/useSingleExecution'; +import type {Action} from '@hooks/useSingleExecution'; +import useWaitForNavigation from '@hooks/useWaitForNavigation'; + +type MenuItemGroupContextProps = { + isExecuting: boolean; + singleExecution: (action?: Action | undefined) => (...params: T) => void; + waitForNavigate: ReturnType; +}; + +const MenuItemGroupContext = createContext(undefined); + +interface MenuItemGroupProps { + /* Actual content wrapped by this component */ + children: React.ReactNode; + + /** Whether or not to use the single execution hook */ + shouldUseSingleExecution: boolean; +} + +const MenuItemGroup: React.FC = ({children}) => { + const {isExecuting, singleExecution} = useSingleExecution(); + const waitForNavigate = useWaitForNavigation(); + + return {children}; +}; + +export {MenuItemGroupContext}; +export default MenuItemGroup; diff --git a/src/pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage.js b/src/pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage.js index a35ad78836b8..ee633cbaff1d 100644 --- a/src/pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage.js +++ b/src/pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage.js @@ -5,6 +5,7 @@ import {ScrollView, View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import MenuItemGroup from '@components/MenuItemGroup'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import {withNetwork} from '@components/OnyxProvider'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -17,7 +18,6 @@ import Navigation from '@libs/Navigation/Navigation'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import MenuItemGroup from '@components/MenuItemGroup'; const propTypes = { /* Onyx Props */ @@ -79,25 +79,25 @@ function PersonalDetailsInitialPage(props) { {props.translate('privatePersonalDetails.privateDataMessage')} - Navigation.navigate(ROUTES.SETTINGS_PERSONAL_DETAILS_LEGAL_NAME)} - /> - Navigation.navigate(ROUTES.SETTINGS_PERSONAL_DETAILS_DATE_OF_BIRTH)} - titleStyle={[styles.flex1]} - /> - Navigation.navigate(ROUTES.SETTINGS_PERSONAL_DETAILS_ADDRESS)} - /> + Navigation.navigate(ROUTES.SETTINGS_PERSONAL_DETAILS_LEGAL_NAME)} + /> + Navigation.navigate(ROUTES.SETTINGS_PERSONAL_DETAILS_DATE_OF_BIRTH)} + titleStyle={[styles.flex1]} + /> + Navigation.navigate(ROUTES.SETTINGS_PERSONAL_DETAILS_ADDRESS)} + /> From ddffc2531e8c658771d80ff4ea2b6fbc001a1311 Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 22 Jan 2024 01:43:36 +0700 Subject: [PATCH 044/128] remove redundant imports --- src/components/MenuItem.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index 31c07724975a..e701c9e21c00 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -14,8 +14,6 @@ import ControlSelection from '@libs/ControlSelection'; import convertToLTR from '@libs/convertToLTR'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import getButtonState from '@libs/getButtonState'; -// import useWaitForNavigation from '@hooks/useWaitForNavigation'; -import Navigation from '@libs/Navigation/Navigation'; import type {AvatarSource} from '@libs/UserUtils'; import variables from '@styles/variables'; import * as Session from '@userActions/Session'; From 5b440b7ae7db307cdf559f96064c05341051e8dd Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 22 Jan 2024 01:50:23 +0700 Subject: [PATCH 045/128] fix lint --- src/components/MenuItemGroup.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/MenuItemGroup.tsx b/src/components/MenuItemGroup.tsx index 995efc962921..e8c7a62bf1a6 100644 --- a/src/components/MenuItemGroup.tsx +++ b/src/components/MenuItemGroup.tsx @@ -1,4 +1,4 @@ -import React, {createContext} from 'react'; +import React, {createContext, useMemo} from 'react'; import useSingleExecution from '@hooks/useSingleExecution'; import type {Action} from '@hooks/useSingleExecution'; import useWaitForNavigation from '@hooks/useWaitForNavigation'; @@ -11,20 +11,25 @@ type MenuItemGroupContextProps = { const MenuItemGroupContext = createContext(undefined); -interface MenuItemGroupProps { +type MenuItemGroupProps = { /* Actual content wrapped by this component */ children: React.ReactNode; /** Whether or not to use the single execution hook */ shouldUseSingleExecution: boolean; -} +}; -const MenuItemGroup: React.FC = ({children}) => { +function MenuItemGroup({children, shouldUseSingleExecution = true}: MenuItemGroupProps) { const {isExecuting, singleExecution} = useSingleExecution(); const waitForNavigate = useWaitForNavigation(); - return {children}; -}; + const value = useMemo( + () => (shouldUseSingleExecution ? {isExecuting, singleExecution, waitForNavigate} : undefined), + [shouldUseSingleExecution, isExecuting, singleExecution, waitForNavigate], + ); + + return {children}; +} export {MenuItemGroupContext}; export default MenuItemGroup; From f96ae97de7e196fae79a26b8cdb205c1bb0f360e Mon Sep 17 00:00:00 2001 From: tienifr Date: Mon, 22 Jan 2024 02:01:12 +0700 Subject: [PATCH 046/128] execute singleExecution --- src/components/MenuItem.tsx | 2 +- src/components/MenuItemGroup.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index e701c9e21c00..f009d3f83939 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -376,7 +376,7 @@ function MenuItem( onPress(event); return; } - singleExecution(waitForNavigate(() => onPress(event))); + singleExecution(waitForNavigate(() => onPress(event)))(); } }; diff --git a/src/components/MenuItemGroup.tsx b/src/components/MenuItemGroup.tsx index e8c7a62bf1a6..8dc8586028d8 100644 --- a/src/components/MenuItemGroup.tsx +++ b/src/components/MenuItemGroup.tsx @@ -16,7 +16,7 @@ type MenuItemGroupProps = { children: React.ReactNode; /** Whether or not to use the single execution hook */ - shouldUseSingleExecution: boolean; + shouldUseSingleExecution?: boolean; }; function MenuItemGroup({children, shouldUseSingleExecution = true}: MenuItemGroupProps) { From c7925f5820f36f06abd46bd3461f8cac70774355 Mon Sep 17 00:00:00 2001 From: tienifr Date: Tue, 23 Jan 2024 02:05:19 +0700 Subject: [PATCH 047/128] fix lint --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index 0f535cb60e14..029836d0c654 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -125,7 +125,7 @@ function IOURequestStepConfirmation({ return; } IOU.setMoneyRequestCategory_temporaryForRefactor(transactionID, defaultCategory); - }, [transactionID, defaultCategory]); + }, [transactionID, transaction.category, defaultCategory]); const navigateBack = useCallback(() => { // If there is not a report attached to the IOU with a reportID, then the participants were manually selected and the user needs taken From 7a620e8d84b4133a0557b954a040a9876224a038 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 23 Jan 2024 10:48:11 +0100 Subject: [PATCH 048/128] patch fix --- .../@react-native-community+cli-platform-android+12.3.0.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/@react-native-community+cli-platform-android+12.3.0.patch b/patches/@react-native-community+cli-platform-android+12.3.0.patch index 7289f652232a..d94baf0f9c6e 100644 --- a/patches/@react-native-community+cli-platform-android+12.3.0.patch +++ b/patches/@react-native-community+cli-platform-android+12.3.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle -index bbfa7f7..00d14dd 100644 +index bbfa7f7..ed53872 100644 --- a/node_modules/@react-native-community/cli-platform-android/native_modules.gradle +++ b/node_modules/@react-native-community/cli-platform-android/native_modules.gradle @@ -140,6 +140,7 @@ class ReactNativeModules { @@ -45,7 +45,7 @@ index bbfa7f7..00d14dd 100644 +if(this.hasProperty('reactNativeProject')){ + autoModules = new ReactNativeModules(logger, projectRoot, new File(projectRoot, reactNativeProject)) +} else { -+ autoModules = new ReactNativeModules(logger, projectRoot) ++ autoModules = new ReactNativeModules(logger, projectRoot, projectRoot) +} def reactNativeVersionRequireNewArchEnabled(autoModules) { From 0068fbf6a58ac1a4193dee45e6e814237c0612b9 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 23 Jan 2024 15:06:37 +0100 Subject: [PATCH 049/128] add required changes --- android/app/src/main/res/values/colors.xml | 2 +- src/App.js | 6 +++--- src/libs/Navigation/AppNavigator/index.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml index 8d5bfbf4eed7..94065c5b9d19 100644 --- a/android/app/src/main/res/values/colors.xml +++ b/android/app/src/main/res/values/colors.xml @@ -1,5 +1,5 @@ - + #03D47C #FFFFFF #03D47C diff --git a/src/App.js b/src/App.js index 87de6a2e160a..4ccb49a6c6cf 100644 --- a/src/App.js +++ b/src/App.js @@ -38,7 +38,7 @@ const propTypes = { }; const defaultProps = { - url: null, + url: undefined, }; // For easier debugging and development, when we are in web we expose Onyx to the window, so you can more easily set data into Onyx @@ -56,11 +56,11 @@ LogBox.ignoreLogs([ const fill = {flex: 1}; -function App(props) { +function App({url}) { useDefaultDragAndDrop(); OnyxUpdateManager(); return ( - + { - if (!NativeModules.HybridAppModule || initUrl === undefined) { + if (!NativeModules.HybridAppModule || !initUrl) { return; } From 8c802edccf7f9221e06508086db22e94ba806afd Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 24 Jan 2024 11:32:22 +0700 Subject: [PATCH 050/128] refactor task preview for hidden case --- .../HTMLRenderers/MentionUserRenderer.js | 2 +- src/components/ReportActionItem/TaskPreview.tsx | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js index 11ffabe4fe6a..f31fd304d47f 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js @@ -41,7 +41,7 @@ function MentionUserRenderer(props) { if (!_.isEmpty(htmlAttribAccountID)) { const user = lodashGet(personalDetails, htmlAttribAccountID); accountID = parseInt(htmlAttribAccountID, 10); - displayNameOrLogin = LocalePhoneNumber.formatPhoneNumber(lodashGet(user, 'login', '')) || lodashGet(user, 'displayName', '') || translate('common.hidden'); + displayNameOrLogin = lodashGet(user, 'displayName', '') || LocalePhoneNumber.formatPhoneNumber(lodashGet(user, 'login', '')) || translate('common.hidden'); navigationRoute = ROUTES.PROFILE.getRoute(htmlAttribAccountID); } else if (!_.isEmpty(props.tnode.data)) { // We need to remove the LTR unicode and leading @ from data as it is not part of the login diff --git a/src/components/ReportActionItem/TaskPreview.tsx b/src/components/ReportActionItem/TaskPreview.tsx index cbd166d79d3a..bbf2525198be 100644 --- a/src/components/ReportActionItem/TaskPreview.tsx +++ b/src/components/ReportActionItem/TaskPreview.tsx @@ -8,7 +8,6 @@ import type {OnyxEntry} from 'react-native-onyx'; import Checkbox from '@components/Checkbox'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; -import {usePersonalDetails} from '@components/OnyxProvider'; import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback'; import RenderHTML from '@components/RenderHTML'; import {showContextMenuForReport} from '@components/ShowContextMenuContext'; @@ -20,7 +19,6 @@ import useThemeStyles from '@hooks/useThemeStyles'; import ControlSelection from '@libs/ControlSelection'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import getButtonState from '@libs/getButtonState'; -import * as LocalePhoneNumber from '@libs/LocalePhoneNumber'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import * as TaskUtils from '@libs/TaskUtils'; @@ -84,7 +82,6 @@ function TaskPreview({ }: TaskPreviewProps) { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); - const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT; const {translate} = useLocalize(); // The reportAction might not contain details regarding the taskReport @@ -95,13 +92,8 @@ function TaskPreview({ : action?.childStateNum === CONST.REPORT.STATE_NUM.APPROVED && action?.childStatusNum === CONST.REPORT.STATUS_NUM.APPROVED; const taskTitle = Str.htmlEncode(TaskUtils.getTaskTitle(taskReportID, action?.childReportName ?? '')); const taskAssigneeAccountID = Task.getTaskAssigneeAccountID(taskReport) ?? action?.childManagerAccountID ?? ''; - const assigneeLogin = personalDetails[taskAssigneeAccountID]?.login ?? ''; - const assigneeDisplayName = personalDetails[taskAssigneeAccountID]?.displayName ?? ''; - const taskAssignee = assigneeDisplayName || LocalePhoneNumber.formatPhoneNumber(assigneeLogin); const htmlForTaskPreview = - taskAssignee && taskAssigneeAccountID !== 0 - ? `@${taskAssignee} ${taskTitle}` - : `${taskTitle}`; + taskAssigneeAccountID !== 0 ? ` ${taskTitle}` : `${taskTitle}`; const isDeletedParentAction = ReportUtils.isCanceledTaskReport(taskReport, action); if (isDeletedParentAction) { From 752e63fa7e9852eb8b71a63d907eff8a573d31e4 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 24 Jan 2024 09:04:26 +0100 Subject: [PATCH 051/128] rename patches --- ...reanimated+3.5.4.patch => react-native-reanimated+3.6.1.patch} | 0 ...amera+2.16.2.patch => react-native-vision-camera+2.16.5.patch} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename patches/{react-native-reanimated+3.5.4.patch => react-native-reanimated+3.6.1.patch} (100%) rename patches/{react-native-vision-camera+2.16.2.patch => react-native-vision-camera+2.16.5.patch} (100%) diff --git a/patches/react-native-reanimated+3.5.4.patch b/patches/react-native-reanimated+3.6.1.patch similarity index 100% rename from patches/react-native-reanimated+3.5.4.patch rename to patches/react-native-reanimated+3.6.1.patch diff --git a/patches/react-native-vision-camera+2.16.2.patch b/patches/react-native-vision-camera+2.16.5.patch similarity index 100% rename from patches/react-native-vision-camera+2.16.2.patch rename to patches/react-native-vision-camera+2.16.5.patch From 6a8161a267ab1228f8735b0ef4dd557d9a5365ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20M=C3=B3rawski?= Date: Wed, 24 Jan 2024 14:30:14 +0100 Subject: [PATCH 052/128] delete the old component --- src/pages/SearchPage.js | 223 ---------------------------------------- 1 file changed, 223 deletions(-) delete mode 100755 src/pages/SearchPage.js diff --git a/src/pages/SearchPage.js b/src/pages/SearchPage.js deleted file mode 100755 index c420371f5a65..000000000000 --- a/src/pages/SearchPage.js +++ /dev/null @@ -1,223 +0,0 @@ -import PropTypes from 'prop-types'; -import React, {useCallback, useEffect, useRef, useState} from 'react'; -import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; -import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import OptionsSelector from '@components/OptionsSelector'; -import ScreenWrapper from '@components/ScreenWrapper'; -import useLocalize from '@hooks/useLocalize'; -import useNetwork from '@hooks/useNetwork'; -import useThemeStyles from '@hooks/useThemeStyles'; -import Navigation from '@libs/Navigation/Navigation'; -import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Performance from '@libs/Performance'; -import * as ReportUtils from '@libs/ReportUtils'; -import * as Report from '@userActions/Report'; -import Timing from '@userActions/Timing'; -import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; -import personalDetailsPropType from './personalDetailsPropType'; -import reportPropTypes from './reportPropTypes'; - -const propTypes = { - /* Onyx Props */ - - /** Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), - - /** All of the personal details for everyone */ - personalDetails: PropTypes.objectOf(personalDetailsPropType), - - /** All reports shared with the user */ - reports: PropTypes.objectOf(reportPropTypes), - - /** Whether we are searching for reports in the server */ - isSearchingForReports: PropTypes.bool, - - /** - * The navigation prop passed by the navigator. - * - * This is required because transitionEnd event doesn't trigger in the automated testing environment. - */ - navigation: PropTypes.shape({}), -}; - -const defaultProps = { - betas: [], - personalDetails: {}, - reports: {}, - isSearchingForReports: false, - navigation: {}, -}; - -function SearchPage({betas, personalDetails, reports, isSearchingForReports, navigation}) { - const [searchValue, setSearchValue] = useState(''); - const [searchOptions, setSearchOptions] = useState({ - recentReports: {}, - personalDetails: {}, - userToInvite: {}, - }); - - const {isOffline} = useNetwork(); - const {translate} = useLocalize(); - const themeStyles = useThemeStyles(); - const isMounted = useRef(false); - - const updateOptions = useCallback(() => { - const { - recentReports: localRecentReports, - personalDetails: localPersonalDetails, - userToInvite: localUserToInvite, - } = OptionsListUtils.getSearchOptions(reports, personalDetails, searchValue.trim(), betas); - - setSearchOptions({ - recentReports: localRecentReports, - personalDetails: localPersonalDetails, - userToInvite: localUserToInvite, - }); - }, [reports, personalDetails, searchValue, betas]); - - useEffect(() => { - Timing.start(CONST.TIMING.SEARCH_RENDER); - Performance.markStart(CONST.TIMING.SEARCH_RENDER); - }, []); - - useEffect(() => { - updateOptions(); - }, [reports, personalDetails, betas, updateOptions]); - - useEffect(() => { - if (!isMounted.current) { - isMounted.current = true; - return; - } - - updateOptions(); - // Ignoring the rule intentionally, we want to run the code only when search Value changes to prevent additional runs. - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [searchValue]); - - /** - * Returns the sections needed for the OptionsSelector - * - * @returns {Array} - */ - const getSections = () => { - const sections = []; - let indexOffset = 0; - - if (searchOptions.recentReports.length > 0) { - sections.push({ - data: searchOptions.recentReports, - shouldShow: true, - indexOffset, - }); - indexOffset += searchOptions.recentReports.length; - } - - if (searchOptions.personalDetails.length > 0) { - sections.push({ - data: searchOptions.personalDetails, - shouldShow: true, - indexOffset, - }); - indexOffset += searchOptions.recentReports.length; - } - - if (searchOptions.userToInvite) { - sections.push({ - data: [searchOptions.userToInvite], - shouldShow: true, - indexOffset, - }); - } - - return sections; - }; - - const searchRendered = () => { - Timing.end(CONST.TIMING.SEARCH_RENDER); - Performance.markEnd(CONST.TIMING.SEARCH_RENDER); - }; - - const onChangeText = (value = '') => { - Report.searchInServer(searchValue); - setSearchValue(value); - }; - - /** - * Reset the search value and redirect to the selected report - * - * @param {Object} option - */ - const selectReport = (option) => { - if (!option) { - return; - } - if (option.reportID) { - Navigation.dismissModal(option.reportID); - } else { - Report.navigateToAndOpenReport([option.login]); - } - }; - - const isOptionsDataReady = ReportUtils.isReportDataReady() && OptionsListUtils.isPersonalDetailsReady(personalDetails); - const headerMessage = OptionsListUtils.getHeaderMessage( - searchOptions.recentReports.length + searchOptions.personalDetails.length !== 0, - Boolean(searchOptions.userToInvite), - searchValue, - ); - - return ( - - {({didScreenTransitionEnd, safeAreaPaddingBottomStyle}) => ( - <> - - - - - - )} - - ); -} - -SearchPage.propTypes = propTypes; -SearchPage.defaultProps = defaultProps; -SearchPage.displayName = 'SearchPage'; -export default withOnyx({ - reports: { - key: ONYXKEYS.COLLECTION.REPORT, - }, - personalDetails: { - key: ONYXKEYS.PERSONAL_DETAILS_LIST, - }, - betas: { - key: ONYXKEYS.BETAS, - }, - isSearchingForReports: { - key: ONYXKEYS.IS_SEARCHING_FOR_REPORTS, - initWithStoredValues: false, - }, -})(SearchPage); From c82dbc35ed0caac73b195339112bff99f65bf102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20M=C3=B3rawski?= Date: Wed, 24 Jan 2024 14:30:51 +0100 Subject: [PATCH 053/128] search debounce and loading indicator added --- .../SelectionList/BaseSelectionList.tsx | 2 ++ src/components/SelectionList/types.ts | 3 +++ src/pages/SearchPage/index.js | 16 ++++++++++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/SelectionList/BaseSelectionList.tsx b/src/components/SelectionList/BaseSelectionList.tsx index d97c47c84ee7..2c929d2f4f9c 100644 --- a/src/components/SelectionList/BaseSelectionList.tsx +++ b/src/components/SelectionList/BaseSelectionList.tsx @@ -58,6 +58,7 @@ function BaseSelectionList( shouldShowTooltips = true, shouldUseDynamicMaxToRenderPerBatch = false, rightHandSideComponent, + isLoadingNewOptions = false, }: BaseSelectionListProps, inputRef: ForwardedRef, ) { @@ -422,6 +423,7 @@ function BaseSelectionList( spellCheck={false} onSubmitEditing={selectFocusedOption} blurOnSubmit={!!flattenedSections.allOptions.length} + isLoading={isLoadingNewOptions} /> )} diff --git a/src/components/SelectionList/types.ts b/src/components/SelectionList/types.ts index a82ddef6febb..222c818dd66d 100644 --- a/src/components/SelectionList/types.ts +++ b/src/components/SelectionList/types.ts @@ -230,6 +230,9 @@ type BaseSelectionListProps = Partial ReactElement) | ReactElement | null; + + /** Whether to show the loading indicator for new options */ + isLoadingNewOptions?: boolean; }; type ItemLayout = { diff --git a/src/pages/SearchPage/index.js b/src/pages/SearchPage/index.js index 211f3622e06c..8a06d54a1f45 100644 --- a/src/pages/SearchPage/index.js +++ b/src/pages/SearchPage/index.js @@ -29,11 +29,15 @@ const propTypes = { /** All reports shared with the user */ reports: PropTypes.objectOf(reportPropTypes), + + /** Whether or not we are searching for reports on the server */ + isSearchingForReports: PropTypes.bool, }; const defaultProps = { betas: [], reports: {}, + isSearchingForReports: false, }; const setPerformanceTimersEnd = () => { @@ -43,7 +47,7 @@ const setPerformanceTimersEnd = () => { const SearchPageFooterInstance = ; -function SearchPage({betas, reports}) { +function SearchPage({betas, reports, isSearchingForReports}) { const [isScreenTransitionEnd, setIsScreenTransitionEnd] = useState(false); const {translate} = useLocalize(); const {isOffline} = useNetwork(); @@ -59,10 +63,9 @@ function SearchPage({betas, reports}) { Performance.markStart(CONST.TIMING.SEARCH_RENDER); }, []); - const onChangeText = (text = '') => { - Report.searchInServer(text); - setSearchValue(text); - }; + useEffect(() => { + Report.searchInServer(debouncedSearchValue.trim()); + }, [debouncedSearchValue]); const { recentReports, @@ -150,13 +153,14 @@ function SearchPage({betas, reports}) { textInputValue={searchValue} textInputLabel={translate('optionsSelector.nameEmailOrPhoneNumber')} textInputHint={offlineMessage} - onChangeText={onChangeText} + onChangeText={setSearchValue} headerMessage={headerMessage} onLayout={setPerformanceTimersEnd} autoFocus onSelectRow={selectReport} showLoadingPlaceholder={!didScreenTransitionEnd || !isOptionsDataReady} footerContent={SearchPageFooterInstance} + isLoadingNewOptions={isSearchingForReports} /> From ddbe75a9883b46112d2a0d7b42e19b2950c828ef Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 26 Jan 2024 18:26:08 +0700 Subject: [PATCH 054/128] fix: nvalid amount error displayed when value has more than 2 decimals --- .../ReimbursementAccount/ValidationStep.js | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/pages/ReimbursementAccount/ValidationStep.js b/src/pages/ReimbursementAccount/ValidationStep.js index 41f63b22f8f3..93230189b9d9 100644 --- a/src/pages/ReimbursementAccount/ValidationStep.js +++ b/src/pages/ReimbursementAccount/ValidationStep.js @@ -20,8 +20,11 @@ import TextLink from '@components/TextLink'; import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import compose from '@libs/compose'; +import * as CurrencyUtils from '@libs/CurrencyUtils'; +import getPermittedDecimalSeparator from '@libs/getPermittedDecimalSeparator'; import BankAccount from '@libs/models/BankAccount'; import * as ValidationUtils from '@libs/ValidationUtils'; +import withPolicy from '@pages/workspace/withPolicy'; import WorkspaceResetBankAccountModal from '@pages/workspace/WorkspaceResetBankAccountModal'; import * as BankAccounts from '@userActions/BankAccounts'; import * as Report from '@userActions/Report'; @@ -61,23 +64,20 @@ const defaultProps = { * Any dollar amount (e.g. 1.12) will be returned as 112 * * @param {String} amount field input + * @param {RegExp} amountRegex * @returns {String} */ -const filterInput = (amount) => { +const filterInput = (amount, amountRegex?: RegExp) => { let value = amount ? amount.toString().trim() : ''; - if (value === '' || _.isNaN(Number(value)) || !Math.abs(Str.fromUSDToNumber(value))) { + value = value.replace(/^0+|0+$/g, ''); + if (value === '' || _.isNaN(Number(value)) || !Math.abs(Str.fromUSDToNumber(value)) || (amountRegex && !amountRegex.test(value))) { return ''; } - // If the user enters the values in dollars, convert it to the respective cents amount - if (_.contains(value, '.')) { - value = Str.fromUSDToNumber(value); - } - return value; }; -function ValidationStep({reimbursementAccount, translate, onBackButtonPress, account, policyID}) { +function ValidationStep({reimbursementAccount, translate, onBackButtonPress, account, policyID, toLocaleDigit, policy}) { const styles = useThemeStyles(); /** * @param {Object} values - form input values passed by the Form component @@ -85,9 +85,13 @@ function ValidationStep({reimbursementAccount, translate, onBackButtonPress, acc */ const validate = (values) => { const errors = {}; + const decimalSeparator = toLocaleDigit('.'); + const outputCurrency = lodashGet(policy, 'outputCurrency', CONST.CURRENCY.USD); + + const amountRegex = RegExp(String.raw`^-?\d{0,8}([${getPermittedDecimalSeparator(decimalSeparator)}]\d{0,${CurrencyUtils.getCurrencyDecimals(outputCurrency)}})?$`, 'i'); _.each(values, (value, key) => { - const filteredValue = typeof value === 'string' ? filterInput(value) : value; + const filteredValue = typeof value === 'string' ? filterInput(value, amountRegex) : value; if (ValidationUtils.isRequiredFulfilled(filteredValue)) { return; } @@ -231,6 +235,7 @@ ValidationStep.displayName = 'ValidationStep'; export default compose( withLocalize, + withPolicy, withOnyx({ account: { key: ONYXKEYS.ACCOUNT, From 8cf2f20d097b97a7a97b4eba1e351d98a94723a2 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 26 Jan 2024 18:35:28 +0700 Subject: [PATCH 055/128] fix remove type --- src/pages/ReimbursementAccount/ValidationStep.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReimbursementAccount/ValidationStep.js b/src/pages/ReimbursementAccount/ValidationStep.js index 93230189b9d9..2bebb4689440 100644 --- a/src/pages/ReimbursementAccount/ValidationStep.js +++ b/src/pages/ReimbursementAccount/ValidationStep.js @@ -67,7 +67,7 @@ const defaultProps = { * @param {RegExp} amountRegex * @returns {String} */ -const filterInput = (amount, amountRegex?: RegExp) => { +const filterInput = (amount, amountRegex) => { let value = amount ? amount.toString().trim() : ''; value = value.replace(/^0+|0+$/g, ''); if (value === '' || _.isNaN(Number(value)) || !Math.abs(Str.fromUSDToNumber(value)) || (amountRegex && !amountRegex.test(value))) { From b758b32583faaa374ffcae91be46944642867665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20M=C3=B3rawski?= Date: Fri, 26 Jan 2024 14:36:55 +0100 Subject: [PATCH 056/128] referral cta bottom padding fix --- src/pages/SearchPage/SearchPageFooter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/SearchPage/SearchPageFooter.tsx b/src/pages/SearchPage/SearchPageFooter.tsx index e0ef67ad9ec3..3d5ebfd2c193 100644 --- a/src/pages/SearchPage/SearchPageFooter.tsx +++ b/src/pages/SearchPage/SearchPageFooter.tsx @@ -8,7 +8,7 @@ function SearchPageFooter() { const themeStyles = useThemeStyles(); return ( - + ); From 357ef0cdfc7ad9ae20a67214631c2331a1a70521 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Sun, 28 Jan 2024 20:19:53 +0700 Subject: [PATCH 057/128] fix lint --- .../HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js index f5a8e79ae2b9..4da34cf7ba0c 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js @@ -11,7 +11,6 @@ import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalD import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as LocalePhoneNumber from '@libs/LocalePhoneNumber'; import Navigation from '@libs/Navigation/Navigation'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; import * as ReportUtils from '@libs/ReportUtils'; @@ -31,7 +30,6 @@ const propTypes = { function MentionUserRenderer(props) { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); - const {translate} = useLocalize(); const defaultRendererProps = _.omit(props, ['TDefaultRenderer', 'style']); const htmlAttributeAccountID = lodashGet(props.tnode.attributes, 'accountid'); const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT; From caaf8c1994f24a701033e8ab141caaf6a3575757 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 29 Jan 2024 14:33:58 +0700 Subject: [PATCH 058/128] fix lint --- .../HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js index 4da34cf7ba0c..744fd17d461f 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js @@ -8,7 +8,6 @@ import {ShowContextMenuContext, showContextMenuForReport} from '@components/Show import Text from '@components/Text'; import UserDetailsTooltip from '@components/UserDetailsTooltip'; import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; -import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; From cad6895caae16fe44aa5882db63942d5034f4ec8 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 30 Jan 2024 15:13:54 +0100 Subject: [PATCH 059/128] test --- tests/perf-test/SignInPage.perf-test.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/perf-test/SignInPage.perf-test.tsx b/tests/perf-test/SignInPage.perf-test.tsx index 80964c3c49cd..7bc08c92b115 100644 --- a/tests/perf-test/SignInPage.perf-test.tsx +++ b/tests/perf-test/SignInPage.perf-test.tsx @@ -29,6 +29,16 @@ jest.mock('../../src/libs/Navigation/Navigation', () => { } as typeof Navigation; }); +jest.mock('../../src/ROUTES', () => { + const actualRoutes = jest.requireActual('../../src/ROUTES'); + return { + ...actualRoutes, + HYBRID_APP_ROUTES: { + MONEY_REQUEST_CREATE: '/request/new/scan', + }, + }; +}); + const mockedNavigate = jest.fn(); jest.mock('@react-navigation/native', () => { const actualNav = jest.requireActual('@react-navigation/native'); From 4c681ef95d6703fd66b58b6489389708c20e16c6 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 30 Jan 2024 16:55:23 +0100 Subject: [PATCH 060/128] test --- tests/perf-test/SignInPage.perf-test.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/perf-test/SignInPage.perf-test.tsx b/tests/perf-test/SignInPage.perf-test.tsx index 7bc08c92b115..94f535ef2afc 100644 --- a/tests/perf-test/SignInPage.perf-test.tsx +++ b/tests/perf-test/SignInPage.perf-test.tsx @@ -29,15 +29,9 @@ jest.mock('../../src/libs/Navigation/Navigation', () => { } as typeof Navigation; }); -jest.mock('../../src/ROUTES', () => { - const actualRoutes = jest.requireActual('../../src/ROUTES'); - return { - ...actualRoutes, - HYBRID_APP_ROUTES: { - MONEY_REQUEST_CREATE: '/request/new/scan', - }, - }; -}); +const HYBRID_APP_ROUTES = { + MONEY_REQUEST_CREATE: '/request/new/scan', +} as const; const mockedNavigate = jest.fn(); jest.mock('@react-navigation/native', () => { From 03e29895bb4a12ce9fd1959895da3191fa82e6a1 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 30 Jan 2024 17:16:48 +0100 Subject: [PATCH 061/128] test --- tests/perf-test/SignInPage.perf-test.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/perf-test/SignInPage.perf-test.tsx b/tests/perf-test/SignInPage.perf-test.tsx index 94f535ef2afc..80964c3c49cd 100644 --- a/tests/perf-test/SignInPage.perf-test.tsx +++ b/tests/perf-test/SignInPage.perf-test.tsx @@ -29,10 +29,6 @@ jest.mock('../../src/libs/Navigation/Navigation', () => { } as typeof Navigation; }); -const HYBRID_APP_ROUTES = { - MONEY_REQUEST_CREATE: '/request/new/scan', -} as const; - const mockedNavigate = jest.fn(); jest.mock('@react-navigation/native', () => { const actualNav = jest.requireActual('@react-navigation/native'); From e9c7742aac218884caaf5e20a1035883b27fb562 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 30 Jan 2024 11:23:00 -0700 Subject: [PATCH 062/128] Add GPS coordinates to smartscanned images --- src/libs/actions/IOU.js | 5 ++++ .../step/IOURequestStepConfirmation.js | 24 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 3d6664099866..3890d1d3262a 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -1289,6 +1289,7 @@ function updateDistanceRequest(transactionID, transactionThreadReportID, transac * @param {Object} [policy] * @param {Object} [policyTags] * @param {Object} [policyCategories] + * @param {Object} [gpsPoints] */ function requestMoney( report, @@ -1309,6 +1310,7 @@ function requestMoney( policy = undefined, policyTags = undefined, policyCategories = undefined, + gpsPoints = undefined, ) { // If the report is iou or expense report, we should get the linked chat report to be passed to the getMoneyRequestInformation function const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); @@ -1360,6 +1362,9 @@ function requestMoney( taxCode, taxAmount, billable, + + // This needs to be a string of JSON because of limitations with the fetch() API and nested objects + gpsPoints: gpsPoints ? JSON.stringify(gpsPoints) : undefined, }, onyxData, ); diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index 6028a735d132..154ad0198a08 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -18,6 +18,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import compose from '@libs/compose'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; +import getCurrentPosition from '@libs/getCurrentPosition'; import * as IOUUtils from '@libs/IOUUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; @@ -160,7 +161,7 @@ function IOURequestStepConfirmation({ * @param {File} [receiptObj] */ const requestMoney = useCallback( - (selectedParticipants, trimmedComment, receiptObj) => { + (selectedParticipants, trimmedComment, receiptObj, gpsPoints) => { IOU.requestMoney( report, transaction.amount, @@ -180,6 +181,7 @@ function IOURequestStepConfirmation({ policy, policyTags, policyCategories, + gpsPoints, ); }, [report, transaction, transactionTaxCode, transactionTaxAmount, currentUserPersonalDetails.login, currentUserPersonalDetails.accountID, policy, policyTags, policyCategories], @@ -265,7 +267,25 @@ function IOURequestStepConfirmation({ } if (receiptFile) { - requestMoney(selectedParticipants, trimmedComment, receiptFile); + getCurrentPosition( + (successData) => { + requestMoney(selectedParticipants, trimmedComment, receiptFile, { + lat: successData.coords.latitude, + long: successData.coords.longitude, + }); + }, + () => { + // When there is an error, the money can still be requested, it just won't include the GPS coordinates + requestMoney(selectedParticipants, trimmedComment, receiptFile); + }, + { + // It's OK to get a cached location that is up to an hour old because the only accuracy needed is the country the user is in + maximumAge: 1000 * 60 * 60, + + // 15 seconds, don't way too long because the server can always fall back to using the IP address + timeout: 15000, + }, + ); return; } From 141cf89428a21ff85e7ee643d017afa3d831e1b9 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 30 Jan 2024 14:56:09 -0700 Subject: [PATCH 063/128] Add error logging --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index 154ad0198a08..edd788f51e90 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -20,6 +20,7 @@ import compose from '@libs/compose'; import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import getCurrentPosition from '@libs/getCurrentPosition'; import * as IOUUtils from '@libs/IOUUtils'; +import Log from '@libs/Log'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as ReportUtils from '@libs/ReportUtils'; @@ -274,7 +275,8 @@ function IOURequestStepConfirmation({ long: successData.coords.longitude, }); }, - () => { + (errorData) => { + Log.info('[IOURequestStepConfirmation] getCurrentPosition failed', false, errorData); // When there is an error, the money can still be requested, it just won't include the GPS coordinates requestMoney(selectedParticipants, trimmedComment, receiptFile); }, From e82fb3fcc1f6384474e146aa7a31ae92ea61b404 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 31 Jan 2024 18:57:28 +0100 Subject: [PATCH 064/128] test --- tests/perf-test/SignInPage.perf-test.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/perf-test/SignInPage.perf-test.tsx b/tests/perf-test/SignInPage.perf-test.tsx index 80964c3c49cd..dde8596fb2ae 100644 --- a/tests/perf-test/SignInPage.perf-test.tsx +++ b/tests/perf-test/SignInPage.perf-test.tsx @@ -18,17 +18,6 @@ import * as TestHelper from '../utils/TestHelper'; import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; import wrapOnyxWithWaitForBatchedUpdates from '../utils/wrapOnyxWithWaitForBatchedUpdates'; -jest.mock('../../src/libs/Navigation/Navigation', () => { - const actualNav = jest.requireActual('../../src/libs/Navigation/Navigation'); - return { - ...actualNav, - navigationRef: { - addListener: () => jest.fn(), - removeListener: () => jest.fn(), - }, - } as typeof Navigation; -}); - const mockedNavigate = jest.fn(); jest.mock('@react-navigation/native', () => { const actualNav = jest.requireActual('@react-navigation/native'); @@ -43,7 +32,10 @@ jest.mock('@react-navigation/native', () => { navigate: jest.fn(), addListener: () => jest.fn(), }), - createNavigationContainerRef: jest.fn(), + createNavigationContainerRef: () => ({ + addListener: () => jest.fn(), + removeListener: () => jest.fn(), + }), } as typeof NativeNavigation; }); From c74a850bcf32d5e350deb2212ace63c94d27fde4 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Thu, 1 Feb 2024 02:48:15 +0200 Subject: [PATCH 065/128] Show participant name in non reimbursable transactions --- src/components/ReportActionItem/ReportPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 52e9d94eaefd..bb44f54640e8 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -201,7 +201,7 @@ function ReportPreview({ if (isApproved) { return translate('iou.managerApproved', {manager: payerOrApproverName}); } - const managerName = isPolicyExpenseChat ? ReportUtils.getPolicyName(chatReport) : ReportUtils.getDisplayNameForParticipant(managerID, true); + const managerName = isPolicyExpenseChat && !hasNonReimbursableTransactions ? ReportUtils.getPolicyName(chatReport) : ReportUtils.getDisplayNameForParticipant(managerID, true); let paymentVerb: TranslationPaths = hasNonReimbursableTransactions ? 'iou.payerSpent' : 'iou.payerOwes'; if (iouSettled || iouReport?.isWaitingOnBankAccount) { paymentVerb = 'iou.payerPaid'; From 279cf987bf314e41289ebbfa9374471ce9b2cfce Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 1 Feb 2024 12:22:23 +0100 Subject: [PATCH 066/128] update patch --- ... => expo-modules-autolinking+1.10.2.patch} | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename patches/{expo-modules-autolinking+1.9.0.patch => expo-modules-autolinking+1.10.2.patch} (66%) diff --git a/patches/expo-modules-autolinking+1.9.0.patch b/patches/expo-modules-autolinking+1.10.2.patch similarity index 66% rename from patches/expo-modules-autolinking+1.9.0.patch rename to patches/expo-modules-autolinking+1.10.2.patch index 7b171339efc5..4b68007ba125 100644 --- a/patches/expo-modules-autolinking+1.9.0.patch +++ b/patches/expo-modules-autolinking+1.10.2.patch @@ -18,23 +18,23 @@ index 92f1fd6..ada01ad 100644 command, '--platform', diff --git a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb -index c3047a8..6eff107 100644 +index 5d46f1e..3db7b89 100644 --- a/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb +++ b/node_modules/expo-modules-autolinking/scripts/ios/project_integrator.rb -@@ -212,6 +212,7 @@ module Expo - - # Generates the support script that is executed by the build script phase. - def self.generate_support_script(autolinking_manager, modules_provider_path) +@@ -215,6 +215,7 @@ module Expo + args = autolinking_manager.base_command_args.map { |arg| "\"#{arg}\"" } + platform = autolinking_manager.platform_name.downcase + package_names = autolinking_manager.packages_to_generate.map { |package| "\"#{package.name}\"" } + expo_path = ENV['REACT_NATIVE_DIR'] ? "#{ENV['REACT_NATIVE_DIR']}/node_modules/expo" : "expo" - args = autolinking_manager.base_command_args.map { |arg| "\"#{arg}\"" }.join(' ') <<~SUPPORT_SCRIPT -@@ -258,7 +259,7 @@ module Expo - fi - } - -- with_node --no-warnings --eval "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))" generate-package-list #{args} --target "#{modules_provider_path}" -+ with_node --no-warnings --eval "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'#{expo_path}/package.json\')] }))(process.argv.slice(1))" generate-package-list #{args} --target "#{modules_provider_path}" - SUPPORT_SCRIPT - end + #!/usr/bin/env bash +@@ -262,7 +263,7 @@ module Expo + with_node \\ + --no-warnings \\ +- --eval "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))" \\ ++ --eval "require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'#{expo_path}/package.json\')] }))(process.argv.slice(1))" \\ + generate-modules-provider #{args.join(' ')} \\ + --target "#{modules_provider_path}" \\ + --platform "apple" \\ From 53546d7fe370ccdb8eea240ca908d4d32f5abf6b Mon Sep 17 00:00:00 2001 From: Pavlo Tsimura Date: Thu, 1 Feb 2024 23:21:58 +0100 Subject: [PATCH 067/128] Hide smartScan fields for Scan requests only --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index 0f1c2b27ad2e..22ff297c11ba 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -372,7 +372,7 @@ function IOURequestStepConfirmation({ iouMerchant={transaction.merchant} iouCreated={transaction.created} isDistanceRequest={requestType === CONST.IOU.REQUEST_TYPE.DISTANCE} - shouldShowSmartScanFields={_.isEmpty(lodashGet(transaction, 'receipt.source', ''))} + shouldShowSmartScanFields={requestType !== CONST.IOU.REQUEST_TYPE.SCAN} /> )} From 1296790702833467b0fd7b5f016afb6ab160957b Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 2 Feb 2024 16:56:01 +0700 Subject: [PATCH 068/128] set default category for distance request only --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index 029836d0c654..6c3d40dc33ad 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -121,7 +121,7 @@ function IOURequestStepConfirmation({ '', ); useEffect(() => { - if (!_.isEmpty(transaction.category)) { + if (requestType !== CONST.IOU.REQUEST_TYPE.DISTANCE || !_.isEmpty(transaction.category)) { return; } IOU.setMoneyRequestCategory_temporaryForRefactor(transactionID, defaultCategory); From cbbc7a37cb7903fe7028ba170b86c06d4cdf736b Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 2 Feb 2024 17:01:13 +0700 Subject: [PATCH 069/128] fix lint --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index acd66fb1a3ed..560e87b6d802 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -125,7 +125,7 @@ function IOURequestStepConfirmation({ return; } IOU.setMoneyRequestCategory_temporaryForRefactor(transactionID, defaultCategory); - }, [transactionID, transaction.category, defaultCategory]); + }, [transactionID, transaction.category, requestType, defaultCategory]); const navigateBack = useCallback(() => { // If there is not a report attached to the IOU with a reportID, then the participants were manually selected and the user needs taken From 93964ab66b9ad9b5179e2314d5b33e7ed1f04c85 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 3 Feb 2024 00:04:41 +0800 Subject: [PATCH 070/128] disable keyboard --- src/components/MagicCodeInput.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/MagicCodeInput.tsx b/src/components/MagicCodeInput.tsx index 4a6d87b48e38..30bed888514f 100644 --- a/src/components/MagicCodeInput.tsx +++ b/src/components/MagicCodeInput.tsx @@ -366,6 +366,7 @@ function MagicCodeInput( collapsable={false} > { inputWidth.current = e.nativeEvent.layout.width; }} From ae1665dc6293066d4571e0dfb2b82a9e35777808 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Fri, 2 Feb 2024 09:39:09 -0700 Subject: [PATCH 071/128] Update src/pages/iou/request/step/IOURequestStepConfirmation.js Co-authored-by: Ionatan Wiznia --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index edd788f51e90..37186dc28931 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -284,7 +284,7 @@ function IOURequestStepConfirmation({ // It's OK to get a cached location that is up to an hour old because the only accuracy needed is the country the user is in maximumAge: 1000 * 60 * 60, - // 15 seconds, don't way too long because the server can always fall back to using the IP address + // 15 seconds, don't wait too long because the server can always fall back to using the IP address timeout: 15000, }, ); From 5a365b4d4c7de9aed418404d121927be699e97d8 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Mon, 5 Feb 2024 10:06:48 +0200 Subject: [PATCH 072/128] changing the the report name in the search tab as well --- src/components/ReportActionItem/ReportPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index bb44f54640e8..52e9d94eaefd 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -201,7 +201,7 @@ function ReportPreview({ if (isApproved) { return translate('iou.managerApproved', {manager: payerOrApproverName}); } - const managerName = isPolicyExpenseChat && !hasNonReimbursableTransactions ? ReportUtils.getPolicyName(chatReport) : ReportUtils.getDisplayNameForParticipant(managerID, true); + const managerName = isPolicyExpenseChat ? ReportUtils.getPolicyName(chatReport) : ReportUtils.getDisplayNameForParticipant(managerID, true); let paymentVerb: TranslationPaths = hasNonReimbursableTransactions ? 'iou.payerSpent' : 'iou.payerOwes'; if (iouSettled || iouReport?.isWaitingOnBankAccount) { paymentVerb = 'iou.payerPaid'; From 7accee559695113ae345fa83966984970c16a489 Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Mon, 5 Feb 2024 10:09:35 +0200 Subject: [PATCH 073/128] changing the the report name in the search tab as well --- src/libs/ReportUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 228db29aea6c..7738a4889a69 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1856,7 +1856,8 @@ function getPolicyExpenseChatName(report: OnyxEntry, policy: OnyxEntry

, policy: OnyxEntry | undefined = undefined): string { const moneyRequestTotal = getMoneyRequestSpendBreakdown(report).totalDisplaySpend; const formattedAmount = CurrencyUtils.convertToDisplayString(moneyRequestTotal, report?.currency, hasOnlyDistanceRequestTransactions(report?.reportID)); - const payerOrApproverName = isExpenseReport(report) ? getPolicyName(report, false, policy) : getDisplayNameForParticipant(report?.managerID) ?? ''; + const payerOrApproverName = + isExpenseReport(report) && !hasNonReimbursableTransactions(report?.reportID ?? '') ? getPolicyName(report, false, policy) : getDisplayNameForParticipant(report?.managerID) ?? ''; const payerPaidAmountMessage = Localize.translateLocal('iou.payerPaidAmount', { payer: payerOrApproverName, amount: formattedAmount, From 80f96216d3bef94ef4f3997293ccc9709756aeaf Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Mon, 5 Feb 2024 10:12:38 +0200 Subject: [PATCH 074/128] minor --- src/components/ReportActionItem/ReportPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 52e9d94eaefd..bb44f54640e8 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -201,7 +201,7 @@ function ReportPreview({ if (isApproved) { return translate('iou.managerApproved', {manager: payerOrApproverName}); } - const managerName = isPolicyExpenseChat ? ReportUtils.getPolicyName(chatReport) : ReportUtils.getDisplayNameForParticipant(managerID, true); + const managerName = isPolicyExpenseChat && !hasNonReimbursableTransactions ? ReportUtils.getPolicyName(chatReport) : ReportUtils.getDisplayNameForParticipant(managerID, true); let paymentVerb: TranslationPaths = hasNonReimbursableTransactions ? 'iou.payerSpent' : 'iou.payerOwes'; if (iouSettled || iouReport?.isWaitingOnBankAccount) { paymentVerb = 'iou.payerPaid'; From 61c39c57292a9639b37e8798fb770c53c16a02b2 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 5 Feb 2024 09:26:43 +0100 Subject: [PATCH 075/128] update patch name --- patches/{expo+50.0.0-preview.7.patch => expo+50.0.4.patch} | 0 ...o-modules-core+1.11.4.patch => expo-modules-core+1.11.8.patch} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename patches/{expo+50.0.0-preview.7.patch => expo+50.0.4.patch} (100%) rename patches/{expo-modules-core+1.11.4.patch => expo-modules-core+1.11.8.patch} (100%) diff --git a/patches/expo+50.0.0-preview.7.patch b/patches/expo+50.0.4.patch similarity index 100% rename from patches/expo+50.0.0-preview.7.patch rename to patches/expo+50.0.4.patch diff --git a/patches/expo-modules-core+1.11.4.patch b/patches/expo-modules-core+1.11.8.patch similarity index 100% rename from patches/expo-modules-core+1.11.4.patch rename to patches/expo-modules-core+1.11.8.patch From 71d628f2ec311f088a4513ab2b4e0d9db16e9061 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 5 Feb 2024 11:45:28 +0100 Subject: [PATCH 076/128] fix --- src/pages/settings/InitialSettingsPage.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index 65da42fcf907..750e67e54565 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -131,7 +131,7 @@ function InitialSettingsPage(props) { const profileBrickRoadIndicator = UserUtils.getLoginListBrickRoadIndicator(props.loginList); const paymentCardList = props.fundList || {}; - const defaultMenuItems = { + const defaultMenu = { sectionStyle: styles.accountSettingsSectionContainer, sectionTranslationKey: 'initialSettingsPage.account', items: [ @@ -183,7 +183,7 @@ function InitialSettingsPage(props) { ], }; - if (NativeModules.HybridAppModule) { + if (!NativeModules.HybridAppModule) { const hybridAppMenuItems = _.filter( [ { @@ -193,15 +193,15 @@ function InitialSettingsPage(props) { iconRight: Expensicons.NewWindow, action: () => NativeModules.HybridAppModule.closeReactNativeApp(), }, - ...defaultMenuItems, + ...defaultMenu.items, ], (item) => item.translationKey !== 'initialSettingsPage.signOut' && item.translationKey !== 'initialSettingsPage.goToExpensifyClassic', ); - return hybridAppMenuItems; + return {sectionStyle: styles.accountSettingsSectionContainer, sectionTranslationKey: 'initialSettingsPage.account', items: hybridAppMenuItems}; } - return defaultMenuItems; + return defaultMenu; }, [props.bankAccountList, props.fundList, props.loginList, props.userWallet.errors, props.walletTerms.errors, signOut, styles.accountSettingsSectionContainer]); /** From ae20949b622c655f5606648a93bd35b6555788d9 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 5 Feb 2024 11:51:08 +0100 Subject: [PATCH 077/128] fix git statement --- src/pages/settings/InitialSettingsPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/InitialSettingsPage.js b/src/pages/settings/InitialSettingsPage.js index 750e67e54565..a8ac8d8aad47 100755 --- a/src/pages/settings/InitialSettingsPage.js +++ b/src/pages/settings/InitialSettingsPage.js @@ -183,7 +183,7 @@ function InitialSettingsPage(props) { ], }; - if (!NativeModules.HybridAppModule) { + if (NativeModules.HybridAppModule) { const hybridAppMenuItems = _.filter( [ { From b94b7d9ded24bbcae8cdf5d8575ce75b612f759f Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Mon, 5 Feb 2024 15:02:56 +0100 Subject: [PATCH 078/128] ref: move react-navigation mock to TS --- __mocks__/@react-navigation/native/{index.js => index.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename __mocks__/@react-navigation/native/{index.js => index.ts} (69%) diff --git a/__mocks__/@react-navigation/native/index.js b/__mocks__/@react-navigation/native/index.ts similarity index 69% rename from __mocks__/@react-navigation/native/index.js rename to __mocks__/@react-navigation/native/index.ts index 09abd0d02bf9..4d0c63d28fce 100644 --- a/__mocks__/@react-navigation/native/index.js +++ b/__mocks__/@react-navigation/native/index.ts @@ -1,7 +1,7 @@ import {useIsFocused as realUseIsFocused} from '@react-navigation/native'; // We only want this mocked for storybook, not jest -const useIsFocused = process.env.NODE_ENV === 'test' ? realUseIsFocused : () => true; +const useIsFocused: () => boolean = process.env.NODE_ENV === 'test' ? realUseIsFocused : () => true; export * from '@react-navigation/core'; export * from '@react-navigation/native'; From 17b08301631205b41d9fe0f0236b5be29b8dc2fe Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Mon, 5 Feb 2024 15:25:28 +0100 Subject: [PATCH 079/128] fix: used better type --- __mocks__/@react-navigation/native/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__mocks__/@react-navigation/native/index.ts b/__mocks__/@react-navigation/native/index.ts index 4d0c63d28fce..aa8067a1c862 100644 --- a/__mocks__/@react-navigation/native/index.ts +++ b/__mocks__/@react-navigation/native/index.ts @@ -1,7 +1,7 @@ import {useIsFocused as realUseIsFocused} from '@react-navigation/native'; // We only want this mocked for storybook, not jest -const useIsFocused: () => boolean = process.env.NODE_ENV === 'test' ? realUseIsFocused : () => true; +const useIsFocused: typeof realUseIsFocused = process.env.NODE_ENV === 'test' ? realUseIsFocused : () => true; export * from '@react-navigation/core'; export * from '@react-navigation/native'; From 85f2dc1763c9f0b2defdabd451f082a9d6a67dba Mon Sep 17 00:00:00 2001 From: Abdelrahman Khattab Date: Mon, 5 Feb 2024 17:51:48 +0200 Subject: [PATCH 080/128] fix LHN titles to show the participant name for reimbursable transactions as well --- src/libs/ReportUtils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index ad12339a4338..4e5aaf46cf86 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2257,9 +2257,10 @@ function getReportPreviewMessage( } } + const containsNonReimbursable = hasNonReimbursableTransactions(report.reportID); const totalAmount = getMoneyRequestSpendBreakdown(report).totalDisplaySpend; const policyName = getPolicyName(report, false, policy); - const payerName = isExpenseReport(report) ? policyName : getDisplayNameForParticipant(report.managerID, !isPreviewMessageForParentChatReport); + const payerName = isExpenseReport(report) && !containsNonReimbursable ? policyName : getDisplayNameForParticipant(report.managerID, !isPreviewMessageForParentChatReport); const formattedAmount = CurrencyUtils.convertToDisplayString(totalAmount, report.currency); @@ -2303,8 +2304,6 @@ function getReportPreviewMessage( return Localize.translateLocal('iou.waitingOnBankAccount', {submitterDisplayName}); } - const containsNonReimbursable = hasNonReimbursableTransactions(report.reportID); - const lastActorID = reportAction?.actorAccountID; // if we have the amount in the originalMessage and lastActorID, we can use that to display the preview message for the latest request From 111c1a298a6827f5629975e567ec376730905d82 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Mon, 5 Feb 2024 16:59:21 +0100 Subject: [PATCH 081/128] Fix bug with Distance - By adding 2nd add stop user can delete empty location --- src/pages/iou/request/step/IOURequestStepWaypoint.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepWaypoint.js b/src/pages/iou/request/step/IOURequestStepWaypoint.js index 4c35951bc297..e9a3b13b0dc6 100644 --- a/src/pages/iou/request/step/IOURequestStepWaypoint.js +++ b/src/pages/iou/request/step/IOURequestStepWaypoint.js @@ -113,8 +113,8 @@ function IOURequestStepWaypoint({ const locationBias = useLocationBias(allWaypoints, userLocation); const waypointAddress = lodashGet(currentWaypoint, 'address', ''); - // Hide the menu when there is only start and finish waypoint - const shouldShowThreeDotsButton = waypointCount > 2; + // Hide the menu when there is only start and finish waypoint and the current waypoint is not empty + const shouldShowThreeDotsButton = waypointCount > 2 && waypointAddress; const shouldDisableEditor = isFocused && (Number.isNaN(parsedWaypointIndex) || parsedWaypointIndex < 0 || parsedWaypointIndex > waypointCount || (filledWaypointCount < 2 && parsedWaypointIndex >= waypointCount)); From 9070dc4c74fc95937cc30b95124420e16acd2af7 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Mon, 5 Feb 2024 17:09:32 +0100 Subject: [PATCH 082/128] Update comment for shouldShowThreeDotsButton --- src/pages/iou/request/step/IOURequestStepWaypoint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepWaypoint.js b/src/pages/iou/request/step/IOURequestStepWaypoint.js index e9a3b13b0dc6..93a87baa0481 100644 --- a/src/pages/iou/request/step/IOURequestStepWaypoint.js +++ b/src/pages/iou/request/step/IOURequestStepWaypoint.js @@ -113,7 +113,7 @@ function IOURequestStepWaypoint({ const locationBias = useLocationBias(allWaypoints, userLocation); const waypointAddress = lodashGet(currentWaypoint, 'address', ''); - // Hide the menu when there is only start and finish waypoint and the current waypoint is not empty + // Hide the menu when there is only start and finish waypoint or the current waypoint is empty const shouldShowThreeDotsButton = waypointCount > 2 && waypointAddress; const shouldDisableEditor = isFocused && From 069e83e0abd8e46ab03427b7a959062bab7a3863 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 6 Feb 2024 01:13:59 +0700 Subject: [PATCH 083/128] revert change --- .../HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js index 744fd17d461f..e3718a7de960 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js @@ -57,7 +57,7 @@ function MentionUserRenderer(props) { if (!_.isEmpty(htmlAttributeAccountID)) { const user = lodashGet(personalDetails, htmlAttributeAccountID); accountID = parseInt(htmlAttributeAccountID, 10); - displayNameOrLogin = ReportUtils.getDisplayNameForParticipant(accountID); + displayNameOrLogin = lodashGet(user, 'displayName', '') || LocalePhoneNumber.formatPhoneNumber(lodashGet(user, 'login', '')) || translate('common.hidden'); displayNameOrLogin = getMentionDisplayText(displayNameOrLogin, htmlAttributeAccountID, lodashGet(user, 'login', '')); navigationRoute = ROUTES.PROFILE.getRoute(htmlAttributeAccountID); } else if (!_.isEmpty(tnode.data)) { From b0006f966dfd0f8ebcdc837c5d9aac3716557247 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 5 Feb 2024 19:50:19 +0100 Subject: [PATCH 084/128] update package.json wth fix to markdown --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 22cb27b81c5d..8860eaa86f39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "MIT", "dependencies": { "@dotlottie/react-player": "^1.6.3", - "@expensify/react-native-live-markdown": "git+ssh://git@github.com/Expensify/react-native-live-markdown.git#c316611781f19815caebfed5540e0faf2a274785", + "@expensify/react-native-live-markdown": "git+ssh://git@github.com/Expensify/react-native-live-markdown.git#f0b63f41fa4c09bfa68439da0550b47bafd92fa2", "@expo/metro-runtime": "~3.1.1", "@formatjs/intl-datetimeformat": "^6.10.0", "@formatjs/intl-getcanonicallocales": "^2.2.0", @@ -3352,8 +3352,8 @@ }, "node_modules/@expensify/react-native-live-markdown": { "version": "0.1.0", - "resolved": "git+ssh://git@github.com/Expensify/react-native-live-markdown.git#c316611781f19815caebfed5540e0faf2a274785", - "integrity": "sha512-yF3oaBhqWQonl12LPELYLsgfmqCsGg2bu15g/h8XzVX3f/nzfPtrWE/ax2lWEIpIjk4/+aEu/VGNKLnlehjTxQ==", + "resolved": "git+ssh://git@github.com/Expensify/react-native-live-markdown.git#f0b63f41fa4c09bfa68439da0550b47bafd92fa2", + "integrity": "sha512-F+KypQSN+xYBkrXDomJRTg8Q913lpeWoKCLZIr6+YKqn0P1hrKKRVz2ESLfA/JOD1lHvii6kI9hGKARDGH9O/w==", "license": "MIT", "workspaces": [ "example" diff --git a/package.json b/package.json index 969a07417422..c2378673081a 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "dependencies": { "@dotlottie/react-player": "^1.6.3", - "@expensify/react-native-live-markdown": "git+ssh://git@github.com/Expensify/react-native-live-markdown.git#c316611781f19815caebfed5540e0faf2a274785", + "@expensify/react-native-live-markdown": "git+ssh://git@github.com/Expensify/react-native-live-markdown.git#f0b63f41fa4c09bfa68439da0550b47bafd92fa2", "@expo/metro-runtime": "~3.1.1", "@formatjs/intl-datetimeformat": "^6.10.0", "@formatjs/intl-getcanonicallocales": "^2.2.0", From c34932cb2f7ad51d66aa3fb401e6ce32a6bf08f3 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 5 Feb 2024 13:14:47 -0700 Subject: [PATCH 085/128] Prevent form from being submitted multiple times --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index b21c53c01580..daa653f616ba 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -105,6 +105,7 @@ function IOURequestStepConfirmation({ [transaction.participants, personalDetails], ); const isPolicyExpenseChat = useMemo(() => ReportUtils.isPolicyExpenseChat(ReportUtils.getRootParentReport(report)), [report]); + let formHasBeenSubmitted = false; useEffect(() => { if (!transaction || !transaction.originalCurrency) { @@ -228,6 +229,13 @@ function IOURequestStepConfirmation({ (selectedParticipants) => { const trimmedComment = lodashGet(transaction, 'comment.comment', '').trim(); + // Don't let the form be submitted multiple times while the navigator is waiting to take the user to a different page + if (formHasBeenSubmitted) { + return; + } + + formHasBeenSubmitted = true; + // If we have a receipt let's start the split bill by creating only the action, the transaction, and the group DM if needed if (iouType === CONST.IOU.TYPE.SPLIT && receiptFile) { IOU.startSplitBill( From df02d87b9064ca827e66572a6dc5bb076f3a9355 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 5 Feb 2024 13:50:42 -0700 Subject: [PATCH 086/128] Add GPS points to the types --- src/libs/API/parameters/RequestMoneyParams.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/API/parameters/RequestMoneyParams.ts b/src/libs/API/parameters/RequestMoneyParams.ts index ccafdd692137..983394008ba7 100644 --- a/src/libs/API/parameters/RequestMoneyParams.ts +++ b/src/libs/API/parameters/RequestMoneyParams.ts @@ -24,6 +24,7 @@ type RequestMoneyParams = { taxCode: string; taxAmount: number; billable?: boolean; + gpsPoints?: string; }; export default RequestMoneyParams; From 77be41142b8e0f87e41bc28a83b8f6f9bb4a20f6 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 5 Feb 2024 13:56:46 -0700 Subject: [PATCH 087/128] Use a ref instead of a variable. --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index daa653f616ba..b939e0e725c0 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -1,6 +1,6 @@ import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; -import React, {useCallback, useEffect, useMemo, useState} from 'react'; +import React, {useCallback, useEffect, useMemo, useState, useRef} from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; @@ -105,7 +105,7 @@ function IOURequestStepConfirmation({ [transaction.participants, personalDetails], ); const isPolicyExpenseChat = useMemo(() => ReportUtils.isPolicyExpenseChat(ReportUtils.getRootParentReport(report)), [report]); - let formHasBeenSubmitted = false; + const formHasBeenSubmitted = useRef(false); useEffect(() => { if (!transaction || !transaction.originalCurrency) { @@ -230,11 +230,11 @@ function IOURequestStepConfirmation({ const trimmedComment = lodashGet(transaction, 'comment.comment', '').trim(); // Don't let the form be submitted multiple times while the navigator is waiting to take the user to a different page - if (formHasBeenSubmitted) { + if (formHasBeenSubmitted.current) { return; } - formHasBeenSubmitted = true; + formHasBeenSubmitted.current = true; // If we have a receipt let's start the split bill by creating only the action, the transaction, and the group DM if needed if (iouType === CONST.IOU.TYPE.SPLIT && receiptFile) { From e83c24a01a31607e5ccf406de8dd09a22c9d7c7e Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 5 Feb 2024 14:04:32 -0700 Subject: [PATCH 088/128] Style --- src/pages/iou/request/step/IOURequestStepConfirmation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.js b/src/pages/iou/request/step/IOURequestStepConfirmation.js index b939e0e725c0..be57de687e3a 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.js +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.js @@ -1,6 +1,6 @@ import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; -import React, {useCallback, useEffect, useMemo, useState, useRef} from 'react'; +import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; From 03743f793a96b3ad60f21f0adb633174c8c90d6c Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 6 Feb 2024 08:04:32 +0700 Subject: [PATCH 089/128] fix lint --- .../HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js index e3718a7de960..cd6ada90b58b 100644 --- a/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js +++ b/src/components/HTMLEngineProvider/HTMLRenderers/MentionUserRenderer.js @@ -8,8 +8,10 @@ import {ShowContextMenuContext, showContextMenuForReport} from '@components/Show import Text from '@components/Text'; import UserDetailsTooltip from '@components/UserDetailsTooltip'; import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails'; +import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; +import * as LocalePhoneNumber from '@libs/LocalePhoneNumber'; import Navigation from '@libs/Navigation/Navigation'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; import * as ReportUtils from '@libs/ReportUtils'; @@ -29,6 +31,7 @@ const propTypes = { function MentionUserRenderer(props) { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); + const {translate} = useLocalize(); const defaultRendererProps = _.omit(props, ['TDefaultRenderer', 'style']); const htmlAttributeAccountID = lodashGet(props.tnode.attributes, 'accountid'); const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT; From d7de25978c7c548ae3bfd515522a86f253f8b5ea Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 6 Feb 2024 10:00:33 +0700 Subject: [PATCH 090/128] fix back loop between expensify card and active card page --- src/pages/settings/Wallet/ActivatePhysicalCardPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Wallet/ActivatePhysicalCardPage.js b/src/pages/settings/Wallet/ActivatePhysicalCardPage.js index 947252649cc4..649e42bfffbe 100644 --- a/src/pages/settings/Wallet/ActivatePhysicalCardPage.js +++ b/src/pages/settings/Wallet/ActivatePhysicalCardPage.js @@ -133,7 +133,7 @@ function ActivatePhysicalCardPage({ return ( Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAINCARD.getRoute(domain))} + onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET_DOMAINCARD.getRoute(domain))} backgroundColor={theme.PAGE_THEMES[SCREENS.SETTINGS.PREFERENCES.ROOT].backgroundColor} illustration={LottieAnimations.Magician} scrollViewContainerStyles={[styles.mnh100]} From 3aa35d27473f9cc671adc5dbac63cbc026c27ff3 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 6 Feb 2024 12:43:25 +0800 Subject: [PATCH 091/128] memoize the sections --- src/components/ValuePicker/ValueSelectorModal.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/ValuePicker/ValueSelectorModal.js b/src/components/ValuePicker/ValueSelectorModal.js index e45ba873d8a3..34a84d7595ea 100644 --- a/src/components/ValuePicker/ValueSelectorModal.js +++ b/src/components/ValuePicker/ValueSelectorModal.js @@ -1,6 +1,6 @@ import _ from 'lodash'; import PropTypes from 'prop-types'; -import React, {useEffect, useState} from 'react'; +import React, {useEffect, useMemo, useState} from 'react'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Modal from '@components/Modal'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -42,11 +42,9 @@ const defaultProps = { function ValueSelectorModal({items, selectedItem, label, isVisible, onClose, onItemSelected, shouldShowTooltips}) { const styles = useThemeStyles(); - const [sectionsData, setSectionsData] = useState([]); - - useEffect(() => { + const sections = useMemo(() => { const itemsData = _.map(items, (item) => ({value: item.value, alternateText: item.description, keyForList: item.value, text: item.label, isSelected: item === selectedItem})); - setSectionsData(itemsData); + return [{data: itemsData}]; }, [items, selectedItem]); return ( @@ -69,7 +67,7 @@ function ValueSelectorModal({items, selectedItem, label, isVisible, onClose, onI onBackButtonPress={onClose} /> Date: Tue, 6 Feb 2024 13:03:08 +0800 Subject: [PATCH 092/128] remove unused import --- src/components/ValuePicker/ValueSelectorModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ValuePicker/ValueSelectorModal.js b/src/components/ValuePicker/ValueSelectorModal.js index 34a84d7595ea..f93df86c9ab9 100644 --- a/src/components/ValuePicker/ValueSelectorModal.js +++ b/src/components/ValuePicker/ValueSelectorModal.js @@ -1,6 +1,6 @@ import _ from 'lodash'; import PropTypes from 'prop-types'; -import React, {useEffect, useMemo, useState} from 'react'; +import React, {useMemo} from 'react'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Modal from '@components/Modal'; import ScreenWrapper from '@components/ScreenWrapper'; From bc59ba19e2eaf0a178e5fe97b444c2c82b9d54c0 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 6 Feb 2024 15:20:19 +0800 Subject: [PATCH 093/128] clear pending action when fails --- src/libs/actions/IOU.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 569b6b26b728..9b1ffb4433ca 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -2808,6 +2808,7 @@ function deleteMoneyRequest(transactionID: string, reportAction: OnyxTypes.Repor value: { [reportPreviewAction?.reportActionID ?? '']: { ...reportPreviewAction, + pendingAction: null, errors: ErrorUtils.getMicroSecondOnyxError('iou.error.genericDeleteFailureMessage'), }, }, From 7f6464b71b45de412f54819fc85c3978b4419cde Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 6 Feb 2024 11:01:28 +0100 Subject: [PATCH 094/128] commit podfile.lock --- ios/Podfile.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ad1826d1c8e6..d90b48f1fd7b 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1178,10 +1178,6 @@ PODS: - React-Core - react-native-launch-arguments (4.0.2): - React - - react-native-live-markdown (0.1.0): - - glog - - RCT-Folly (= 2022.05.16.00) - - React-Core - react-native-netinfo (11.2.1): - React-Core - react-native-pager-view (6.2.2): @@ -1412,6 +1408,10 @@ PODS: - RNGoogleSignin (10.0.1): - GoogleSignIn (~> 7.0) - React-Core + - RNLiveMarkdown (0.1.0): + - glog + - RCT-Folly (= 2022.05.16.00) + - React-Core - RNLocalize (2.2.6): - React-Core - rnmapbox-maps (10.0.11): @@ -1453,7 +1453,7 @@ PODS: - SDWebImage/Core (~> 5.17) - SocketRocket (0.6.1) - Turf (2.7.0) - - VisionCamera (2.16.2): + - VisionCamera (2.16.5): - React - React-callinvoker - React-Core @@ -1529,7 +1529,6 @@ DEPENDENCIES: - react-native-image-picker (from `../node_modules/react-native-image-picker`) - react-native-key-command (from `../node_modules/react-native-key-command`) - react-native-launch-arguments (from `../node_modules/react-native-launch-arguments`) - - "react-native-live-markdown (from `../node_modules/@expensify/react-native-live-markdown`)" - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-pager-view (from `../node_modules/react-native-pager-view`) - react-native-pdf (from `../node_modules/react-native-pdf`) @@ -1574,6 +1573,7 @@ DEPENDENCIES: - RNFS (from `../node_modules/react-native-fs`) - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - "RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)" + - "RNLiveMarkdown (from `../node_modules/@expensify/react-native-live-markdown`)" - RNLocalize (from `../node_modules/react-native-localize`) - "rnmapbox-maps (from `../node_modules/@rnmapbox/maps`)" - RNPermissions (from `../node_modules/react-native-permissions`) @@ -1725,8 +1725,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-key-command" react-native-launch-arguments: :path: "../node_modules/react-native-launch-arguments" - react-native-live-markdown: - :path: "../node_modules/@expensify/react-native-live-markdown" react-native-netinfo: :path: "../node_modules/@react-native-community/netinfo" react-native-pager-view: @@ -1815,6 +1813,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-gesture-handler" RNGoogleSignin: :path: "../node_modules/@react-native-google-signin/google-signin" + RNLiveMarkdown: + :path: "../node_modules/@expensify/react-native-live-markdown" RNLocalize: :path: "../node_modules/react-native-localize" rnmapbox-maps: @@ -1922,7 +1922,6 @@ SPEC CHECKSUMS: react-native-image-picker: c33d4e79f0a14a2b66e5065e14946ae63749660b react-native-key-command: 5af6ee30ff4932f78da6a2109017549042932aa5 react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d - react-native-live-markdown: 81ac491b913cb8541a06586adcdc159ab1b86fb5 react-native-netinfo: 8a7fd3f7130ef4ad2fb4276d5c9f8d3f28d2df3d react-native-pager-view: 02a5c4962530f7efc10dd51ee9cdabeff5e6c631 react-native-pdf: b4ca3d37a9a86d9165287741c8b2ef4d8940c00e @@ -1967,6 +1966,7 @@ SPEC CHECKSUMS: RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 25b969a1ffc806b9f9ad2e170d4a3b049c6af85e RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 + RNLiveMarkdown: 374e9adef7a46145b6de4a727ca8c814e38ce58a RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 rnmapbox-maps: 6f638ec002aa6e906a6f766d69cd45f968d98e64 RNPermissions: 9b086c8f05b2e2faa587fdc31f4c5ab4509728aa @@ -1980,9 +1980,9 @@ SPEC CHECKSUMS: SDWebImageWebPCoder: af09429398d99d524cae2fe00f6f0f6e491ed102 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2 - VisionCamera: 7d13aae043ffb38b224a0f725d1e23ca9c190fe7 + VisionCamera: fda554d8751e395effcc87749f8b7c198c1031be Yoga: e64aa65de36c0832d04e8c7bd614396c77a80047 PODFILE CHECKSUM: 0ccbb4f2406893c6e9f266dc1e7470dcd72885d2 -COCOAPODS: 1.13.0 +COCOAPODS: 1.14.3 From 46a7474842ed4b7a38be2f7603f769215f2905c9 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 6 Feb 2024 11:39:38 +0100 Subject: [PATCH 095/128] commit podfile.lock --- ios/Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d90b48f1fd7b..98a2e0b67160 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1981,8 +1981,8 @@ SPEC CHECKSUMS: SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Turf: 13d1a92d969ca0311bbc26e8356cca178ce95da2 VisionCamera: fda554d8751e395effcc87749f8b7c198c1031be - Yoga: e64aa65de36c0832d04e8c7bd614396c77a80047 + Yoga: 13c8ef87792450193e117976337b8527b49e8c03 PODFILE CHECKSUM: 0ccbb4f2406893c6e9f266dc1e7470dcd72885d2 -COCOAPODS: 1.14.3 +COCOAPODS: 1.13.0 From 55ea149fab8084264fc9a1fbc54826cc07a71cf9 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Tue, 6 Feb 2024 12:03:29 +0100 Subject: [PATCH 096/128] update podfile.lock --- ios/Podfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 98a2e0b67160..1664c982ce50 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1178,6 +1178,10 @@ PODS: - React-Core - react-native-launch-arguments (4.0.2): - React + - react-native-live-markdown (0.1.0): + - glog + - RCT-Folly (= 2022.05.16.00) + - React-Core - react-native-netinfo (11.2.1): - React-Core - react-native-pager-view (6.2.2): @@ -1408,10 +1412,6 @@ PODS: - RNGoogleSignin (10.0.1): - GoogleSignIn (~> 7.0) - React-Core - - RNLiveMarkdown (0.1.0): - - glog - - RCT-Folly (= 2022.05.16.00) - - React-Core - RNLocalize (2.2.6): - React-Core - rnmapbox-maps (10.0.11): @@ -1529,6 +1529,7 @@ DEPENDENCIES: - react-native-image-picker (from `../node_modules/react-native-image-picker`) - react-native-key-command (from `../node_modules/react-native-key-command`) - react-native-launch-arguments (from `../node_modules/react-native-launch-arguments`) + - "react-native-live-markdown (from `../node_modules/@expensify/react-native-live-markdown`)" - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-pager-view (from `../node_modules/react-native-pager-view`) - react-native-pdf (from `../node_modules/react-native-pdf`) @@ -1573,7 +1574,6 @@ DEPENDENCIES: - RNFS (from `../node_modules/react-native-fs`) - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - "RNGoogleSignin (from `../node_modules/@react-native-google-signin/google-signin`)" - - "RNLiveMarkdown (from `../node_modules/@expensify/react-native-live-markdown`)" - RNLocalize (from `../node_modules/react-native-localize`) - "rnmapbox-maps (from `../node_modules/@rnmapbox/maps`)" - RNPermissions (from `../node_modules/react-native-permissions`) @@ -1725,6 +1725,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-key-command" react-native-launch-arguments: :path: "../node_modules/react-native-launch-arguments" + react-native-live-markdown: + :path: "../node_modules/@expensify/react-native-live-markdown" react-native-netinfo: :path: "../node_modules/@react-native-community/netinfo" react-native-pager-view: @@ -1813,8 +1815,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-gesture-handler" RNGoogleSignin: :path: "../node_modules/@react-native-google-signin/google-signin" - RNLiveMarkdown: - :path: "../node_modules/@expensify/react-native-live-markdown" RNLocalize: :path: "../node_modules/react-native-localize" rnmapbox-maps: @@ -1922,6 +1922,7 @@ SPEC CHECKSUMS: react-native-image-picker: c33d4e79f0a14a2b66e5065e14946ae63749660b react-native-key-command: 5af6ee30ff4932f78da6a2109017549042932aa5 react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d + react-native-live-markdown: 81ac491b913cb8541a06586adcdc159ab1b86fb5 react-native-netinfo: 8a7fd3f7130ef4ad2fb4276d5c9f8d3f28d2df3d react-native-pager-view: 02a5c4962530f7efc10dd51ee9cdabeff5e6c631 react-native-pdf: b4ca3d37a9a86d9165287741c8b2ef4d8940c00e @@ -1966,7 +1967,6 @@ SPEC CHECKSUMS: RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 25b969a1ffc806b9f9ad2e170d4a3b049c6af85e RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 - RNLiveMarkdown: 374e9adef7a46145b6de4a727ca8c814e38ce58a RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 rnmapbox-maps: 6f638ec002aa6e906a6f766d69cd45f968d98e64 RNPermissions: 9b086c8f05b2e2faa587fdc31f4c5ab4509728aa From e45d6e0865ccbfd814a7762bf7401938fa494a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20M=C3=B3rawski?= Date: Tue, 6 Feb 2024 12:58:31 +0100 Subject: [PATCH 097/128] simplifying referral CTA dismissing --- src/components/ReferralProgramCTA.tsx | 32 ++- src/pages/SearchPage.js | 227 ---------------------- src/pages/SearchPage/SearchPageFooter.tsx | 37 +--- 3 files changed, 31 insertions(+), 265 deletions(-) delete mode 100755 src/pages/SearchPage.js diff --git a/src/components/ReferralProgramCTA.tsx b/src/components/ReferralProgramCTA.tsx index f1c7539cc6b5..4e0ed1f573f9 100644 --- a/src/components/ReferralProgramCTA.tsx +++ b/src/components/ReferralProgramCTA.tsx @@ -1,32 +1,45 @@ import React from 'react'; +import {withOnyx} from 'react-native-onyx'; import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; +import * as User from '@userActions/User'; import CONST from '@src/CONST'; import Navigation from '@src/libs/Navigation/Navigation'; +import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; +import type {DismissedReferralBanners} from '@src/types/onyx/Account'; import Icon from './Icon'; import {Close} from './Icon/Expensicons'; import {PressableWithoutFeedback} from './Pressable'; import Text from './Text'; import Tooltip from './Tooltip'; -type ReferralProgramCTAProps = { +type ReferralProgramCTAOnyxProps = { + dismissedReferralBanners: DismissedReferralBanners; +}; + +type ReferralProgramCTAProps = ReferralProgramCTAOnyxProps & { referralContentType: | typeof CONST.REFERRAL_PROGRAM.CONTENT_TYPES.MONEY_REQUEST | typeof CONST.REFERRAL_PROGRAM.CONTENT_TYPES.START_CHAT | typeof CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SEND_MONEY | typeof CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND; - - /** Method to trigger when pressing close button of the banner */ - onCloseButtonPress?: () => void; }; -function ReferralProgramCTA({referralContentType, onCloseButtonPress = () => {}}: ReferralProgramCTAProps) { +function ReferralProgramCTA({referralContentType, dismissedReferralBanners}: ReferralProgramCTAProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); const theme = useTheme(); + const handleDismissCallToAction = () => { + User.dismissReferralBanner(CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND); + }; + + if (!referralContentType || dismissedReferralBanners[referralContentType]) { + return null; + } + return ( { @@ -47,7 +60,7 @@ function ReferralProgramCTA({referralContentType, onCloseButtonPress = () => {}} { e.preventDefault(); }} @@ -67,4 +80,9 @@ function ReferralProgramCTA({referralContentType, onCloseButtonPress = () => {}} ); } -export default ReferralProgramCTA; +export default withOnyx({ + dismissedReferralBanners: { + key: ONYXKEYS.ACCOUNT, + selector: (data) => data?.dismissedReferralBanners ?? {}, + }, +})(ReferralProgramCTA); diff --git a/src/pages/SearchPage.js b/src/pages/SearchPage.js deleted file mode 100755 index d8eef6f447ae..000000000000 --- a/src/pages/SearchPage.js +++ /dev/null @@ -1,227 +0,0 @@ -import PropTypes from 'prop-types'; -import React, {useCallback, useEffect, useRef, useState} from 'react'; -import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; -import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import OptionsSelector from '@components/OptionsSelector'; -import ScreenWrapper from '@components/ScreenWrapper'; -import useLocalize from '@hooks/useLocalize'; -import useNetwork from '@hooks/useNetwork'; -import useThemeStyles from '@hooks/useThemeStyles'; -import Navigation from '@libs/Navigation/Navigation'; -import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Performance from '@libs/Performance'; -import * as ReportUtils from '@libs/ReportUtils'; -import * as Report from '@userActions/Report'; -import Timing from '@userActions/Timing'; -import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; -import personalDetailsPropType from './personalDetailsPropType'; -import reportPropTypes from './reportPropTypes'; - -const propTypes = { - /* Onyx Props */ - - /** Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), - - /** All of the personal details for everyone */ - personalDetails: PropTypes.objectOf(personalDetailsPropType), - - /** All reports shared with the user */ - reports: PropTypes.objectOf(reportPropTypes), - - /** Whether we are searching for reports in the server */ - isSearchingForReports: PropTypes.bool, - - /** - * The navigation prop passed by the navigator. - * - * This is required because transitionEnd event doesn't trigger in the automated testing environment. - */ - navigation: PropTypes.shape({}), -}; - -const defaultProps = { - betas: [], - personalDetails: {}, - reports: {}, - isSearchingForReports: false, - navigation: {}, -}; - -function SearchPage({betas, personalDetails, reports, isSearchingForReports, navigation}) { - const [searchValue, setSearchValue] = useState(''); - const [searchOptions, setSearchOptions] = useState({ - recentReports: {}, - personalDetails: {}, - userToInvite: {}, - }); - - const {isOffline} = useNetwork(); - const {translate} = useLocalize(); - const themeStyles = useThemeStyles(); - const isMounted = useRef(false); - - const updateOptions = useCallback(() => { - const { - recentReports: localRecentReports, - personalDetails: localPersonalDetails, - userToInvite: localUserToInvite, - } = OptionsListUtils.getSearchOptions(reports, personalDetails, searchValue.trim(), betas); - - setSearchOptions({ - recentReports: localRecentReports, - personalDetails: localPersonalDetails, - userToInvite: localUserToInvite, - }); - }, [reports, personalDetails, searchValue, betas]); - - useEffect(() => { - Timing.start(CONST.TIMING.SEARCH_RENDER); - Performance.markStart(CONST.TIMING.SEARCH_RENDER); - }, []); - - useEffect(() => { - updateOptions(); - }, [reports, personalDetails, betas, updateOptions]); - - useEffect(() => { - if (!isMounted.current) { - isMounted.current = true; - return; - } - - updateOptions(); - // Ignoring the rule intentionally, we want to run the code only when search Value changes to prevent additional runs. - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [searchValue]); - - /** - * Returns the sections needed for the OptionsSelector - * - * @returns {Array} - */ - const getSections = () => { - const sections = []; - let indexOffset = 0; - - if (searchOptions.recentReports.length > 0) { - sections.push({ - data: searchOptions.recentReports, - shouldShow: true, - indexOffset, - }); - indexOffset += searchOptions.recentReports.length; - } - - if (searchOptions.personalDetails.length > 0) { - sections.push({ - data: searchOptions.personalDetails, - shouldShow: true, - indexOffset, - }); - indexOffset += searchOptions.recentReports.length; - } - - if (searchOptions.userToInvite) { - sections.push({ - data: [searchOptions.userToInvite], - shouldShow: true, - indexOffset, - }); - } - - return sections; - }; - - const searchRendered = () => { - Timing.end(CONST.TIMING.SEARCH_RENDER); - Performance.markEnd(CONST.TIMING.SEARCH_RENDER); - }; - - const onChangeText = (value = '') => { - Report.searchInServer(searchValue); - setSearchValue(value); - }; - - /** - * Reset the search value and redirect to the selected report - * - * @param {Object} option - */ - const selectReport = (option) => { - if (!option) { - return; - } - if (option.reportID) { - Navigation.dismissModal(option.reportID); - } else { - Report.navigateToAndOpenReport([option.login]); - } - }; - - const isOptionsDataReady = ReportUtils.isReportDataReady() && OptionsListUtils.isPersonalDetailsReady(personalDetails); - const headerMessage = OptionsListUtils.getHeaderMessage( - searchOptions.recentReports.length + searchOptions.personalDetails.length !== 0, - Boolean(searchOptions.userToInvite), - searchValue, - ); - - return ( - - {({didScreenTransitionEnd, safeAreaPaddingBottomStyle}) => ( - <> - - - - - - )} - - ); -} - -SearchPage.propTypes = propTypes; -SearchPage.defaultProps = defaultProps; -SearchPage.displayName = 'SearchPage'; -export default withOnyx({ - reports: { - key: ONYXKEYS.COLLECTION.REPORT, - }, - personalDetails: { - key: ONYXKEYS.PERSONAL_DETAILS_LIST, - }, - betas: { - key: ONYXKEYS.BETAS, - }, - isSearchingForReports: { - key: ONYXKEYS.IS_SEARCHING_FOR_REPORTS, - initWithStoredValues: false, - }, -})(SearchPage); diff --git a/src/pages/SearchPage/SearchPageFooter.tsx b/src/pages/SearchPage/SearchPageFooter.tsx index fcc04d8bc5af..3d5ebfd2c193 100644 --- a/src/pages/SearchPage/SearchPageFooter.tsx +++ b/src/pages/SearchPage/SearchPageFooter.tsx @@ -1,44 +1,19 @@ -import React, {useState} from 'react'; +import React from 'react'; import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; import ReferralProgramCTA from '@components/ReferralProgramCTA'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as User from '@userActions/User'; import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; -import type {DismissedReferralBanners} from '@src/types/onyx/Account'; -type SearchPageFooterOnyxProps = { - dismissedReferralBanners: DismissedReferralBanners; -}; -function SearchPageFooter({dismissedReferralBanners}: SearchPageFooterOnyxProps) { - const [shouldShowReferralCTA, setShouldShowReferralCTA] = useState(!dismissedReferralBanners[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND]); +function SearchPageFooter() { const themeStyles = useThemeStyles(); - const closeCallToActionBanner = () => { - setShouldShowReferralCTA(false); - User.dismissReferralBanner(CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND); - }; - return ( - <> - {shouldShowReferralCTA && ( - - - - )} - + + + ); } SearchPageFooter.displayName = 'SearchPageFooter'; -export default withOnyx({ - dismissedReferralBanners: { - key: ONYXKEYS.ACCOUNT, - selector: (data) => data?.dismissedReferralBanners ?? {}, - }, -})(SearchPageFooter); +export default SearchPageFooter; From 2c3185c3f2c409289db361f86bc440e5c8b9cb54 Mon Sep 17 00:00:00 2001 From: someone-here Date: Tue, 6 Feb 2024 19:33:56 +0530 Subject: [PATCH 098/128] Fix header for room description --- src/components/DisplayNames/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/DisplayNames/index.tsx b/src/components/DisplayNames/index.tsx index 28e4d131d6de..8031842cc56e 100644 --- a/src/components/DisplayNames/index.tsx +++ b/src/components/DisplayNames/index.tsx @@ -26,6 +26,7 @@ function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, sho fullTitle={title} textStyles={textStyles} numberOfLines={numberOfLines} + renderAdditionalText={renderAdditionalText} /> ); } From 582ee3f2dc04db0caeb7b0342b1b556e39404153 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 6 Feb 2024 15:24:57 +0000 Subject: [PATCH 099/128] Update version to 1.4.37-2 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 7318b5b6d3ff..e179b59f4b30 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043701 - versionName "1.4.37-1" + versionCode 1001043702 + versionName "1.4.37-2" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index f8bf6953b9bf..b529bbbcd100 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.37.1 + 1.4.37.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index cef9024b8744..af5704061df2 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.37.1 + 1.4.37.2 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index c1f74b80085d..8209491d19ff 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.37 CFBundleVersion - 1.4.37.1 + 1.4.37.2 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index ac335fd12eb2..3420537495cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.37-1", + "version": "1.4.37-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.37-1", + "version": "1.4.37-2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 9cf4ec00727a..df55afd56e40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.37-1", + "version": "1.4.37-2", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From b19b85744b5627bf87181eb9be65c1ec813922a4 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Tue, 6 Feb 2024 17:11:25 +0100 Subject: [PATCH 100/128] Fix crash on iOS if requestAmount is 0 --- src/components/ReportActionItem/MoneyRequestPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestPreview.tsx b/src/components/ReportActionItem/MoneyRequestPreview.tsx index f321c63375d0..70a313c77e9e 100644 --- a/src/components/ReportActionItem/MoneyRequestPreview.tsx +++ b/src/components/ReportActionItem/MoneyRequestPreview.tsx @@ -321,7 +321,7 @@ function MoneyRequestPreview({ {shouldShowDescription && } {shouldShowMerchant && {merchantOrDescription}} - {isBillSplit && participantAccountIDs.length > 0 && requestAmount && requestAmount > 0 && ( + {isBillSplit && participantAccountIDs.length > 0 && !!requestAmount && requestAmount > 0 && ( {translate('iou.amountEach', { amount: CurrencyUtils.convertToDisplayString( From e4d0d92a2293e21abf9a4d60cd3ccf7e1a0f17b6 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Tue, 6 Feb 2024 18:27:35 +0200 Subject: [PATCH 101/128] Fix warning on the server --- src/libs/actions/IOU.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index a7a82e642e62..4e43b16b6ccf 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -3071,7 +3071,7 @@ function getSendMoneyParams( paymentMethodType, transactionID: optimisticTransaction.transactionID, newIOUReportDetails, - createdReportActionID: isNewChat ? optimisticCreatedAction.reportActionID : '', + createdReportActionID: isNewChat ? optimisticCreatedAction.reportActionID : '0', reportPreviewReportActionID: reportPreviewAction.reportActionID, }, optimisticData, From cadc4967bf9d94884e5e0e31c0fb2eeb531b28c2 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 6 Feb 2024 11:43:11 -0500 Subject: [PATCH 102/128] fix lint on main --- src/components/MenuItem.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index 0bf649b54a6e..4d7089fb24bd 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -384,7 +384,11 @@ function MenuItem( onPress(event); return; } - singleExecution(waitForNavigate(() => onPress(event)))(); + singleExecution( + waitForNavigate(() => { + onPress(event); + }), + )(); } }; From 3199e7e225f1469f10c2447c158d5e04f42b1945 Mon Sep 17 00:00:00 2001 From: Filip Solecki Date: Tue, 6 Feb 2024 18:15:48 +0100 Subject: [PATCH 103/128] Fix after regression --- src/pages/ShareCodePage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/ShareCodePage.tsx b/src/pages/ShareCodePage.tsx index 831f0eb8f1d8..dcfb9f6861bf 100644 --- a/src/pages/ShareCodePage.tsx +++ b/src/pages/ShareCodePage.tsx @@ -109,7 +109,8 @@ function ShareCodePage({report, session, currentUserPersonalDetails}: ShareCodeP isAnonymousAction title={translate('common.download')} icon={Expensicons.Download} - onPress={qrCodeRef.current?.download} + // eslint-disable-next-line @typescript-eslint/no-misused-promises + onPress={() => qrCodeRef.current?.download?.()} /> )} From 6f8a5d555b0caa52135a2d7f2876fc74be6a7fd0 Mon Sep 17 00:00:00 2001 From: caitlinwhite1 Date: Tue, 6 Feb 2024 11:28:33 -0600 Subject: [PATCH 104/128] update Account Settings to Settings --- docs/_data/_routes.yml | 4 ++-- .../{account-settings => Settings}/Account-Details.md | 0 .../{account-settings => Settings}/Close-Account.md | 0 .../{account-settings => Settings}/Copilot.md | 0 .../{account-settings => Settings}/Merge-Accounts.md | 0 .../Notification-Troubleshooting.md | 0 .../{account-settings => Settings}/Preferences.md | 0 .../hubs/{account-settings => settings}/index.html | 0 8 files changed, 2 insertions(+), 2 deletions(-) rename docs/articles/expensify-classic/{account-settings => Settings}/Account-Details.md (100%) rename docs/articles/expensify-classic/{account-settings => Settings}/Close-Account.md (100%) rename docs/articles/expensify-classic/{account-settings => Settings}/Copilot.md (100%) rename docs/articles/expensify-classic/{account-settings => Settings}/Merge-Accounts.md (100%) rename docs/articles/expensify-classic/{account-settings => Settings}/Notification-Troubleshooting.md (100%) rename docs/articles/expensify-classic/{account-settings => Settings}/Preferences.md (100%) rename docs/expensify-classic/hubs/{account-settings => settings}/index.html (100%) diff --git a/docs/_data/_routes.yml b/docs/_data/_routes.yml index 33ef4ebcf0a8..d355e53d8a52 100644 --- a/docs/_data/_routes.yml +++ b/docs/_data/_routes.yml @@ -19,8 +19,8 @@ platforms: icon: /assets/images/accounting.svg description: From setting up your account to ensuring you get the most out of Expensify’s suite of features, click here to get started on streamlining your expense management journey. - - href: account-settings - title: Account Settings + - href: settings + title: Settings icon: /assets/images/gears.svg description: Discover how to personalize your profile, add secondary logins, and grant delegated access to employees with our comprehensive guide on Account Settings. diff --git a/docs/articles/expensify-classic/account-settings/Account-Details.md b/docs/articles/expensify-classic/Settings/Account-Details.md similarity index 100% rename from docs/articles/expensify-classic/account-settings/Account-Details.md rename to docs/articles/expensify-classic/Settings/Account-Details.md diff --git a/docs/articles/expensify-classic/account-settings/Close-Account.md b/docs/articles/expensify-classic/Settings/Close-Account.md similarity index 100% rename from docs/articles/expensify-classic/account-settings/Close-Account.md rename to docs/articles/expensify-classic/Settings/Close-Account.md diff --git a/docs/articles/expensify-classic/account-settings/Copilot.md b/docs/articles/expensify-classic/Settings/Copilot.md similarity index 100% rename from docs/articles/expensify-classic/account-settings/Copilot.md rename to docs/articles/expensify-classic/Settings/Copilot.md diff --git a/docs/articles/expensify-classic/account-settings/Merge-Accounts.md b/docs/articles/expensify-classic/Settings/Merge-Accounts.md similarity index 100% rename from docs/articles/expensify-classic/account-settings/Merge-Accounts.md rename to docs/articles/expensify-classic/Settings/Merge-Accounts.md diff --git a/docs/articles/expensify-classic/account-settings/Notification-Troubleshooting.md b/docs/articles/expensify-classic/Settings/Notification-Troubleshooting.md similarity index 100% rename from docs/articles/expensify-classic/account-settings/Notification-Troubleshooting.md rename to docs/articles/expensify-classic/Settings/Notification-Troubleshooting.md diff --git a/docs/articles/expensify-classic/account-settings/Preferences.md b/docs/articles/expensify-classic/Settings/Preferences.md similarity index 100% rename from docs/articles/expensify-classic/account-settings/Preferences.md rename to docs/articles/expensify-classic/Settings/Preferences.md diff --git a/docs/expensify-classic/hubs/account-settings/index.html b/docs/expensify-classic/hubs/settings/index.html similarity index 100% rename from docs/expensify-classic/hubs/account-settings/index.html rename to docs/expensify-classic/hubs/settings/index.html From 541d7ef6818f832e49836866e536fe45b925c0dc Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Tue, 6 Feb 2024 19:29:55 +0200 Subject: [PATCH 105/128] Fix 2 more fallback ids --- src/libs/actions/IOU.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index dd118c36a8a1..d23a52088642 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -918,7 +918,7 @@ function createDistanceRequest( // If the report is an iou or expense report, we should get the linked chat report to be passed to the getMoneyRequestInformation function const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); const currentChatReport = isMoneyRequestReport ? ReportUtils.getReport(report.chatReportID) : report; - const moneyRequestReportID = isMoneyRequestReport ? report.reportID : ''; + const moneyRequestReportID = isMoneyRequestReport ? report.reportID : '0'; const currentCreated = DateUtils.enrichMoneyRequestTimestamp(created); const optimisticReceipt: Receipt = { @@ -1276,7 +1276,7 @@ function requestMoney( // If the report is iou or expense report, we should get the linked chat report to be passed to the getMoneyRequestInformation function const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); const currentChatReport = isMoneyRequestReport ? ReportUtils.getReport(report.chatReportID) : report; - const moneyRequestReportID = isMoneyRequestReport ? report.reportID : ''; + const moneyRequestReportID = isMoneyRequestReport ? report.reportID : '0'; const currentCreated = DateUtils.enrichMoneyRequestTimestamp(created); const {payerAccountID, payerEmail, iouReport, chatReport, transaction, iouAction, createdChatReportActionID, createdIOUReportActionID, reportPreviewAction, onyxData} = getMoneyRequestInformation( From 0736a70e0ff318a527ced47c1c8436921b08e99a Mon Sep 17 00:00:00 2001 From: caitlinwhite1 Date: Tue, 6 Feb 2024 12:04:54 -0600 Subject: [PATCH 106/128] updating Settings to settings --- .../expensify-classic/{Settings => settings}/Account-Details.md | 0 .../expensify-classic/{Settings => settings}/Close-Account.md | 0 docs/articles/expensify-classic/{Settings => settings}/Copilot.md | 0 .../expensify-classic/{Settings => settings}/Merge-Accounts.md | 0 .../{Settings => settings}/Notification-Troubleshooting.md | 0 .../expensify-classic/{Settings => settings}/Preferences.md | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename docs/articles/expensify-classic/{Settings => settings}/Account-Details.md (100%) rename docs/articles/expensify-classic/{Settings => settings}/Close-Account.md (100%) rename docs/articles/expensify-classic/{Settings => settings}/Copilot.md (100%) rename docs/articles/expensify-classic/{Settings => settings}/Merge-Accounts.md (100%) rename docs/articles/expensify-classic/{Settings => settings}/Notification-Troubleshooting.md (100%) rename docs/articles/expensify-classic/{Settings => settings}/Preferences.md (100%) diff --git a/docs/articles/expensify-classic/Settings/Account-Details.md b/docs/articles/expensify-classic/settings/Account-Details.md similarity index 100% rename from docs/articles/expensify-classic/Settings/Account-Details.md rename to docs/articles/expensify-classic/settings/Account-Details.md diff --git a/docs/articles/expensify-classic/Settings/Close-Account.md b/docs/articles/expensify-classic/settings/Close-Account.md similarity index 100% rename from docs/articles/expensify-classic/Settings/Close-Account.md rename to docs/articles/expensify-classic/settings/Close-Account.md diff --git a/docs/articles/expensify-classic/Settings/Copilot.md b/docs/articles/expensify-classic/settings/Copilot.md similarity index 100% rename from docs/articles/expensify-classic/Settings/Copilot.md rename to docs/articles/expensify-classic/settings/Copilot.md diff --git a/docs/articles/expensify-classic/Settings/Merge-Accounts.md b/docs/articles/expensify-classic/settings/Merge-Accounts.md similarity index 100% rename from docs/articles/expensify-classic/Settings/Merge-Accounts.md rename to docs/articles/expensify-classic/settings/Merge-Accounts.md diff --git a/docs/articles/expensify-classic/Settings/Notification-Troubleshooting.md b/docs/articles/expensify-classic/settings/Notification-Troubleshooting.md similarity index 100% rename from docs/articles/expensify-classic/Settings/Notification-Troubleshooting.md rename to docs/articles/expensify-classic/settings/Notification-Troubleshooting.md diff --git a/docs/articles/expensify-classic/Settings/Preferences.md b/docs/articles/expensify-classic/settings/Preferences.md similarity index 100% rename from docs/articles/expensify-classic/Settings/Preferences.md rename to docs/articles/expensify-classic/settings/Preferences.md From 2831fef789dfab1114f965037243425650128b0d Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Tue, 6 Feb 2024 19:13:01 +0100 Subject: [PATCH 107/128] Fix condition evaluation to false due to param being a string --- src/components/ReportActionItem/MoneyRequestAction.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestAction.tsx b/src/components/ReportActionItem/MoneyRequestAction.tsx index ff29bf5b0ee8..82098b52f2c3 100644 --- a/src/components/ReportActionItem/MoneyRequestAction.tsx +++ b/src/components/ReportActionItem/MoneyRequestAction.tsx @@ -92,7 +92,7 @@ function MoneyRequestAction({ } // If the childReportID is not present, we need to create a new thread - const childReportID = action?.childReportID ?? '0'; + const childReportID = action?.childReportID ?? 0; if (!childReportID) { const thread = ReportUtils.buildTransactionThread(action, requestReportID); const userLogins = PersonalDetailsUtils.getLoginsByAccountIDs(thread.participantAccountIDs ?? []); From 19c11c852c3b06f0eeeacc62ed7f571da2f89a70 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Tue, 6 Feb 2024 20:29:16 +0200 Subject: [PATCH 108/128] Revert last change --- src/libs/actions/IOU.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index d23a52088642..dd118c36a8a1 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -918,7 +918,7 @@ function createDistanceRequest( // If the report is an iou or expense report, we should get the linked chat report to be passed to the getMoneyRequestInformation function const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); const currentChatReport = isMoneyRequestReport ? ReportUtils.getReport(report.chatReportID) : report; - const moneyRequestReportID = isMoneyRequestReport ? report.reportID : '0'; + const moneyRequestReportID = isMoneyRequestReport ? report.reportID : ''; const currentCreated = DateUtils.enrichMoneyRequestTimestamp(created); const optimisticReceipt: Receipt = { @@ -1276,7 +1276,7 @@ function requestMoney( // If the report is iou or expense report, we should get the linked chat report to be passed to the getMoneyRequestInformation function const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); const currentChatReport = isMoneyRequestReport ? ReportUtils.getReport(report.chatReportID) : report; - const moneyRequestReportID = isMoneyRequestReport ? report.reportID : '0'; + const moneyRequestReportID = isMoneyRequestReport ? report.reportID : ''; const currentCreated = DateUtils.enrichMoneyRequestTimestamp(created); const {payerAccountID, payerEmail, iouReport, chatReport, transaction, iouAction, createdChatReportActionID, createdIOUReportActionID, reportPreviewAction, onyxData} = getMoneyRequestInformation( From e7aeb33a2be77e1aade12dbef96dd73082017480 Mon Sep 17 00:00:00 2001 From: caitlinwhite1 Date: Tue, 6 Feb 2024 12:29:26 -0600 Subject: [PATCH 109/128] Update redirects.csv a link to expensify.com was breaking everything, updating to useDot link --- docs/redirects.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/redirects.csv b/docs/redirects.csv index 988b07d729f0..f30157e19916 100644 --- a/docs/redirects.csv +++ b/docs/redirects.csv @@ -48,5 +48,5 @@ https://community.expensify.com/discussion/4463/how-to-remove-or-manage-settings https://community.expensify.com/discussion/5793/how-to-connect-your-personal-card-to-import-expenses,https://help.expensify.com/articles/expensify-classic/bank-accounts-and-credit-cards/Personal-Credit-Cards https://community.expensify.com/discussion/4826/how-to-set-your-annual-subscription-size,https://help.expensify.com/articles/expensify-classic/billing-and-subscriptions/Annual-Subscription https://community.expensify.com/discussion/5667/deep-dive-how-does-the-annual-subscription-billing-work,https://help.expensify.com/articles/expensify-classic/billing-and-subscriptions/Annual-Subscription -https://help.expensify.com/expensify-classic/hubs/getting-started/plan-types,https://www.expensify.com/pricing +https://help.expensify.com/expensify-classic/hubs/getting-started/plan-types,https://use.expensify.com/ https://help.expensify.com/articles/expensify-classic/getting-started/Employees,https://help.expensify.com/articles/expensify-classic/getting-started/Join-your-company's-workspace From 6c2abde357968c1d38730cd379b3fd654130e766 Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Tue, 6 Feb 2024 19:35:22 +0100 Subject: [PATCH 110/128] Update src/components/ReportActionItem/MoneyRequestAction.tsx Co-authored-by: Aldo Canepa Garay <87341702+aldo-expensify@users.noreply.github.com> --- src/components/ReportActionItem/MoneyRequestAction.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestAction.tsx b/src/components/ReportActionItem/MoneyRequestAction.tsx index 82098b52f2c3..9e169b23391a 100644 --- a/src/components/ReportActionItem/MoneyRequestAction.tsx +++ b/src/components/ReportActionItem/MoneyRequestAction.tsx @@ -92,7 +92,7 @@ function MoneyRequestAction({ } // If the childReportID is not present, we need to create a new thread - const childReportID = action?.childReportID ?? 0; + const childReportID = action?.childReportID; if (!childReportID) { const thread = ReportUtils.buildTransactionThread(action, requestReportID); const userLogins = PersonalDetailsUtils.getLoginsByAccountIDs(thread.participantAccountIDs ?? []); From 7a2a2b07bab6ca1e7ebd5e7ae0807cdff0786a2d Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 6 Feb 2024 19:47:06 +0000 Subject: [PATCH 111/128] Update version to 1.4.37-3 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index e179b59f4b30..a21e96eda07f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043702 - versionName "1.4.37-2" + versionCode 1001043703 + versionName "1.4.37-3" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index b529bbbcd100..214073033436 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.37.2 + 1.4.37.3 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index af5704061df2..232a81f62818 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.37.2 + 1.4.37.3 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index 8209491d19ff..d9fab01ad34a 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.37 CFBundleVersion - 1.4.37.2 + 1.4.37.3 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index 072684aa77c2..4142f3e2367b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.37-2", + "version": "1.4.37-3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.37-2", + "version": "1.4.37-3", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index e08a8bdcb70a..2548bed5c625 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.37-2", + "version": "1.4.37-3", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From c556c5bbaa08277bbe45bfedd133df53b6518c6c Mon Sep 17 00:00:00 2001 From: codinggeek2023 Date: Wed, 7 Feb 2024 01:38:57 +0530 Subject: [PATCH 112/128] Add ShouldShowSubscriptionsMenu to settings^C --- src/libs/ShouldShowSubscriptionsMenu/index.native.ts | 6 ++++++ src/libs/ShouldShowSubscriptionsMenu/index.ts | 6 ++++++ src/pages/home/sidebar/AllSettingsScreen.tsx | 5 +++-- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/libs/ShouldShowSubscriptionsMenu/index.native.ts create mode 100644 src/libs/ShouldShowSubscriptionsMenu/index.ts diff --git a/src/libs/ShouldShowSubscriptionsMenu/index.native.ts b/src/libs/ShouldShowSubscriptionsMenu/index.native.ts new file mode 100644 index 000000000000..b9f28d42e0a0 --- /dev/null +++ b/src/libs/ShouldShowSubscriptionsMenu/index.native.ts @@ -0,0 +1,6 @@ +/** + * Indicates whether the subscription menu should show in the all settings screen + */ +const ShouldShowSubscriptionsMenu = (): boolean => false; + +export default ShouldShowSubscriptionsMenu; \ No newline at end of file diff --git a/src/libs/ShouldShowSubscriptionsMenu/index.ts b/src/libs/ShouldShowSubscriptionsMenu/index.ts new file mode 100644 index 000000000000..28ed3ee6092b --- /dev/null +++ b/src/libs/ShouldShowSubscriptionsMenu/index.ts @@ -0,0 +1,6 @@ +/** + * Indicates whether the subscription menu should show in the all settings screen + */ +const ShouldShowSubscriptionsMenu = (): boolean => true; + +export default ShouldShowSubscriptionsMenu; \ No newline at end of file diff --git a/src/pages/home/sidebar/AllSettingsScreen.tsx b/src/pages/home/sidebar/AllSettingsScreen.tsx index aa308d523db4..c3f2ab281c34 100644 --- a/src/pages/home/sidebar/AllSettingsScreen.tsx +++ b/src/pages/home/sidebar/AllSettingsScreen.tsx @@ -18,6 +18,7 @@ import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {Policy, PolicyMembers} from '@src/types/onyx'; +import ShouldShowSubscriptionsMenu from '@libs/ShouldShowSubscriptionsMenu'; type AllSettingsScreenOnyxProps = { policies: OnyxCollection; @@ -49,7 +50,7 @@ function AllSettingsScreen({policies, policyMembers}: AllSettingsScreenProps) { focused: !isSmallScreenWidth, brickRoadIndicator: hasGlobalWorkspaceSettingsRBR(policies, policyMembers) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, }, - { + ...(ShouldShowSubscriptionsMenu() ? [{ translationKey: 'allSettingsScreen.subscriptions', icon: Expensicons.MoneyBag, action: () => { @@ -58,7 +59,7 @@ function AllSettingsScreen({policies, policyMembers}: AllSettingsScreenProps) { shouldShowRightIcon: true, iconRight: Expensicons.NewWindow, link: CONST.OLDDOT_URLS.ADMIN_POLICIES_URL, - }, + }] : []), { translationKey: 'allSettingsScreen.cardsAndDomains', icon: Expensicons.CardsAndDomains, From 52f6753b6ffa3d55447a7ba3db3ab00697865148 Mon Sep 17 00:00:00 2001 From: Ben Limpich Date: Tue, 6 Feb 2024 12:26:59 -0800 Subject: [PATCH 113/128] fix typo and remove url fragments --- .github/scripts/createHelpRedirects.sh | 2 +- docs/redirects.csv | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/createHelpRedirects.sh b/.github/scripts/createHelpRedirects.sh index 1ae2220253c4..14ed9de953fc 100755 --- a/.github/scripts/createHelpRedirects.sh +++ b/.github/scripts/createHelpRedirects.sh @@ -19,7 +19,7 @@ function checkCloudflareResult { if ! [[ "$RESULT_MESSAGE" == "true" ]]; then ERROR_MESSAGE=$(echo "$RESULTS" | jq .errors) - error "Error calling Cloudfalre API: $ERROR_MESSAGE" + error "Error calling Cloudflare API: $ERROR_MESSAGE" exit 1 fi } diff --git a/docs/redirects.csv b/docs/redirects.csv index 988b07d729f0..cabd76deaf1f 100644 --- a/docs/redirects.csv +++ b/docs/redirects.csv @@ -34,8 +34,8 @@ https://help.expensify.com/articles/expensify-classic/expensify-card/Expensify-C https://help.expensify.com/articles/expensify-classic/expensify-partner-program/How-to-Join-the-ExpensifyApproved!-Partner-Program.html,https://use.expensify.com/accountants-program https://help.expensify.com/articles/expensify-classic/getting-started/approved-accountants/Card-Revenue-Share-For-Expensify-Approved-Partners, https://use.expensify.com/blog/maximizing-rewards-expensifyapproved-accounting-partners-now-earn-0-5-revenue-share https://help.expensify.com/articles/expensify-classic/bank-accounts-and-credit-cards/International-Reimbursements,https://help.expensify.com/articles/expensify-classic/bank-accounts-and-credit-cards/Global-Reimbursements -https://community.expensify.com/discussion/4452/how-to-merge-accounts,https://help.expensify.com/articles/expensify-classic/account-settings/Merge-Accounts#gsc.tab=0 -https://community.expensify.com/discussion/4783/how-to-add-or-remove-a-copilot#latest,https://help.expensify.com/articles/expensify-classic/account-settings/Copilot#gsc.tab=0 +https://community.expensify.com/discussion/4452/how-to-merge-accounts,https://help.expensify.com/articles/expensify-classic/account-settings/Merge-Accounts +https://community.expensify.com/discussion/4783/how-to-add-or-remove-a-copilot,https://help.expensify.com/articles/expensify-classic/account-settings/Copilot https://community.expensify.com/discussion/4343/expensify-anz-partnership-announcement,https://help.expensify.com/articles/expensify-classic/bank-accounts-and-credit-cards/company-cards/Connect-ANZ https://community.expensify.com/discussion/7318/deep-dive-company-credit-card-import-options,https://help.expensify.com/articles/expensify-classic/bank-accounts-and-credit-cards/company-cards https://community.expensify.com/discussion/2673/personalize-your-commercial-card-feed-name,https://help.expensify.com/articles/expensify-classic/bank-accounts-and-credit-cards/company-cards/Commercial-Card-Feeds From 1c6a312f26d85e4e201f2b7020de40a42a0ff4e6 Mon Sep 17 00:00:00 2001 From: codinggeek2023 Date: Wed, 7 Feb 2024 02:13:23 +0530 Subject: [PATCH 114/128] Add types --- src/libs/ShouldShowSubscriptionsMenu/index.native.ts | 6 ++++-- src/libs/ShouldShowSubscriptionsMenu/index.ts | 6 ++++-- src/libs/ShouldShowSubscriptionsMenu/types.tsx | 3 +++ src/pages/home/sidebar/AllSettingsScreen.tsx | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 src/libs/ShouldShowSubscriptionsMenu/types.tsx diff --git a/src/libs/ShouldShowSubscriptionsMenu/index.native.ts b/src/libs/ShouldShowSubscriptionsMenu/index.native.ts index b9f28d42e0a0..c495ead79a12 100644 --- a/src/libs/ShouldShowSubscriptionsMenu/index.native.ts +++ b/src/libs/ShouldShowSubscriptionsMenu/index.native.ts @@ -1,6 +1,8 @@ +import type ShouldShowSubscriptionsMenu from './types'; + /** * Indicates whether the subscription menu should show in the all settings screen */ -const ShouldShowSubscriptionsMenu = (): boolean => false; +const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = () => false; -export default ShouldShowSubscriptionsMenu; \ No newline at end of file +export default shouldShowSubscriptionsMenu; \ No newline at end of file diff --git a/src/libs/ShouldShowSubscriptionsMenu/index.ts b/src/libs/ShouldShowSubscriptionsMenu/index.ts index 28ed3ee6092b..24dfa231cae9 100644 --- a/src/libs/ShouldShowSubscriptionsMenu/index.ts +++ b/src/libs/ShouldShowSubscriptionsMenu/index.ts @@ -1,6 +1,8 @@ +import type ShouldShowSubscriptionsMenu from './types'; + /** * Indicates whether the subscription menu should show in the all settings screen */ -const ShouldShowSubscriptionsMenu = (): boolean => true; +const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = () => true; -export default ShouldShowSubscriptionsMenu; \ No newline at end of file +export default shouldShowSubscriptionsMenu; \ No newline at end of file diff --git a/src/libs/ShouldShowSubscriptionsMenu/types.tsx b/src/libs/ShouldShowSubscriptionsMenu/types.tsx new file mode 100644 index 000000000000..9694a57310d5 --- /dev/null +++ b/src/libs/ShouldShowSubscriptionsMenu/types.tsx @@ -0,0 +1,3 @@ +type ShouldShowSubscriptionsMenu = () => boolean; + +export default ShouldShowSubscriptionsMenu; \ No newline at end of file diff --git a/src/pages/home/sidebar/AllSettingsScreen.tsx b/src/pages/home/sidebar/AllSettingsScreen.tsx index c3f2ab281c34..9b09878ef9da 100644 --- a/src/pages/home/sidebar/AllSettingsScreen.tsx +++ b/src/pages/home/sidebar/AllSettingsScreen.tsx @@ -18,7 +18,7 @@ import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {Policy, PolicyMembers} from '@src/types/onyx'; -import ShouldShowSubscriptionsMenu from '@libs/ShouldShowSubscriptionsMenu'; +import shouldShowSubscriptionsMenu from '@libs/ShouldShowSubscriptionsMenu'; type AllSettingsScreenOnyxProps = { policies: OnyxCollection; @@ -50,7 +50,7 @@ function AllSettingsScreen({policies, policyMembers}: AllSettingsScreenProps) { focused: !isSmallScreenWidth, brickRoadIndicator: hasGlobalWorkspaceSettingsRBR(policies, policyMembers) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, }, - ...(ShouldShowSubscriptionsMenu() ? [{ + ...(shouldShowSubscriptionsMenu() ? [{ translationKey: 'allSettingsScreen.subscriptions', icon: Expensicons.MoneyBag, action: () => { From 6afffdc31bd82cfa44a98bb278c6576cbfd14c71 Mon Sep 17 00:00:00 2001 From: Riya Shete <156463907+codinggeek2023@users.noreply.github.com> Date: Wed, 7 Feb 2024 02:23:58 +0530 Subject: [PATCH 115/128] Update src/libs/ShouldShowSubscriptionsMenu/index.native.ts Co-authored-by: Aimane Chnaif <96077027+aimane-chnaif@users.noreply.github.com> --- src/libs/ShouldShowSubscriptionsMenu/index.native.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ShouldShowSubscriptionsMenu/index.native.ts b/src/libs/ShouldShowSubscriptionsMenu/index.native.ts index c495ead79a12..d5aa2c1c0ea7 100644 --- a/src/libs/ShouldShowSubscriptionsMenu/index.native.ts +++ b/src/libs/ShouldShowSubscriptionsMenu/index.native.ts @@ -3,6 +3,6 @@ import type ShouldShowSubscriptionsMenu from './types'; /** * Indicates whether the subscription menu should show in the all settings screen */ -const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = () => false; +const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = false; export default shouldShowSubscriptionsMenu; \ No newline at end of file From 317543e6c6b91a54469e633bbab2f64711320ce5 Mon Sep 17 00:00:00 2001 From: Riya Shete <156463907+codinggeek2023@users.noreply.github.com> Date: Wed, 7 Feb 2024 02:24:14 +0530 Subject: [PATCH 116/128] Update src/libs/ShouldShowSubscriptionsMenu/types.tsx Co-authored-by: Aimane Chnaif <96077027+aimane-chnaif@users.noreply.github.com> --- src/libs/ShouldShowSubscriptionsMenu/types.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ShouldShowSubscriptionsMenu/types.tsx b/src/libs/ShouldShowSubscriptionsMenu/types.tsx index 9694a57310d5..4d02442a9421 100644 --- a/src/libs/ShouldShowSubscriptionsMenu/types.tsx +++ b/src/libs/ShouldShowSubscriptionsMenu/types.tsx @@ -1,3 +1,3 @@ -type ShouldShowSubscriptionsMenu = () => boolean; +type ShouldShowSubscriptionsMenu = boolean; export default ShouldShowSubscriptionsMenu; \ No newline at end of file From f483d64c64a66e17be39f89cb3a84087a1afd88a Mon Sep 17 00:00:00 2001 From: Riya Shete <156463907+codinggeek2023@users.noreply.github.com> Date: Wed, 7 Feb 2024 02:24:36 +0530 Subject: [PATCH 117/128] Update src/pages/home/sidebar/AllSettingsScreen.tsx Co-authored-by: Aimane Chnaif <96077027+aimane-chnaif@users.noreply.github.com> --- src/pages/home/sidebar/AllSettingsScreen.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/sidebar/AllSettingsScreen.tsx b/src/pages/home/sidebar/AllSettingsScreen.tsx index 9b09878ef9da..c761c5ad2bdf 100644 --- a/src/pages/home/sidebar/AllSettingsScreen.tsx +++ b/src/pages/home/sidebar/AllSettingsScreen.tsx @@ -50,7 +50,7 @@ function AllSettingsScreen({policies, policyMembers}: AllSettingsScreenProps) { focused: !isSmallScreenWidth, brickRoadIndicator: hasGlobalWorkspaceSettingsRBR(policies, policyMembers) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, }, - ...(shouldShowSubscriptionsMenu() ? [{ + ...(shouldShowSubscriptionsMenu ? [{ translationKey: 'allSettingsScreen.subscriptions', icon: Expensicons.MoneyBag, action: () => { From 90334c2646537e8f752a8ce907345141c98f6736 Mon Sep 17 00:00:00 2001 From: Riya Shete <156463907+codinggeek2023@users.noreply.github.com> Date: Wed, 7 Feb 2024 02:24:43 +0530 Subject: [PATCH 118/128] Update src/libs/ShouldShowSubscriptionsMenu/index.ts Co-authored-by: Aimane Chnaif <96077027+aimane-chnaif@users.noreply.github.com> --- src/libs/ShouldShowSubscriptionsMenu/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ShouldShowSubscriptionsMenu/index.ts b/src/libs/ShouldShowSubscriptionsMenu/index.ts index 24dfa231cae9..9632ff707249 100644 --- a/src/libs/ShouldShowSubscriptionsMenu/index.ts +++ b/src/libs/ShouldShowSubscriptionsMenu/index.ts @@ -3,6 +3,6 @@ import type ShouldShowSubscriptionsMenu from './types'; /** * Indicates whether the subscription menu should show in the all settings screen */ -const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = () => true; +const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = true; export default shouldShowSubscriptionsMenu; \ No newline at end of file From 18fe488b2b31da036b5b28dccc10ee91f9baf200 Mon Sep 17 00:00:00 2001 From: codinggeek2023 Date: Wed, 7 Feb 2024 02:30:29 +0530 Subject: [PATCH 119/128] Rename folder --- .../index.native.ts | 0 .../index.ts | 0 .../types.tsx | 0 src/pages/home/sidebar/AllSettingsScreen.tsx | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename src/libs/{ShouldShowSubscriptionsMenu => shouldShowSubscriptionsMenu}/index.native.ts (100%) rename src/libs/{ShouldShowSubscriptionsMenu => shouldShowSubscriptionsMenu}/index.ts (100%) rename src/libs/{ShouldShowSubscriptionsMenu => shouldShowSubscriptionsMenu}/types.tsx (100%) diff --git a/src/libs/ShouldShowSubscriptionsMenu/index.native.ts b/src/libs/shouldShowSubscriptionsMenu/index.native.ts similarity index 100% rename from src/libs/ShouldShowSubscriptionsMenu/index.native.ts rename to src/libs/shouldShowSubscriptionsMenu/index.native.ts diff --git a/src/libs/ShouldShowSubscriptionsMenu/index.ts b/src/libs/shouldShowSubscriptionsMenu/index.ts similarity index 100% rename from src/libs/ShouldShowSubscriptionsMenu/index.ts rename to src/libs/shouldShowSubscriptionsMenu/index.ts diff --git a/src/libs/ShouldShowSubscriptionsMenu/types.tsx b/src/libs/shouldShowSubscriptionsMenu/types.tsx similarity index 100% rename from src/libs/ShouldShowSubscriptionsMenu/types.tsx rename to src/libs/shouldShowSubscriptionsMenu/types.tsx diff --git a/src/pages/home/sidebar/AllSettingsScreen.tsx b/src/pages/home/sidebar/AllSettingsScreen.tsx index c761c5ad2bdf..c4a3319b0c15 100644 --- a/src/pages/home/sidebar/AllSettingsScreen.tsx +++ b/src/pages/home/sidebar/AllSettingsScreen.tsx @@ -18,7 +18,7 @@ import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {Policy, PolicyMembers} from '@src/types/onyx'; -import shouldShowSubscriptionsMenu from '@libs/ShouldShowSubscriptionsMenu'; +import shouldShowSubscriptionsMenu from '@libs/shouldShowSubscriptionsMenu'; type AllSettingsScreenOnyxProps = { policies: OnyxCollection; From 1a90974f20e7dd2245d5ad882af88ee437563e1d Mon Sep 17 00:00:00 2001 From: codinggeek2023 Date: Wed, 7 Feb 2024 02:48:10 +0530 Subject: [PATCH 120/128] Fix Lint --- .../index.native.ts | 2 +- src/libs/shouldShowSubscriptionsMenu/index.ts | 2 +- .../shouldShowSubscriptionsMenu/types.tsx | 2 +- src/pages/home/sidebar/AllSettingsScreen.tsx | 46 ++++++++++--------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/libs/shouldShowSubscriptionsMenu/index.native.ts b/src/libs/shouldShowSubscriptionsMenu/index.native.ts index d5aa2c1c0ea7..c98302e9a87d 100644 --- a/src/libs/shouldShowSubscriptionsMenu/index.native.ts +++ b/src/libs/shouldShowSubscriptionsMenu/index.native.ts @@ -5,4 +5,4 @@ import type ShouldShowSubscriptionsMenu from './types'; */ const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = false; -export default shouldShowSubscriptionsMenu; \ No newline at end of file +export default shouldShowSubscriptionsMenu; diff --git a/src/libs/shouldShowSubscriptionsMenu/index.ts b/src/libs/shouldShowSubscriptionsMenu/index.ts index 9632ff707249..2f2b7f17c2c5 100644 --- a/src/libs/shouldShowSubscriptionsMenu/index.ts +++ b/src/libs/shouldShowSubscriptionsMenu/index.ts @@ -5,4 +5,4 @@ import type ShouldShowSubscriptionsMenu from './types'; */ const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = true; -export default shouldShowSubscriptionsMenu; \ No newline at end of file +export default shouldShowSubscriptionsMenu; diff --git a/src/libs/shouldShowSubscriptionsMenu/types.tsx b/src/libs/shouldShowSubscriptionsMenu/types.tsx index 4d02442a9421..e72b55234639 100644 --- a/src/libs/shouldShowSubscriptionsMenu/types.tsx +++ b/src/libs/shouldShowSubscriptionsMenu/types.tsx @@ -1,3 +1,3 @@ type ShouldShowSubscriptionsMenu = boolean; -export default ShouldShowSubscriptionsMenu; \ No newline at end of file +export default ShouldShowSubscriptionsMenu; diff --git a/src/pages/home/sidebar/AllSettingsScreen.tsx b/src/pages/home/sidebar/AllSettingsScreen.tsx index c4a3319b0c15..8897a26e0b6b 100644 --- a/src/pages/home/sidebar/AllSettingsScreen.tsx +++ b/src/pages/home/sidebar/AllSettingsScreen.tsx @@ -1,7 +1,7 @@ -import React, {useMemo} from 'react'; -import {ScrollView} from 'react-native'; -import type {OnyxCollection} from 'react-native-onyx'; -import {withOnyx} from 'react-native-onyx'; +import React, { useMemo } from 'react'; +import { ScrollView } from 'react-native'; +import type { OnyxCollection } from 'react-native-onyx'; +import { withOnyx } from 'react-native-onyx'; import Breadcrumbs from '@components/Breadcrumbs'; import * as Expensicons from '@components/Icon/Expensicons'; import MenuItemList from '@components/MenuItemList'; @@ -11,14 +11,14 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWaitForNavigation from '@hooks/useWaitForNavigation'; import useWindowDimensions from '@hooks/useWindowDimensions'; import Navigation from '@libs/Navigation/Navigation'; -import {hasGlobalWorkspaceSettingsRBR} from '@libs/WorkspacesSettingsUtils'; +import shouldShowSubscriptionsMenu from '@libs/shouldShowSubscriptionsMenu'; +import { hasGlobalWorkspaceSettingsRBR } from '@libs/WorkspacesSettingsUtils'; import * as Link from '@userActions/Link'; import CONST from '@src/CONST'; -import type {TranslationPaths} from '@src/languages/types'; +import type { TranslationPaths } from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import type {Policy, PolicyMembers} from '@src/types/onyx'; -import shouldShowSubscriptionsMenu from '@libs/shouldShowSubscriptionsMenu'; +import type { Policy, PolicyMembers } from '@src/types/onyx'; type AllSettingsScreenOnyxProps = { policies: OnyxCollection; @@ -27,11 +27,11 @@ type AllSettingsScreenOnyxProps = { type AllSettingsScreenProps = AllSettingsScreenOnyxProps; -function AllSettingsScreen({policies, policyMembers}: AllSettingsScreenProps) { +function AllSettingsScreen({ policies, policyMembers }: AllSettingsScreenProps) { const styles = useThemeStyles(); const waitForNavigate = useWaitForNavigation(); - const {translate} = useLocalize(); - const {isSmallScreenWidth} = useWindowDimensions(); + const { translate } = useLocalize(); + const { isSmallScreenWidth } = useWindowDimensions(); /** * Retuns a list of menu items data for All workspaces settings @@ -50,16 +50,20 @@ function AllSettingsScreen({policies, policyMembers}: AllSettingsScreenProps) { focused: !isSmallScreenWidth, brickRoadIndicator: hasGlobalWorkspaceSettingsRBR(policies, policyMembers) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, }, - ...(shouldShowSubscriptionsMenu ? [{ - translationKey: 'allSettingsScreen.subscriptions', - icon: Expensicons.MoneyBag, - action: () => { - Link.openOldDotLink(CONST.OLDDOT_URLS.ADMIN_POLICIES_URL); - }, - shouldShowRightIcon: true, - iconRight: Expensicons.NewWindow, - link: CONST.OLDDOT_URLS.ADMIN_POLICIES_URL, - }] : []), + ...(shouldShowSubscriptionsMenu + ? [ + { + translationKey: 'allSettingsScreen.subscriptions', + icon: Expensicons.MoneyBag, + action: () => { + Link.openOldDotLink(CONST.OLDDOT_URLS.ADMIN_POLICIES_URL); + }, + shouldShowRightIcon: true, + iconRight: Expensicons.NewWindow, + link: CONST.OLDDOT_URLS.ADMIN_POLICIES_URL, + }, + ] + : []), { translationKey: 'allSettingsScreen.cardsAndDomains', icon: Expensicons.CardsAndDomains, From c12daf25d78aa4967b7515d09a01392806a536cf Mon Sep 17 00:00:00 2001 From: codinggeek2023 Date: Wed, 7 Feb 2024 02:55:40 +0530 Subject: [PATCH 121/128] revert lint --- .../index.native.ts | 2 +- src/libs/shouldShowSubscriptionsMenu/index.ts | 2 +- .../shouldShowSubscriptionsMenu/types.tsx | 2 +- src/pages/home/sidebar/AllSettingsScreen.tsx | 46 +++++++++---------- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/libs/shouldShowSubscriptionsMenu/index.native.ts b/src/libs/shouldShowSubscriptionsMenu/index.native.ts index c98302e9a87d..d5aa2c1c0ea7 100644 --- a/src/libs/shouldShowSubscriptionsMenu/index.native.ts +++ b/src/libs/shouldShowSubscriptionsMenu/index.native.ts @@ -5,4 +5,4 @@ import type ShouldShowSubscriptionsMenu from './types'; */ const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = false; -export default shouldShowSubscriptionsMenu; +export default shouldShowSubscriptionsMenu; \ No newline at end of file diff --git a/src/libs/shouldShowSubscriptionsMenu/index.ts b/src/libs/shouldShowSubscriptionsMenu/index.ts index 2f2b7f17c2c5..9632ff707249 100644 --- a/src/libs/shouldShowSubscriptionsMenu/index.ts +++ b/src/libs/shouldShowSubscriptionsMenu/index.ts @@ -5,4 +5,4 @@ import type ShouldShowSubscriptionsMenu from './types'; */ const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = true; -export default shouldShowSubscriptionsMenu; +export default shouldShowSubscriptionsMenu; \ No newline at end of file diff --git a/src/libs/shouldShowSubscriptionsMenu/types.tsx b/src/libs/shouldShowSubscriptionsMenu/types.tsx index e72b55234639..4d02442a9421 100644 --- a/src/libs/shouldShowSubscriptionsMenu/types.tsx +++ b/src/libs/shouldShowSubscriptionsMenu/types.tsx @@ -1,3 +1,3 @@ type ShouldShowSubscriptionsMenu = boolean; -export default ShouldShowSubscriptionsMenu; +export default ShouldShowSubscriptionsMenu; \ No newline at end of file diff --git a/src/pages/home/sidebar/AllSettingsScreen.tsx b/src/pages/home/sidebar/AllSettingsScreen.tsx index 8897a26e0b6b..c4a3319b0c15 100644 --- a/src/pages/home/sidebar/AllSettingsScreen.tsx +++ b/src/pages/home/sidebar/AllSettingsScreen.tsx @@ -1,7 +1,7 @@ -import React, { useMemo } from 'react'; -import { ScrollView } from 'react-native'; -import type { OnyxCollection } from 'react-native-onyx'; -import { withOnyx } from 'react-native-onyx'; +import React, {useMemo} from 'react'; +import {ScrollView} from 'react-native'; +import type {OnyxCollection} from 'react-native-onyx'; +import {withOnyx} from 'react-native-onyx'; import Breadcrumbs from '@components/Breadcrumbs'; import * as Expensicons from '@components/Icon/Expensicons'; import MenuItemList from '@components/MenuItemList'; @@ -11,14 +11,14 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWaitForNavigation from '@hooks/useWaitForNavigation'; import useWindowDimensions from '@hooks/useWindowDimensions'; import Navigation from '@libs/Navigation/Navigation'; -import shouldShowSubscriptionsMenu from '@libs/shouldShowSubscriptionsMenu'; -import { hasGlobalWorkspaceSettingsRBR } from '@libs/WorkspacesSettingsUtils'; +import {hasGlobalWorkspaceSettingsRBR} from '@libs/WorkspacesSettingsUtils'; import * as Link from '@userActions/Link'; import CONST from '@src/CONST'; -import type { TranslationPaths } from '@src/languages/types'; +import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import type { Policy, PolicyMembers } from '@src/types/onyx'; +import type {Policy, PolicyMembers} from '@src/types/onyx'; +import shouldShowSubscriptionsMenu from '@libs/shouldShowSubscriptionsMenu'; type AllSettingsScreenOnyxProps = { policies: OnyxCollection; @@ -27,11 +27,11 @@ type AllSettingsScreenOnyxProps = { type AllSettingsScreenProps = AllSettingsScreenOnyxProps; -function AllSettingsScreen({ policies, policyMembers }: AllSettingsScreenProps) { +function AllSettingsScreen({policies, policyMembers}: AllSettingsScreenProps) { const styles = useThemeStyles(); const waitForNavigate = useWaitForNavigation(); - const { translate } = useLocalize(); - const { isSmallScreenWidth } = useWindowDimensions(); + const {translate} = useLocalize(); + const {isSmallScreenWidth} = useWindowDimensions(); /** * Retuns a list of menu items data for All workspaces settings @@ -50,20 +50,16 @@ function AllSettingsScreen({ policies, policyMembers }: AllSettingsScreenProps) focused: !isSmallScreenWidth, brickRoadIndicator: hasGlobalWorkspaceSettingsRBR(policies, policyMembers) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, }, - ...(shouldShowSubscriptionsMenu - ? [ - { - translationKey: 'allSettingsScreen.subscriptions', - icon: Expensicons.MoneyBag, - action: () => { - Link.openOldDotLink(CONST.OLDDOT_URLS.ADMIN_POLICIES_URL); - }, - shouldShowRightIcon: true, - iconRight: Expensicons.NewWindow, - link: CONST.OLDDOT_URLS.ADMIN_POLICIES_URL, - }, - ] - : []), + ...(shouldShowSubscriptionsMenu ? [{ + translationKey: 'allSettingsScreen.subscriptions', + icon: Expensicons.MoneyBag, + action: () => { + Link.openOldDotLink(CONST.OLDDOT_URLS.ADMIN_POLICIES_URL); + }, + shouldShowRightIcon: true, + iconRight: Expensicons.NewWindow, + link: CONST.OLDDOT_URLS.ADMIN_POLICIES_URL, + }] : []), { translationKey: 'allSettingsScreen.cardsAndDomains', icon: Expensicons.CardsAndDomains, From 208ada51f20ea34e06ec8b2905fa76e97a03807e Mon Sep 17 00:00:00 2001 From: codinggeek2023 Date: Wed, 7 Feb 2024 02:56:59 +0530 Subject: [PATCH 122/128] push suggested lint --- src/pages/home/sidebar/AllSettingsScreen.tsx | 26 +++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/pages/home/sidebar/AllSettingsScreen.tsx b/src/pages/home/sidebar/AllSettingsScreen.tsx index c4a3319b0c15..0406c38cf659 100644 --- a/src/pages/home/sidebar/AllSettingsScreen.tsx +++ b/src/pages/home/sidebar/AllSettingsScreen.tsx @@ -11,6 +11,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWaitForNavigation from '@hooks/useWaitForNavigation'; import useWindowDimensions from '@hooks/useWindowDimensions'; import Navigation from '@libs/Navigation/Navigation'; +import shouldShowSubscriptionsMenu from '@libs/shouldShowSubscriptionsMenu'; import {hasGlobalWorkspaceSettingsRBR} from '@libs/WorkspacesSettingsUtils'; import * as Link from '@userActions/Link'; import CONST from '@src/CONST'; @@ -18,7 +19,6 @@ import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {Policy, PolicyMembers} from '@src/types/onyx'; -import shouldShowSubscriptionsMenu from '@libs/shouldShowSubscriptionsMenu'; type AllSettingsScreenOnyxProps = { policies: OnyxCollection; @@ -50,16 +50,20 @@ function AllSettingsScreen({policies, policyMembers}: AllSettingsScreenProps) { focused: !isSmallScreenWidth, brickRoadIndicator: hasGlobalWorkspaceSettingsRBR(policies, policyMembers) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, }, - ...(shouldShowSubscriptionsMenu ? [{ - translationKey: 'allSettingsScreen.subscriptions', - icon: Expensicons.MoneyBag, - action: () => { - Link.openOldDotLink(CONST.OLDDOT_URLS.ADMIN_POLICIES_URL); - }, - shouldShowRightIcon: true, - iconRight: Expensicons.NewWindow, - link: CONST.OLDDOT_URLS.ADMIN_POLICIES_URL, - }] : []), + ...(shouldShowSubscriptionsMenu + ? [ + { + translationKey: 'allSettingsScreen.subscriptions', + icon: Expensicons.MoneyBag, + action: () => { + Link.openOldDotLink(CONST.OLDDOT_URLS.ADMIN_POLICIES_URL); + }, + shouldShowRightIcon: true, + iconRight: Expensicons.NewWindow, + link: CONST.OLDDOT_URLS.ADMIN_POLICIES_URL, + }, + ] + : []), { translationKey: 'allSettingsScreen.cardsAndDomains', icon: Expensicons.CardsAndDomains, From 5e59bee371d79abfe790fc801c9545d20bdec3f1 Mon Sep 17 00:00:00 2001 From: codinggeek2023 Date: Wed, 7 Feb 2024 02:57:27 +0530 Subject: [PATCH 123/128] push suggested lint --- src/libs/shouldShowSubscriptionsMenu/index.native.ts | 2 +- src/libs/shouldShowSubscriptionsMenu/index.ts | 2 +- src/libs/shouldShowSubscriptionsMenu/types.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/shouldShowSubscriptionsMenu/index.native.ts b/src/libs/shouldShowSubscriptionsMenu/index.native.ts index d5aa2c1c0ea7..c98302e9a87d 100644 --- a/src/libs/shouldShowSubscriptionsMenu/index.native.ts +++ b/src/libs/shouldShowSubscriptionsMenu/index.native.ts @@ -5,4 +5,4 @@ import type ShouldShowSubscriptionsMenu from './types'; */ const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = false; -export default shouldShowSubscriptionsMenu; \ No newline at end of file +export default shouldShowSubscriptionsMenu; diff --git a/src/libs/shouldShowSubscriptionsMenu/index.ts b/src/libs/shouldShowSubscriptionsMenu/index.ts index 9632ff707249..2f2b7f17c2c5 100644 --- a/src/libs/shouldShowSubscriptionsMenu/index.ts +++ b/src/libs/shouldShowSubscriptionsMenu/index.ts @@ -5,4 +5,4 @@ import type ShouldShowSubscriptionsMenu from './types'; */ const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = true; -export default shouldShowSubscriptionsMenu; \ No newline at end of file +export default shouldShowSubscriptionsMenu; diff --git a/src/libs/shouldShowSubscriptionsMenu/types.tsx b/src/libs/shouldShowSubscriptionsMenu/types.tsx index 4d02442a9421..e72b55234639 100644 --- a/src/libs/shouldShowSubscriptionsMenu/types.tsx +++ b/src/libs/shouldShowSubscriptionsMenu/types.tsx @@ -1,3 +1,3 @@ type ShouldShowSubscriptionsMenu = boolean; -export default ShouldShowSubscriptionsMenu; \ No newline at end of file +export default ShouldShowSubscriptionsMenu; From acf03b5c7102f914fb3d015c9e8ad3d6df9b7b72 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 6 Feb 2024 22:10:56 +0000 Subject: [PATCH 124/128] Update version to 1.4.37-4 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index a21e96eda07f..bd795fb84af5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043703 - versionName "1.4.37-3" + versionCode 1001043704 + versionName "1.4.37-4" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 214073033436..6c8c96bb9f4a 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.37.3 + 1.4.37.4 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 232a81f62818..8c73a6cece43 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.37.3 + 1.4.37.4 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index d9fab01ad34a..2b88b0375075 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.37 CFBundleVersion - 1.4.37.3 + 1.4.37.4 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index 4142f3e2367b..520373fbfd6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.37-3", + "version": "1.4.37-4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.37-3", + "version": "1.4.37-4", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 2548bed5c625..08120fa0f902 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.37-3", + "version": "1.4.37-4", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 0389ac7ddba21f906710637a0864dcc79b65ae65 Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Tue, 6 Feb 2024 23:28:47 +0100 Subject: [PATCH 125/128] Fix variable declared twice --- src/libs/ReportUtils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index bc91f74f3fdc..64d79a3cd812 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2312,8 +2312,6 @@ function getReportPreviewMessage( return `${requestorName ? `${requestorName}: ` : ''}${Localize.translateLocal('iou.requestedAmount', {formattedAmount: amountToDisplay})}`; } - const containsNonReimbursable = hasNonReimbursableTransactions(report.reportID); - return Localize.translateLocal(containsNonReimbursable ? 'iou.payerSpentAmount' : 'iou.payerOwesAmount', {payer: payerName ?? '', amount: formattedAmount}); } From d94353f5d7cd5e980b5e33e73d53c792e325039c Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 6 Feb 2024 22:46:12 +0000 Subject: [PATCH 126/128] Update version to 1.4.37-5 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index bd795fb84af5..990ef0ff5af0 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043704 - versionName "1.4.37-4" + versionCode 1001043705 + versionName "1.4.37-5" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 6c8c96bb9f4a..c247501da949 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.37.4 + 1.4.37.5 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 8c73a6cece43..3af0459775a7 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.37.4 + 1.4.37.5 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index 2b88b0375075..48aecefa5974 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.37 CFBundleVersion - 1.4.37.4 + 1.4.37.5 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index 520373fbfd6c..ac352c7ec6f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.37-4", + "version": "1.4.37-5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.37-4", + "version": "1.4.37-5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 08120fa0f902..e7862fb463c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.37-4", + "version": "1.4.37-5", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From ff622a4ae568171569e62d9b50ffb49203d87f8f Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 6 Feb 2024 22:56:52 +0000 Subject: [PATCH 127/128] Update version to 1.4.37-6 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 990ef0ff5af0..5dd4858fe0d7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043705 - versionName "1.4.37-5" + versionCode 1001043706 + versionName "1.4.37-6" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index c247501da949..e01da07d28b7 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.37.5 + 1.4.37.6 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 3af0459775a7..f2004108628c 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.37.5 + 1.4.37.6 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index 48aecefa5974..6d85c5af21a5 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.37 CFBundleVersion - 1.4.37.5 + 1.4.37.6 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index ac352c7ec6f0..5d63067adc81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.37-5", + "version": "1.4.37-6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.37-5", + "version": "1.4.37-6", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index e7862fb463c7..e7b8631496bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.37-5", + "version": "1.4.37-6", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 7f4cdce48d7246380da7bf860fa928bae89bfa89 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 6 Feb 2024 23:54:16 +0000 Subject: [PATCH 128/128] Update version to 1.4.37-7 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 5dd4858fe0d7..1301f18d7e8f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043706 - versionName "1.4.37-6" + versionCode 1001043707 + versionName "1.4.37-7" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index e01da07d28b7..a2effb8de0b1 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.37.6 + 1.4.37.7 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index f2004108628c..02b01e7153d0 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.37.6 + 1.4.37.7 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index 6d85c5af21a5..69e1e7d6e9d9 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.37 CFBundleVersion - 1.4.37.6 + 1.4.37.7 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index 5d63067adc81..11099886bfb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.37-6", + "version": "1.4.37-7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.37-6", + "version": "1.4.37-7", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index e7b8631496bf..71983e0e1679 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.37-6", + "version": "1.4.37-7", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",