diff --git a/.circleci/config.yml b/.circleci/config.yml index bd532a2e6..7e9bb5068 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,20 +1,20 @@ version: 2.1 orbs: owasp: entur/owasp@0.0.10 - node: circleci/node@5.0.3 + node: circleci/node@4.5.1 executors: android: parameters: resource_class: - default: xlarge + default: large type: string environment: NODE_OPTIONS: --max_old_space_size=12000 NODE_ENV: production BABEL_ENV: production docker: - - image: cimg/android:2022.09.2-node + - image: circleci/android:api-30-node working_directory: ~/mattermost-mobile resource_class: <> @@ -24,7 +24,7 @@ executors: NODE_ENV: production BABEL_ENV: production macos: - xcode: "14.0.0" + xcode: "13.0.0" working_directory: ~/mattermost-mobile shell: /bin/bash --login -o pipefail @@ -93,7 +93,8 @@ commands: description: "Get JavaScript dependencies" steps: - node/install: - node-version: '16.15.0' + node-version: '16.2.0' + install-npm: false - restore_cache: name: Restore npm cache key: v2-npm-{{ checksum "package.json" }}-{{ arch }} @@ -524,4 +525,4 @@ workflows: tags: only: /^v(\d+\.)(\d+\.)(\d+)(.*)?$/ branches: - only: unsigned + only: unsigned \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json index 2e8835ccf..4c90e5998 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,13 +1,13 @@ { "extends": [ - "./eslint/eslint-mattermost", - "./eslint/eslint-react", + "plugin:mattermost/react", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended" ], "parser": "@typescript-eslint/parser", "plugins": [ "@typescript-eslint", + "mattermost", "import" ], "settings": { diff --git a/.flowconfig b/.flowconfig index caffacfd4..53ab6fb5c 100644 --- a/.flowconfig +++ b/.flowconfig @@ -11,8 +11,6 @@ node_modules/react-native/Libraries/polyfills/.* ; Flow doesn't support platforms .*/Libraries/Utilities/LoadingView.js -.*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$ - [untyped] .*/node_modules/@react-native-community/cli/.*/.* @@ -65,4 +63,4 @@ untyped-import untyped-type-import [version] -^0.182.0 +^0.162.0 diff --git a/.gitignore b/.gitignore index c10d31d96..a9285d81c 100644 --- a/.gitignore +++ b/.gitignore @@ -32,10 +32,8 @@ DerivedData *.apk *.aab *.xcuserstate -ios/.xcode.env.local project.xcworkspace ios/Pods -/vendor/bundle/ .podinstall # Android/IntelliJ @@ -83,11 +81,11 @@ tags # For more information about the recommended setup visit: # https://docs.fastlane.tools/best-practices/source-control/ -**/fastlane/report.xml -**/fastlane/Preview.html -**/fastlane/screenshots -**/fastlane/test_output +*/fastlane/report.xml +*/fastlane/Preview.html +*/fastlane/screenshots fastlane/.env +fastlane/report.xml # Sentry android/sentry.properties diff --git a/android/app/build.gradle b/android/app/build.gradle index ef0498e43..5944b2541 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -120,12 +120,9 @@ def jscFlavor = 'org.webkit:android-jsc-intl:+' def enableHermes = project.ext.react.get("enableHermes", false); /** - * Architectures to build native code for. + * Architectures to build native code for in debug. */ -def reactNativeArchitectures() { - def value = project.getProperties().get("reactNativeArchitectures") - return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] -} +def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") android { compileSdkVersion rootProject.ext.compileSdkVersion @@ -134,75 +131,11 @@ android { applicationId "com.mattermost.rnbeta" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 435 + versionCode 436 versionName "1.56.0" multiDexEnabled = true testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() - - if (isNewArchitectureEnabled()) { - // We configure the CMake build only if you decide to opt-in for the New Architecture. - externalNativeBuild { - cmake { - arguments "-DPROJECT_BUILD_DIR=$buildDir", - "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", - "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", - "-DNODE_MODULES_DIR=$rootDir/../node_modules", - "-DANDROID_STL=c++_shared" - // Fix for windows limit on number of character in file paths and in command lines - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - arguments "NDK_APP_SHORT_COMMANDS=true" - } - } - } - if (!enableSeparateBuildPerCPUArchitecture) { - ndk { - abiFilters (*reactNativeArchitectures()) - } - } - } - } - - if (isNewArchitectureEnabled()) { - // We configure the NDK build only if you decide to opt-in for the New Architecture. - externalNativeBuild { - cmake { - path "$projectDir/src/main/jni/CMakeLists.txt" - } - } - def reactAndroidProjectDir = project(':ReactAndroid').projectDir - def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { - dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") - from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") - into("$buildDir/react-ndk/exported") - } - def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { - dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") - from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") - into("$buildDir/react-ndk/exported") - } - afterEvaluate { - // If you wish to add a custom TurboModule or component locally, - // you should uncomment this line. - // preBuild.dependsOn("generateCodegenArtifactsFromSchema") - preDebugBuild.dependsOn(packageReactNdkDebugLibs) - preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) - - // Due to a bug inside AGP, we have to explicitly set a dependency - // between configureCMakeDebug* tasks and the preBuild tasks. - // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 - configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild) - configureCMakeDebug.dependsOn(preDebugBuild) - reactNativeArchitectures().each { architecture -> - tasks.findByName("configureCMakeDebug[${architecture}]")?.configure { - dependsOn("preDebugBuild") - } - tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure { - dependsOn("preReleaseBuild") - } - } - } } signingConfigs { release { @@ -219,25 +152,22 @@ android { reset() enable enableSeparateBuildPerCPUArchitecture universalApk enableSeparateBuildPerCPUArchitecture // If true, also generate a universal APK - include (*reactNativeArchitectures()) + include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } buildTypes { - def useReleaseKey = project.hasProperty('MATTERMOST_RELEASE_STORE_FILE') release { minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" - if (useReleaseKey) { - signingConfig signingConfigs.release - } else { - signingConfig signingConfigs.debug - } + signingConfig signingConfigs.release } debug { - if (useReleaseKey) { - signingConfig signingConfigs.release - } else { - signingConfig signingConfigs.debug + minifyEnabled enableProguardInReleaseBuilds + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + if (nativeArchitectures) { + ndk { + abiFilters nativeArchitectures.split(',') + } } } unsigned.initWith(buildTypes.release) @@ -282,6 +212,25 @@ repositories { } } +configurations.all { + resolutionStrategy { + eachDependency { DependencyResolveDetails details -> + if (details.requested.name == 'play-services-base') { + details.useTarget group: details.requested.group, name: details.requested.name, version: '15.0.1' + } + if (details.requested.name == 'play-services-tasks') { + details.useTarget group: details.requested.group, name: details.requested.name, version: '15.0.1' + } + if (details.requested.name == 'play-services-stats') { + details.useTarget group: details.requested.group, name: details.requested.name, version: '15.0.1' + } + if (details.requested.name == 'play-services-basement') { + details.useTarget group: details.requested.group, name: details.requested.name, version: '15.0.1' + } + } + } +} + dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) @@ -301,10 +250,10 @@ dependencies { if (enableHermes) { - //noinspection GradleDynamicVersion - implementation("com.facebook.react:hermes-engine:+") { // From node_modules - exclude group:'com.facebook.fbjni' - } + def hermesPath = "../../node_modules/hermes-engine/android/"; + debugImplementation files(hermesPath + "hermes-debug.aar") + releaseImplementation files(hermesPath + "hermes-release.aar") + unsignedImplementation files(hermesPath + "hermes-release.aar") } else { implementation jscFlavor } @@ -326,39 +275,6 @@ dependencies { androidTestImplementation('com.wix:detox:+') } -configurations.all { - if (isNewArchitectureEnabled()) { - // If new architecture is enabled, we let you build RN from source - // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. - // This will be applied to all the imported transtitive dependency. - resolutionStrategy.dependencySubstitution { - substitute(module("com.facebook.react:react-native")) - .using(project(":ReactAndroid")) - .because("On New Architecture we're building React Native from source") - substitute(module("com.facebook.react:hermes-engine")) - .using(project(":ReactAndroid:hermes-engine")) - .because("On New Architecture we're building Hermes from source") - } - } - - resolutionStrategy { - eachDependency { DependencyResolveDetails details -> - if (details.requested.name == 'play-services-base') { - details.useTarget group: details.requested.group, name: details.requested.name, version: '15.0.1' - } - if (details.requested.name == 'play-services-tasks') { - details.useTarget group: details.requested.group, name: details.requested.name, version: '15.0.1' - } - if (details.requested.name == 'play-services-stats') { - details.useTarget group: details.requested.group, name: details.requested.name, version: '15.0.1' - } - if (details.requested.name == 'play-services-basement') { - details.useTarget group: details.requested.group, name: details.requested.name, version: '15.0.1' - } - } - } -} - // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { @@ -368,11 +284,3 @@ task copyDownloadableDepsToLibs(type: Copy) { apply plugin: 'com.google.gms.google-services' apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) - -def isNewArchitectureEnabled() { - // To opt-in for the New Architecture, you can either: - // - Set `newArchEnabled` to true inside the `gradle.properties` file - // - Invoke gradle with `-newArchEnabled=true` - // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` - return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" -} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 180b076f5..604a17eef 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -10,4 +10,4 @@ tools:ignore="GoogleAppIndexingWarning"> - + \ No newline at end of file diff --git a/android/app/src/debug/java/com/rn/ReactNativeFlipper.java b/android/app/src/debug/java/com/rn/ReactNativeFlipper.java index 1197406be..f6fb760e5 100644 --- a/android/app/src/debug/java/com/rn/ReactNativeFlipper.java +++ b/android/app/src/debug/java/com/rn/ReactNativeFlipper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) Meta Platforms, Inc. and affiliates. + * Copyright (c) Facebook, Inc. and its affiliates. * *

This source code is licensed under the MIT license found in the LICENSE file in the root * directory of this source tree. @@ -19,7 +19,6 @@ import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; import com.facebook.flipper.plugins.react.ReactFlipperPlugin; import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; -import com.facebook.react.ReactInstanceEventListener; import com.facebook.react.ReactInstanceManager; import com.facebook.react.bridge.ReactContext; import com.facebook.react.modules.network.NetworkingModule; @@ -48,7 +47,7 @@ public class ReactNativeFlipper { ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); if (reactContext == null) { reactInstanceManager.addReactInstanceEventListener( - new ReactInstanceEventListener() { + new ReactInstanceManager.ReactInstanceEventListener() { @Override public void onReactContextInitialized(ReactContext reactContext) { reactInstanceManager.removeReactInstanceEventListener(this); diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 351221352..eda01403a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -95,4 +95,4 @@ - + \ No newline at end of file diff --git a/android/app/src/main/java/com/mattermost/newarchitecture/MainApplicationReactNativeHost.java b/android/app/src/main/java/com/mattermost/newarchitecture/MainApplicationReactNativeHost.java deleted file mode 100644 index 5a5d736bf..000000000 --- a/android/app/src/main/java/com/mattermost/newarchitecture/MainApplicationReactNativeHost.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.mattermost.newarchitecture; - -import android.app.Application; -import androidx.annotation.NonNull; -import com.facebook.react.PackageList; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.ReactPackageTurboModuleManagerDelegate; -import com.facebook.react.bridge.JSIModulePackage; -import com.facebook.react.bridge.JSIModuleProvider; -import com.facebook.react.bridge.JSIModuleSpec; -import com.facebook.react.bridge.JSIModuleType; -import com.facebook.react.bridge.JavaScriptContextHolder; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.UIManager; -import com.facebook.react.fabric.ComponentFactory; -import com.facebook.react.fabric.CoreComponentsRegistry; -import com.facebook.react.fabric.FabricJSIModuleProvider; -import com.facebook.react.fabric.ReactNativeConfig; -import com.facebook.react.uimanager.ViewManagerRegistry; -import com.mattermost.rnbeta.BuildConfig; -import com.mattermost.newarchitecture.components.MainComponentsRegistry; -import com.mattermost.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; -import java.util.ArrayList; -import java.util.List; - -/** - * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both - * TurboModule delegates and the Fabric Renderer. - * - *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the - * `newArchEnabled` property). Is ignored otherwise. - */ -public class MainApplicationReactNativeHost extends ReactNativeHost { - public MainApplicationReactNativeHost(Application application) { - super(application); - } - - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - List packages = new PackageList(this).getPackages(); - // Packages that cannot be autolinked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: - // packages.add(new TurboReactPackage() { ... }); - // If you have custom Fabric Components, their ViewManagers should also be loaded here - // inside a ReactPackage. - return packages; - } - - @Override - protected String getJSMainModuleName() { - return "index"; - } - - @NonNull - @Override - protected ReactPackageTurboModuleManagerDelegate.Builder - getReactPackageTurboModuleManagerDelegateBuilder() { - // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary - // for the new architecture and to use TurboModules correctly. - return new MainApplicationTurboModuleManagerDelegate.Builder(); - } - - @Override - protected JSIModulePackage getJSIModulePackage() { - return new JSIModulePackage() { - @Override - public List getJSIModules( - final ReactApplicationContext reactApplicationContext, - final JavaScriptContextHolder jsContext) { - final List specs = new ArrayList<>(); - - // Here we provide a new JSIModuleSpec that will be responsible of providing the - // custom Fabric Components. - specs.add( - new JSIModuleSpec() { - @Override - public JSIModuleType getJSIModuleType() { - return JSIModuleType.UIManager; - } - - @Override - public JSIModuleProvider getJSIModuleProvider() { - final ComponentFactory componentFactory = new ComponentFactory(); - CoreComponentsRegistry.register(componentFactory); - - // Here we register a Components Registry. - // The one that is generated with the template contains no components - // and just provides you the one from React Native core. - MainComponentsRegistry.register(componentFactory); - - final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); - - ViewManagerRegistry viewManagerRegistry = - new ViewManagerRegistry( - reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); - - return new FabricJSIModuleProvider( - reactApplicationContext, - componentFactory, - ReactNativeConfig.DEFAULT_CONFIG, - viewManagerRegistry); - } - }); - return specs; - } - }; - } -} \ No newline at end of file diff --git a/android/app/src/main/java/com/mattermost/newarchitecture/components/MainComponentsRegistry.java b/android/app/src/main/java/com/mattermost/newarchitecture/components/MainComponentsRegistry.java deleted file mode 100644 index 4168988bd..000000000 --- a/android/app/src/main/java/com/mattermost/newarchitecture/components/MainComponentsRegistry.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.mattermost.newarchitecture.components; - -import com.facebook.jni.HybridData; -import com.facebook.proguard.annotations.DoNotStrip; -import com.facebook.react.fabric.ComponentFactory; -import com.facebook.soloader.SoLoader; - -/** - * Class responsible to load the custom Fabric Components. This class has native methods and needs a - * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ - * folder for you). - * - *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the - * `newArchEnabled` property). Is ignored otherwise. - */ -@DoNotStrip -public class MainComponentsRegistry { - static { - SoLoader.loadLibrary("fabricjni"); - } - - @DoNotStrip private final HybridData mHybridData; - - @DoNotStrip - private native HybridData initHybrid(ComponentFactory componentFactory); - - @DoNotStrip - private MainComponentsRegistry(ComponentFactory componentFactory) { - mHybridData = initHybrid(componentFactory); - } - - @DoNotStrip - public static MainComponentsRegistry register(ComponentFactory componentFactory) { - return new MainComponentsRegistry(componentFactory); - } -} \ No newline at end of file diff --git a/android/app/src/main/java/com/mattermost/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java b/android/app/src/main/java/com/mattermost/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java deleted file mode 100644 index a5e317674..000000000 --- a/android/app/src/main/java/com/mattermost/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.mattermost.newarchitecture.modules; - -import com.facebook.jni.HybridData; -import com.facebook.react.ReactPackage; -import com.facebook.react.ReactPackageTurboModuleManagerDelegate; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.soloader.SoLoader; -import java.util.List; - -/** - * Class responsible to load the TurboModules. This class has native methods and needs a - * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ - * folder for you). - * - *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the - * `newArchEnabled` property). Is ignored otherwise. - */ -public class MainApplicationTurboModuleManagerDelegate - extends ReactPackageTurboModuleManagerDelegate { - - private static volatile boolean sIsSoLibraryLoaded; - - protected MainApplicationTurboModuleManagerDelegate( - ReactApplicationContext reactApplicationContext, List packages) { - super(reactApplicationContext, packages); - } - - protected native HybridData initHybrid(); - - native boolean canCreateTurboModule(String moduleName); - - public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { - protected MainApplicationTurboModuleManagerDelegate build( - ReactApplicationContext context, List packages) { - return new MainApplicationTurboModuleManagerDelegate(context, packages); - } - } - - @Override - protected synchronized void maybeLoadOtherSoLibraries() { - if (!sIsSoLibraryLoaded) { - // If you change the name of your application .so file in the Android.mk file, - // make sure you update the name here as well. - SoLoader.loadLibrary("rndiffapp_appmodules"); - sIsSoLibraryLoaded = true; - } - } -} \ No newline at end of file diff --git a/android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java b/android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java index fe1b6fc4c..537e76fcc 100644 --- a/android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java +++ b/android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java @@ -1,44 +1,18 @@ package com.mattermost.rnbeta; import android.os.Bundle; -import androidx.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import android.view.KeyEvent; import android.content.res.Configuration; -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactMethod; -import com.facebook.react.bridge.WritableMap; -import com.facebook.react.ReactActivityDelegate; -import com.facebook.react.ReactRootView; import com.reactnativenavigation.NavigationActivity; import com.github.emilioicai.hwkeyboardevent.HWKeyboardEventModule; public class MainActivity extends NavigationActivity { private boolean HWKeyboardConnected = false; - public static class MainActivityDelegate extends ReactActivityDelegate { - public MainActivityDelegate(NavigationActivity activity, String mainComponentName) { - super(activity, mainComponentName); - } - - @Override - protected ReactRootView createRootView() { - ReactRootView reactRootView = new ReactRootView(getContext()); - // If you opted-in for the New Architecture, we enable the Fabric Renderer. - reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); - return reactRootView; - } - - @Override - protected boolean isConcurrentRootEnabled() { - // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). - // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html - return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; - } - } - @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -47,7 +21,7 @@ public class MainActivity extends NavigationActivity { } @Override - public void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(@NonNull Configuration newConfig) { super.onConfigurationChanged(newConfig); if (newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) { @@ -57,12 +31,6 @@ public class MainActivity extends NavigationActivity { } } - @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - getReactGateway().onWindowFocusChanged(hasFocus); - } - /* https://mattermost.atlassian.net/browse/MM-10601 Required by react-native-hw-keyboard-event @@ -70,24 +38,15 @@ public class MainActivity extends NavigationActivity { */ @Override public boolean dispatchKeyEvent(KeyEvent event) { - if (HWKeyboardConnected) { - int keyCode = event.getKeyCode(); - int keyAction = event.getAction(); - if (keyAction == KeyEvent.ACTION_UP) { - if (keyCode == KeyEvent.KEYCODE_ENTER) { - String keyPressed = event.isShiftPressed() ? "shift-enter" : "enter"; - HWKeyboardEventModule.getInstance().keyPressed(keyPressed); - return true; - } else if (keyCode == KeyEvent.KEYCODE_K && event.isCtrlPressed()) { - HWKeyboardEventModule.getInstance().keyPressed("find-channels"); - return true; - } - } + if (HWKeyboardConnected && event.getKeyCode() == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) { + String keyPressed = event.isShiftPressed() ? "shift-enter" : "enter"; + HWKeyboardEventModule.getInstance().keyPressed(keyPressed); + return true; } return super.dispatchKeyEvent(event); - }; + } private void setHWKeyboardConnected() { HWKeyboardConnected = getResources().getConfiguration().keyboard == Configuration.KEYBOARD_QWERTY; } -} \ No newline at end of file +} diff --git a/android/app/src/main/java/com/mattermost/rnbeta/MainApplication.java b/android/app/src/main/java/com/mattermost/rnbeta/MainApplication.java index 088af821d..9316646dd 100644 --- a/android/app/src/main/java/com/mattermost/rnbeta/MainApplication.java +++ b/android/app/src/main/java/com/mattermost/rnbeta/MainApplication.java @@ -25,19 +25,16 @@ import com.wix.reactnativenotifications.core.JsIOHelper; import com.facebook.react.PackageList; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactPackage; -import com.facebook.react.config.ReactFeatureFlags; import com.facebook.react.ReactNativeHost; import com.facebook.react.TurboReactPackage; -import com.facebook.react.bridge.JSIModulePackage; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.module.model.ReactModuleInfo; import com.facebook.react.module.model.ReactModuleInfoProvider; import com.facebook.soloader.SoLoader; -import com.facebook.react.config.ReactFeatureFlags; -import com.mattermost.newarchitecture.MainApplicationReactNativeHost; +import com.facebook.react.bridge.JSIModulePackage; public class MainApplication extends NavigationApplication implements INotificationsApplication, INotificationsDrawerApplication { @@ -47,75 +44,68 @@ public class MainApplication extends NavigationApplication implements INotificat private Bundle mManagedConfig = null; - private final ReactNativeHost mReactNativeHost = - new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } +private final ReactNativeHost mReactNativeHost = + new ReactNativeHost(this) { + @Override + public boolean getUseDeveloperSupport() { + return BuildConfig.DEBUG; + } - @Override - protected List getPackages() { - List packages = new PackageList(this).getPackages(); - // Packages that cannot be auto linked yet can be added manually here, for example: - // packages.add(new MyReactNativePackage()); - packages.add(new RNNotificationsPackage(MainApplication.this)); - packages.add( - new TurboReactPackage() { - @Override - public NativeModule getModule(String name, ReactApplicationContext reactContext) { - switch (name) { - case "MattermostManaged": - return MattermostManagedModule.getInstance(reactContext); - case "MattermostShare": - return new ShareModule(instance, reactContext); - case "NotificationPreferences": - return NotificationPreferencesModule.getInstance(instance, reactContext); - case "RNTextInputReset": - return new RNTextInputResetModule(reactContext); - default: - throw new IllegalArgumentException("Could not find module " + name); - } - } - - @Override - public ReactModuleInfoProvider getReactModuleInfoProvider() { - return () -> { - Map map = new HashMap<>(); - map.put("MattermostManaged", new ReactModuleInfo("MattermostManaged", "com.mattermost.rnbeta.MattermostManagedModule", false, false, false, false, false)); - map.put("MattermostShare", new ReactModuleInfo("MattermostShare", "com.mattermost.share.ShareModule", false, false, true, false, false)); - map.put("NotificationPreferences", new ReactModuleInfo("NotificationPreferences", "com.mattermost.rnbeta.NotificationPreferencesModule", false, false, false, false, false)); - map.put("RNTextInputReset", new ReactModuleInfo("RNTextInputReset", "com.mattermost.rnbeta.RNTextInputResetModule", false, false, false, false, false)); - return map; - }; + @Override + protected List getPackages() { + List packages = new PackageList(this).getPackages(); + // Packages that cannot be auto linked yet can be added manually here, for example: + // packages.add(new MyReactNativePackage()); + packages.add(new RNNotificationsPackage(MainApplication.this)); + packages.add( + new TurboReactPackage() { + @Override + public NativeModule getModule(String name, ReactApplicationContext reactContext) { + switch (name) { + case "MattermostManaged": + return MattermostManagedModule.getInstance(reactContext); + case "MattermostShare": + return new ShareModule(instance, reactContext); + case "NotificationPreferences": + return NotificationPreferencesModule.getInstance(instance, reactContext); + case "RNTextInputReset": + return new RNTextInputResetModule(reactContext); + default: + throw new IllegalArgumentException("Could not find module " + name); } } - ); - return packages; - } + @Override + public ReactModuleInfoProvider getReactModuleInfoProvider() { + return () -> { + Map map = new HashMap<>(); + map.put("MattermostManaged", new ReactModuleInfo("MattermostManaged", "com.mattermost.rnbeta.MattermostManagedModule", false, false, false, false, false)); + map.put("MattermostShare", new ReactModuleInfo("MattermostShare", "com.mattermost.share.ShareModule", false, false, true, false, false)); + map.put("NotificationPreferences", new ReactModuleInfo("NotificationPreferences", "com.mattermost.rnbeta.NotificationPreferencesModule", false, false, false, false, false)); + map.put("RNTextInputReset", new ReactModuleInfo("RNTextInputReset", "com.mattermost.rnbeta.RNTextInputResetModule", false, false, false, false, false)); + return map; + }; + } + } + ); - @Override - protected String getJSMainModuleName() { - return "index"; - } + return packages; + } - @Override - protected JSIModulePackage getJSIModulePackage() { - return (JSIModulePackage) new CustomMMKVJSIModulePackage(); - } + @Override + protected String getJSMainModuleName() { + return "index"; + } + + @Override + protected JSIModulePackage getJSIModulePackage() { + return (JSIModulePackage) new CustomMMKVJSIModulePackage(); + } }; - private final ReactNativeHost mNewArchitectureNativeHost = - new MainApplicationReactNativeHost(this); - @Override public ReactNativeHost getReactNativeHost() { - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - return mNewArchitectureNativeHost; - } else { - return mReactNativeHost; - } + return mReactNativeHost; } @Override @@ -128,8 +118,6 @@ public class MainApplication extends NavigationApplication implements INotificat RealPathUtil.deleteTempFiles(tempFolder); Log.i("ReactNative", "Cleaning temp cache " + tempFolder.getAbsolutePath()); - // If you opted-in for the New Architecture, we enable the TurboModule system - ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; SoLoader.init(this, /* native exopackage */ false); initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); } diff --git a/android/app/src/main/jni/MainComponentsRegistry.h b/android/app/src/main/jni/MainComponentsRegistry.h deleted file mode 100644 index 07af8980b..000000000 --- a/android/app/src/main/jni/MainComponentsRegistry.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -namespace facebook { -namespace react { - -class MainComponentsRegistry - : public facebook::jni::HybridClass { - public: - // Adapt it to the package you used for your Java class. - constexpr static auto kJavaDescriptor = - "Lcom/mattermost/newarchitecture/components/MainComponentsRegistry;"; - - static void registerNatives(); - - MainComponentsRegistry(ComponentFactory *delegate); - - private: - static std::shared_ptr - sharedProviderRegistry(); - - static jni::local_ref initHybrid( - jni::alias_ref, - ComponentFactory *delegate); -}; - -} // namespace react -} // namespace facebook \ No newline at end of file diff --git a/android/app/src/main/jni/OnLoad.cpp b/android/app/src/main/jni/OnLoad.cpp deleted file mode 100644 index ae1ef007d..000000000 --- a/android/app/src/main/jni/OnLoad.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "MainApplicationTurboModuleManagerDelegate.h" -#include "MainComponentsRegistry.h" - -JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { - return facebook::jni::initialize(vm, [] { - facebook::react::MainApplicationTurboModuleManagerDelegate:: - registerNatives(); - facebook::react::MainComponentsRegistry::registerNatives(); - }); -} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 274ddf0a2..4753306cd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,13 +10,8 @@ buildscript { kotlinVersion = "1.5.30" firebaseVersion = "21.0.0" RNNKotlinVersion = kotlinVersion - if (System.properties['os.arch'] == "aarch64") { - // For M1 Users we need to use the NDK 24 which added support for aarch64 - ndkVersion = "24.0.8215888" - } else { - // Otherwise we default to the side-by-side NDK version from AGP. - ndkVersion = "21.4.7075529" - } + ndkVersion = "21.4.7075529" + } repositories { google() @@ -24,9 +19,7 @@ buildscript { mavenLocal() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' - classpath("com.facebook.react:react-native-gradle-plugin") - classpath("de.undercouch:gradle-download-task:5.0.1") + classpath 'com.android.tools.build:gradle:4.2.2' classpath 'com.google.gms:google-services:4.3.10' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" diff --git a/android/gradle.properties b/android/gradle.properties index 7b404d8c1..5bcc2744f 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -29,15 +29,4 @@ android.useAndroidX=true android.enableJetifier=true # Version of flipper SDK to use with React Native -FLIPPER_VERSION=0.125.0 - -# Use this property to specify which architecture you want to build. -# You can also override it from the CLI using -# ./gradlew -PreactNativeArchitectures=x86_64 -reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 -# Use this property to enable support to the new architecture. -# This will allow you to use TurboModules and the Fabric render in -# your application. You should enable this flag either if you want -# to write custom TurboModules/Fabric components OR use libraries that -# are providing them. -newArchEnabled=false \ No newline at end of file +FLIPPER_VERSION=0.99.0 diff --git a/android/settings.gradle b/android/settings.gradle index dc0b28055..9369160c6 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -3,10 +3,3 @@ include ':reactnativenotifications' project(':reactnativenotifications').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-notifications/lib/android/app') apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' -includeBuild('../node_modules/react-native-gradle-plugin') -if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { - include(":ReactAndroid") - project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') - include(":ReactAndroid:hermes-engine") - project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') -} \ No newline at end of file diff --git a/app/components/__snapshots__/badge.test.js.snap b/app/components/__snapshots__/badge.test.js.snap index efa6975da..bf77c93db 100644 --- a/app/components/__snapshots__/badge.test.js.snap +++ b/app/components/__snapshots__/badge.test.js.snap @@ -3,14 +3,14 @@ exports[`Badge should match snapshot 1`] = ` `; diff --git a/app/components/__snapshots__/swiper.test.js.snap b/app/components/__snapshots__/swiper.test.js.snap index 7cdb8e044..9545911fb 100644 --- a/app/components/__snapshots__/swiper.test.js.snap +++ b/app/components/__snapshots__/swiper.test.js.snap @@ -4,8 +4,8 @@ exports[`Swiper should match snapshot 1`] = ` @John.Smith @@ -21,18 +21,18 @@ exports[`AtMention should match snapshot, with highlight 1`] = ` onLongPress={[Function]} onPress={[Function]} style={ - { + Object { "backgroundColor": "yellow", } } > { iconColor: { tintColor: theme.centerChannelColor, }, - iconSize: { - width: 10, - height: 16, - }, container: { flexDirection: 'row', alignItems: 'center', @@ -104,14 +100,18 @@ const SlashSuggestionItem = (props: Props) => { let image = ( ); if (props.icon === COMMAND_SUGGESTION_ERROR) { image = ( ); diff --git a/app/components/autocomplete_selector/autocomplete_selector.tsx b/app/components/autocomplete_selector/autocomplete_selector.tsx index 5300bb787..08283494f 100644 --- a/app/components/autocomplete_selector/autocomplete_selector.tsx +++ b/app/components/autocomplete_selector/autocomplete_selector.tsx @@ -204,7 +204,6 @@ export default class AutocompleteSelector extends PureComponent { goToSelectorScreen = preventDoubleTap(async () => { const closeButton = await CompassIcon.getImageSource(Platform.select({ios: 'arrow-back-ios', default: 'arrow-left'}), 24, this.props.theme.sidebarHeaderTextColor); - // @ts-expect-error context type definition const {formatMessage} = this.context.intl; const {actions, dataSource, options, placeholder, getDynamicOptions, theme} = this.props; const screen = 'SelectorScreen'; @@ -234,7 +233,6 @@ export default class AutocompleteSelector extends PureComponent { }); render() { - // @ts-expect-error context type definition const {intl} = this.context; const { placeholder, diff --git a/app/components/avatars/__snapshots__/avatars.test.tsx.snap b/app/components/avatars/__snapshots__/avatars.test.tsx.snap index d63045143..585590876 100644 --- a/app/components/avatars/__snapshots__/avatars.test.tsx.snap +++ b/app/components/avatars/__snapshots__/avatars.test.tsx.snap @@ -7,14 +7,14 @@ exports[`Avatars should match snapshot for overflow 1`] = ` > `; exports[`CustomList should match snapshot, renderSectionHeader 1`] = ` - + `; diff --git a/app/components/emoji_picker/__snapshots__/emoji_picker.test.js.snap b/app/components/emoji_picker/__snapshots__/emoji_picker.test.js.snap index c018dab55..f159da5c4 100644 --- a/app/components/emoji_picker/__snapshots__/emoji_picker.test.js.snap +++ b/app/components/emoji_picker/__snapshots__/emoji_picker.test.js.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`components/emoji_picker/emoji_picker.ios should match snapshot 1`] = ` - - + `; diff --git a/app/components/error_text/__snapshots__/error_text.test.js.snap b/app/components/error_text/__snapshots__/error_text.test.js.snap index 2dbb436db..4171a0af9 100644 --- a/app/components/error_text/__snapshots__/error_text.test.js.snap +++ b/app/components/error_text/__snapshots__/error_text.test.js.snap @@ -3,18 +3,18 @@ exports[`ErrorText should match snapshot 1`] = ` item, []); + const keyExtractor = React.useCallback((item) => item, []); - const renderPost = React.useCallback(({item}: ListRenderItemInfo) => { + const renderPost = React.useCallback(({item}) => { return ( @@ -40,7 +40,7 @@ exports[`Global Thread List Header Should render threads with functional tabs & > diff --git a/app/components/markdown/transform.test.js b/app/components/markdown/transform.test.js index 80189a680..fdedab7a9 100644 --- a/app/components/markdown/transform.test.js +++ b/app/components/markdown/transform.test.js @@ -3100,6 +3100,50 @@ function nodeToString(node) { return out; } +const ignoredKeys = {_sourcepos: true, _lastLineBlank: true, _open: true, _string_content: true, _info: true, _isFenced: true, _fenceChar: true, _fenceLength: true, _fenceOffset: true, _onEnter: true, _onExit: true}; +function astToJson(node, visited = [], indent = '') { + let out = '{'; + + const myVisited = [...visited]; + myVisited.push(node); + + const keys = Object.keys(node).filter((key) => !ignoredKeys[key]); + if (keys.length > 0) { + out += '\n'; + } + + for (const [i, key] of keys.entries()) { + out += indent + ' "' + key + '":'; + + const value = node[key]; + if (myVisited.indexOf(value) !== -1) { + out += '[Circular]'; + } else if (value === null) { + out += 'null'; + } else if (typeof value === 'number') { + out += value; + } else if (typeof value === 'string') { + out += '"' + value + '"'; + } else if (typeof value === 'boolean') { + out += String(value); + } else if (typeof value === 'object') { + out += astToJson(value, myVisited, indent + ' '); // eslint-disable-line @typescript-eslint/no-unused-vars + } + + if (i !== keys.length - 1) { + out += ',\n'; + } + } + + if (keys.length > 0) { + out += '\n' + indent; + } + + out += '}'; + + return out; +} + // Converts an AST represented as a JavaScript object into a full Commonmark-compatitle AST. // This function is intended for use while testing. An example of input would be: // { diff --git a/app/components/post_draft/__snapshots__/post_draft.test.js.snap b/app/components/post_draft/__snapshots__/post_draft.test.js.snap index e8056f863..b2fce7be7 100644 --- a/app/components/post_draft/__snapshots__/post_draft.test.js.snap +++ b/app/components/post_draft/__snapshots__/post_draft.test.js.snap @@ -3,7 +3,7 @@ exports[`PostDraft Should render the Archived for channelIsArchived 1`] = ` - + `; diff --git a/app/components/post_draft/send_action/__snapshots__/send.test.js.snap b/app/components/post_draft/send_action/__snapshots__/send.test.js.snap index 069592290..d940e01e0 100644 --- a/app/components/post_draft/send_action/__snapshots__/send.test.js.snap +++ b/app/components/post_draft/send_action/__snapshots__/send.test.js.snap @@ -3,7 +3,7 @@ exports[`SendAction should change theme backgroundColor to 0.3 opacity 1`] = ` { const {unreadCount} = this.props; - - // @ts-expect-error context type definition const {formatMessage} = this.context.intl; const isInitialMessage = unreadCount === count; diff --git a/app/components/post_list/post/body/content/message_attachments/__snapshots__/attachment_footer.test.tsx.snap b/app/components/post_list/post/body/content/message_attachments/__snapshots__/attachment_footer.test.tsx.snap index b30051ee7..bee08d2fe 100644 --- a/app/components/post_list/post/body/content/message_attachments/__snapshots__/attachment_footer.test.tsx.snap +++ b/app/components/post_list/post/body/content/message_attachments/__snapshots__/attachment_footer.test.tsx.snap @@ -3,7 +3,7 @@ exports[`AttachmentFooter it matches snapshot when both footer and footer_icon are provided 1`] = ` @username @username @username @other.user @username. @@ -233,8 +233,8 @@ exports[`renderSystemMessage uses renderer for Guest added and join to channel 2 exports[`renderSystemMessage uses renderer for OLD archived channel without a username 1`] = ` @username @username { + const registerViewableItemsListener = useCallback((listener) => { onViewableItemsChangedListener.current = listener; const removeListener = () => { onViewableItemsChangedListener.current = undefined; @@ -113,7 +113,7 @@ const PostList = ({ return removeListener; }, []); - const registerScrollEndIndexListener = useCallback((listener: any) => { + const registerScrollEndIndexListener = useCallback((listener) => { onScrollEndIndexListener.current = listener; const removeListener = () => { onScrollEndIndexListener.current = undefined; @@ -122,7 +122,7 @@ const PostList = ({ return removeListener; }, []); - const keyExtractor = useCallback((item: string) => { + const keyExtractor = useCallback((item) => { // All keys are strings (either post IDs or special keys) return item; }, []); @@ -173,7 +173,7 @@ const PostList = ({ } }, []); - const renderItem = useCallback(({item, index}: ListRenderItemInfo) => { + const renderItem = useCallback(({item, index}) => { if (isStartOfNewMessages(item)) { // postIds includes a date item after the new message indicator so 2 // needs to be added to the index for the length check to be correct. diff --git a/app/components/progressive_image/__snapshots__/progressive_image.test.js.snap b/app/components/progressive_image/__snapshots__/progressive_image.test.js.snap index c22f90784..1ca1fdf6b 100644 --- a/app/components/progressive_image/__snapshots__/progressive_image.test.js.snap +++ b/app/components/progressive_image/__snapshots__/progressive_image.test.js.snap @@ -3,26 +3,26 @@ exports[`ProgressiveImage should match snapshot for BackgroundImage 1`] = ` @@ -56,8 +56,8 @@ exports[`ProgressiveImage should match snapshot for Default Image 1`] = ` resizeMode="contain" source="https://images.com/image.png" style={ - [ - { + Array [ + Object { "bottom": 0, "left": 0, "position": "absolute", @@ -75,14 +75,14 @@ exports[`ProgressiveImage should match snapshot for Default Image 1`] = ` exports[`ProgressiveImage should match snapshot for Image 1`] = ` } containerStyle={ - { + Object { "backgroundColor": "#ffffff", "flex": 1, "paddingBottom": 0, @@ -73,14 +73,14 @@ exports[`SearchBar should match snapshot 1`] = ` editable={true} enablesReturnKeyAutomatically={true} inputContainerStyle={ - { + Object { "backgroundColor": undefined, "borderRadius": 2, "height": 10, } } inputStyle={ - { + Object { "backgroundColor": "transparent", "color": "#fff", "fontSize": 14, @@ -93,7 +93,7 @@ exports[`SearchBar should match snapshot 1`] = ` keyboardAppearance="keyboard-appearance" keyboardType="keyboard-type" leftIconContainerStyle={ - { + Object { "marginLeft": 4, "width": 30, } @@ -114,11 +114,11 @@ exports[`SearchBar should match snapshot 1`] = ` name="magnify" size={24} style={ - [ - { + Array [ + Object { "flex": 1, }, - { + Object { "color": "#bbbbbb", "top": 8, }, diff --git a/app/components/sidebars/main/__snapshots__/main_sidebar.test.js.snap b/app/components/sidebars/main/__snapshots__/main_sidebar.test.js.snap index 40c1c0015..d955b64b8 100644 --- a/app/components/sidebars/main/__snapshots__/main_sidebar.test.js.snap +++ b/app/components/sidebars/main/__snapshots__/main_sidebar.test.js.snap @@ -4,7 +4,7 @@ exports[`MainSidebar should match, full snapshot 1`] = ` diff --git a/app/components/sidebars/settings/__snapshots__/settings_sidebar.test.js.snap b/app/components/sidebars/settings/__snapshots__/settings_sidebar.test.js.snap index eac01aae4..f56a457a1 100644 --- a/app/components/sidebars/settings/__snapshots__/settings_sidebar.test.js.snap +++ b/app/components/sidebars/settings/__snapshots__/settings_sidebar.test.js.snap @@ -5,7 +5,7 @@ exports[`SettingsSidebar Custom Status should close sidebar when update custom s drawerPosition="right" drawerWidth={710} forwardRef={ - { + Object { "current": null, } } @@ -21,7 +21,7 @@ exports[`SettingsSidebar Custom Status should keep sidebar open when update cust drawerPosition="right" drawerWidth={710} forwardRef={ - { + Object { "current": null, } } @@ -37,7 +37,7 @@ exports[`SettingsSidebar should match snapshot 1`] = ` drawerPosition="right" drawerWidth={710} forwardRef={ - { + Object { "current": null, } } @@ -53,7 +53,7 @@ exports[`SettingsSidebar should match snapshot with custom status enabled 1`] = drawerPosition="right" drawerWidth={710} forwardRef={ - { + Object { "current": null, } } @@ -69,7 +69,7 @@ exports[`SettingsSidebar should match snapshot with custom status expiry 1`] = ` drawerPosition="right" drawerWidth={710} forwardRef={ - { + Object { "current": null, } } diff --git a/app/components/slide_up_panel/__snapshots__/slide_up_panel_indicator.test.js.snap b/app/components/slide_up_panel/__snapshots__/slide_up_panel_indicator.test.js.snap index 253701c84..e2e49dd9b 100644 --- a/app/components/slide_up_panel/__snapshots__/slide_up_panel_indicator.test.js.snap +++ b/app/components/slide_up_panel/__snapshots__/slide_up_panel_indicator.test.js.snap @@ -3,7 +3,7 @@ exports[`SlideUpPanelIndicator should match snapshot 1`] = ` 00:15 diff --git a/app/products/calls/components/__snapshots__/floating_call_container.test.js.snap b/app/products/calls/components/__snapshots__/floating_call_container.test.js.snap index ca28a87f8..31e9b18d9 100644 --- a/app/products/calls/components/__snapshots__/floating_call_container.test.js.snap +++ b/app/products/calls/components/__snapshots__/floating_call_container.test.js.snap @@ -4,8 +4,8 @@ exports[`FloatingCallContainer should match snapshot 1`] = ` { diff --git a/app/products/calls/components/join_call/__snapshots__/join_call.test.js.snap b/app/products/calls/components/join_call/__snapshots__/join_call.test.js.snap index a79cab84c..4df265679 100644 --- a/app/products/calls/components/join_call/__snapshots__/join_call.test.js.snap +++ b/app/products/calls/components/join_call/__snapshots__/join_call.test.js.snap @@ -3,7 +3,7 @@ exports[`JoinCall should match snapshot 1`] = ` } userIds={ - [ + Array [ "user-1-id", "user-2-id", ] diff --git a/app/products/calls/hooks.ts b/app/products/calls/hooks.ts index 4b09d545c..d6911a7e1 100644 --- a/app/products/calls/hooks.ts +++ b/app/products/calls/hooks.ts @@ -57,7 +57,6 @@ export const useCallsChannelSettings = () => { useEffect(() => { if (pluginEnabled) { - // @ts-expect-error ActionFunc dispatch(loadConfig()); } }, []); diff --git a/app/products/calls/screens/call/__snapshots__/call_screen.test.js.snap b/app/products/calls/screens/call/__snapshots__/call_screen.test.js.snap index 0e8bafcf5..4bc3e1d4b 100644 --- a/app/products/calls/screens/call/__snapshots__/call_screen.test.js.snap +++ b/app/products/calls/screens/call/__snapshots__/call_screen.test.js.snap @@ -1,16 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`CallScreen Landscape should match snapshot 1`] = ` - - + `; exports[`CallScreen Landscape should match snapshot with screenshare 1`] = ` - - + `; exports[`CallScreen Portrait should match snapshot 1`] = ` - - + `; exports[`CallScreen Portrait should match snapshot with screenshare 1`] = ` - - + `; exports[`CallScreen should show controls in landscape view on click the screen share 1`] = ` - - + `; exports[`CallScreen should show controls in landscape view on click the users list 1`] = ` - - + `; diff --git a/app/products/calls/screens/call_other_actions/__snapshots__/action.test.js.snap b/app/products/calls/screens/call_other_actions/__snapshots__/action.test.js.snap index ba7dd1d9b..ab6765fe7 100644 --- a/app/products/calls/screens/call_other_actions/__snapshots__/action.test.js.snap +++ b/app/products/calls/screens/call_other_actions/__snapshots__/action.test.js.snap @@ -3,7 +3,7 @@ exports[`Action should match snapshot 1`] = `