diff --git a/.circleci/config.yml b/.circleci/config.yml index 182e6433906e1c218488618593f46d3f7331a424..7277eef8ca56e57b00b9ca662ad25132275ae44d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,8 @@ defaults: &defaults macos: &macos macos: - xcode: "12.1.0" + xcode: "12.5.0" + resource_class: large bash-env: &bash-env BASH_ENV: "~/.nvm/nvm.sh" @@ -37,15 +38,6 @@ save-npm-cache-mac: &save-npm-cache-mac paths: - ./node_modules -install-node: &install-node - name: Install Node - command: | - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash - source ~/.nvm/nvm.sh - INSTALLED_NODE=`nvm which current` - echo "export PATH=\"${INSTALLED_NODE%%/node}:\$PATH\"" >> ~/.bash_profile - source ~/.bash_profile - restore-gems-cache: &restore-gems-cache name: Restore gems cache key: bundle-v1-{{ checksum "ios/Gemfile.lock" }} @@ -83,13 +75,32 @@ restore_cache: &restore-gradle-cache # COMMANDS commands: + manage-pods: + description: "Restore/Get/Save cache of pods libs" + steps: + - restore_cache: + name: Restore pods + # TODO: CircleCI isn't caching Podfile.lock correctly, because checksum changes after install + # key: pods-v1-{{ checksum "ios/Podfile.lock" }} + key: pods-v1-{{ checksum "ios/Podfile" }} + - run: + name: Install pods libs + command: | + bundle exec pod install + working_directory: ios + - save_cache: + name: Save pods specs and pods cache + # key: pods-v1-{{ checksum "ios/Podfile.lock" }} + key: pods-v1-{{ checksum "ios/Podfile" }} + paths: + - ~/.pods + - ios/Pods + android-build: description: "Build Android app" steps: - checkout - - run: *install-node - - restore_cache: *restore-npm-cache-linux - run: *install-npm-modules @@ -133,15 +144,6 @@ commands: fi working_directory: android/app - - run: - name: Config variables - command: | - if [[ $CIRCLE_JOB == "android-build-official" ]]; then - echo -e "export default { BUGSNAG_API_KEY: '$BUGSNAG_KEY_OFFICIAL' };" > ./config.js - else - echo -e "export default { BUGSNAG_API_KEY: '$BUGSNAG_KEY' };" > ./config.js - fi - - run: name: Build App command: | @@ -160,22 +162,20 @@ commands: name: Upload sourcemaps to Bugsnag command: | if [[ $CIRCLE_JOB == "android-build-official" ]]; then - yarn generate-source-maps-android upload \ + npx bugsnag-source-maps upload-react-native \ --api-key=$BUGSNAG_KEY_OFFICIAL \ - --app-version=$CIRCLE_BUILD_NUM \ - --minifiedFile=android/app/build/generated/assets/react/officialPlay/release/app.bundle \ + --app-version-code=$CIRCLE_BUILD_NUM \ + --platform android \ --source-map=android/app/build/generated/sourcemaps/react/officialPlay/release/app.bundle.map \ - --minified-url=app.bundle \ - --upload-sources + --bundle android/app/build/generated/assets/react/officialPlay/release/app.bundle fi if [[ $CIRCLE_JOB == "android-build-experimental" ]]; then - yarn generate-source-maps-android upload \ + npx bugsnag-source-maps upload-react-native \ --api-key=$BUGSNAG_KEY \ - --app-version=$CIRCLE_BUILD_NUM \ - --minifiedFile=android/app/build/generated/assets/react/experimentalPlay/release/app.bundle \ + --app-version-code=$CIRCLE_BUILD_NUM \ + --platform android \ --source-map=android/app/build/generated/sourcemaps/react/experimentalPlay/release/app.bundle.map \ - --minified-url=app.bundle \ - --upload-sources + --bundle android/app/build/generated/assets/react/experimentalPlay/release/app.bundle fi - store_artifacts: @@ -196,9 +196,9 @@ commands: - checkout - restore_cache: *restore-gems-cache - restore_cache: *restore-npm-cache-mac - - run: *install-node - run: *install-npm-modules - run: *update-fastlane-ios + - manage-pods - run: name: Set Google Services command: | @@ -206,48 +206,27 @@ commands: echo $GOOGLE_SERVICES_IOS | base64 --decode > GoogleService-Info.plist fi working_directory: ios - - run: - name: Upload sourcemaps to Bugsnag - command: | - if [[ $CIRCLE_JOB == "ios-build-official" ]]; then - yarn generate-source-maps-ios - curl https://upload.bugsnag.com/react-native-source-map \ - -F apiKey=$BUGSNAG_KEY_OFFICIAL \ - -F appBundleVersion=$CIRCLE_BUILD_NUM \ - -F dev=false \ - -F platform=ios \ - -F sourceMap=@ios-release.bundle.map \ - -F bundle=@ios-release.bundle - fi - if [[ $CIRCLE_JOB == "ios-build-experimental" ]]; then - yarn generate-source-maps-ios - curl https://upload.bugsnag.com/react-native-source-map \ - -F apiKey=$BUGSNAG_KEY \ - -F appBundleVersion=$CIRCLE_BUILD_NUM \ - -F dev=false \ - -F platform=ios \ - -F sourceMap=@ios-release.bundle.map \ - -F bundle=@ios-release.bundle - fi - run: name: Fastlane Build - no_output_timeout: 1200 + no_output_timeout: 40m command: | agvtool new-version -all $CIRCLE_BUILD_NUM if [[ $CIRCLE_JOB == "ios-build-official" ]]; then - /usr/libexec/PlistBuddy -c "Set BugsnagAPIKey $BUGSNAG_KEY_OFFICIAL" ./RocketChatRN/Info.plist + /usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY_OFFICIAL" ./RocketChatRN/Info.plist + /usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY_OFFICIAL" ./ShareRocketChatRN/Info.plist /usr/libexec/PlistBuddy -c "Set IS_OFFICIAL YES" ./RocketChatRN/Info.plist /usr/libexec/PlistBuddy -c "Set IS_OFFICIAL YES" ./ShareRocketChatRN/Info.plist /usr/libexec/PlistBuddy -c "Set IS_OFFICIAL YES" ./NotificationService/Info.plist else - /usr/libexec/PlistBuddy -c "Set BugsnagAPIKey $BUGSNAG_KEY" ./RocketChatRN/Info.plist + /usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY" ./RocketChatRN/Info.plist + /usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY" ./ShareRocketChatRN/Info.plist /usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./RocketChatRN/Info.plist /usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./ShareRocketChatRN/Info.plist /usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./NotificationService/Info.plist fi - if [[ $APP_STORE_CONNECT_API_KEY ]]; then - echo $APP_STORE_CONNECT_API_KEY | base64 --decode > ./fastlane/app_store_connect_api_key.p8 + if [[ $APP_STORE_CONNECT_API_BASE64 ]]; then + echo $APP_STORE_CONNECT_API_BASE64 | base64 --decode > ./fastlane/app_store_connect_api_key.p8 if [[ $CIRCLE_JOB == "ios-build-official" ]]; then bundle exec fastlane ios build_official else @@ -290,6 +269,23 @@ commands: command: bundle exec fastlane android beta official:<< parameters.official >> working_directory: android + # EXPERIMENTAL ONLY + upload-to-internal-app-sharing: + description: "Upload to Internal App Sharing" + steps: + - checkout + - attach_workspace: + at: android + - run: + name: Store the google service account key + command: echo "$FASTLANE_GOOGLE_SERVICE_ACCOUNT" | base64 --decode > service_account.json + working_directory: android + - run: *update-fastlane-android + - run: + name: Fastlane Play Store Upload + command: bundle exec fastlane android internal_app_sharing + working_directory: android + # EXPERIMENTAL ONLY # No plans to do it for Official upload-to-google-play-production: @@ -318,11 +314,13 @@ commands: - attach_workspace: at: ios - restore_cache: *restore-gems-cache + - restore_cache: *restore-npm-cache-mac - run: *update-fastlane-ios + - manage-pods - run: name: Fastlane Tesflight Upload command: | - echo $APP_STORE_CONNECT_API_KEY | base64 --decode > ./fastlane/app_store_connect_api_key.p8 + echo $APP_STORE_CONNECT_API_BASE64 | base64 --decode > ./fastlane/app_store_connect_api_key.p8 bundle exec fastlane ios beta official:<< parameters.official >> working_directory: ios - save_cache: *save-gems-cache @@ -341,7 +339,7 @@ jobs: lint-testunit: <<: *defaults docker: - - image: circleci/node:10 + - image: circleci/node:15 environment: CODECOV_TOKEN: caa771ab-3d45-4756-8e2a-e1f25996fef6 @@ -374,7 +372,7 @@ jobs: android-build-experimental: <<: *defaults docker: - - image: circleci/android:api-28-node + - image: circleci/android:api-29-node environment: <<: *android-env <<: *bash-env @@ -384,18 +382,26 @@ jobs: android-build-official: <<: *defaults docker: - - image: circleci/android:api-28-node + - image: circleci/android:api-29-node environment: <<: *android-env <<: *bash-env steps: - android-build - android-google-play-beta-experimental: + android-internal-app-sharing-experimental: <<: *defaults docker: - image: circleci/android:api-28-node + steps: + - upload-to-internal-app-sharing + + android-google-play-beta-experimental: + <<: *defaults + docker: + - image: circleci/android:api-29-node + steps: - upload-to-google-play-beta: official: false @@ -403,14 +409,14 @@ jobs: android-google-play-production-experimental: <<: *defaults docker: - - image: circleci/android:api-28-node + - image: circleci/android:api-29-node steps: - upload-to-google-play-production android-google-play-beta-official: <<: *defaults docker: - - image: circleci/android:api-28-node + - image: circleci/android:api-29-node steps: - upload-to-google-play-beta: @@ -452,13 +458,9 @@ workflows: - ios-build-experimental: requires: - ios-hold-build-experimental - - ios-hold-testflight-experimental: - type: approval - requires: - - ios-build-experimental - ios-testflight-experimental: requires: - - ios-hold-testflight-experimental + - ios-build-experimental # iOS Official - ios-hold-build-official: @@ -484,6 +486,9 @@ workflows: - android-build-experimental: requires: - android-hold-build-experimental + - android-internal-app-sharing-experimental: + requires: + - android-build-experimental - android-hold-google-play-beta-experimental: type: approval requires: diff --git a/.eslintignore b/.eslintignore index 9594dcce67bf1289724e2ebc036d3d098353e0a7..edc3a77e7b9362e5e5c4ce189c7e83cd85d3c612 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,4 +3,5 @@ node_modules coverage e2e/docker android -ios \ No newline at end of file +ios +.eslintrc.js \ No newline at end of file diff --git a/.gitignore b/.gitignore index d34d2867163d9c666c4294d62ab2c8b835e40f32..4ffd99aa9f11a39d9fc818549e303855d5808040 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ DerivedData *.xcuserstate project.xcworkspace *.mobileprovision +ios/Pods/ # Android/IntelliJ # diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..31354ec1389994b5f6708c7d915fdcc6bb76ba6e --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000000000000000000000000000000000..6e9bf51fa78b7a530d5c58c5c649251ae145704e --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run precommit diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dee6f6dd4de40403a0ba3b3e609a95275aac72be..6775dbd8cb977b802169e4c0656a97f2ae5aafdf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,6 +20,7 @@ yarn Run the app: ```sh +npx pod-install yarn ios ``` diff --git a/__mocks__/@bugsnag/react-native.js b/__mocks__/@bugsnag/react-native.js new file mode 100644 index 0000000000000000000000000000000000000000..ecf2f5a4ef644cbbf41a2e02c20db7c4d9839c20 --- /dev/null +++ b/__mocks__/@bugsnag/react-native.js @@ -0,0 +1,5 @@ +export default { + start: () => '', + leaveBreadcrumb: () => '', + notify: () => '' +}; diff --git a/__mocks__/bugsnag-react-native.js b/__mocks__/bugsnag-react-native.js deleted file mode 100644 index 637b8e450cf1d72e06e5c7fd771c920a5234cd72..0000000000000000000000000000000000000000 --- a/__mocks__/bugsnag-react-native.js +++ /dev/null @@ -1,8 +0,0 @@ -export class Client { } - -export default { - bugsnag: () => '', - leaveBreadcrumb: () => '', - notify: () => '', - loggerConfig: () => '' -}; diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index f7291f458896b8954c8bec1ccabf78b80860b139..fc2569dd26e4e1f1481732b782b353a8af1e259d 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -20361,6 +20361,15 @@ exports[`Storyshots Message Colored attachments 1`] = ` } } > + + + `; -exports[`Storyshots Message Static avatar 1`] = ` +exports[`Storyshots Message Show a button as attachment 1`] = ` - - - - Message - - - - - - - - - - -`; - -exports[`Storyshots Message System messages 1`] = ` - - - - - - - + + "backgroundColor": "transparent", + "fontFamily": "System", + "fontSize": 16, + "fontWeight": "400", + "textAlign": "left", + } + } + > + Test Button + - - - - - - - - diego.mello - - - - Message removed + Text button - + + + +`; + +exports[`Storyshots Message Static avatar 1`] = ` + + - + + + + diego.mello + + - diego.mello + 10:00 AM - + + - has joined the channel + + Message + - + + + +`; + +exports[`Storyshots Message System messages 1`] = ` + + - Message pinned + Message removed @@ -41205,7 +41164,7 @@ exports[`Storyshots Message System messages 1`] = ` - has left the channel + has joined the channel @@ -41347,25 +41306,48 @@ exports[`Storyshots Message System messages 1`] = ` ] } > - - User rocket.cat removed by diego.mello + + + diego.mello + + + + Message pinned + @@ -41489,25 +41471,332 @@ exports[`Storyshots Message System messages 1`] = ` ] } > - - User rocket.cat added by diego.mello + + + diego.mello + + + + has left the channel + + + + + + + + + + + + + + + + + + + + + User rocket.cat removed by diego.mello + + + + + + + + + + + + + + + + + + + + User rocket.cat added by diego.mello @@ -43276,13 +43565,267 @@ exports[`Storyshots Message Temp 1`] = ` 10:00 AM - + + + + Temp message + + + + + + + + + + +`; + +exports[`Storyshots Message Thumbnail from server 1`] = ` + + + + + + + + + + + + + + + + + + diego.mello + + + + 10:00 AM + + + - Temp message + this is a thumbnail + + + + + Title + + + + + + + + Image text + + + + @@ -47162,6 +47852,15 @@ exports[`Storyshots Message With file 1`] = ` } } > + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + , , , , , , + + + Short Text + + + + + + + + Long Text + + + + + + +`; + exports[`Storyshots Thread Messages.Item badge 1`] = ` diff --git a/android/app/build.gradle b/android/app/build.gradle index 95628ac2fdb0ad2be2cd28e06be61a65cebb2648..b25b12f7c6a45eeae46c68a38f665a10c8708e09 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -144,7 +144,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode VERSIONCODE as Integer - versionName "4.18.0" + versionName "4.19.0" vectorDrawables.useSupportLibrary = true if (!isFoss) { manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String] diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 5d83092fd684fc75dc8dfaf673ad7b5a3eeec8ec..efbd3e20b0ee054d905c096211bf2d1435dc344d 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -7,7 +7,9 @@ tools:ignore="GoogleAppIndexingWarning" tools:replace="android:name" tools:targetApi="28" - android:networkSecurityConfig="@xml/network_security_config" /> + android:networkSecurityConfig="@xml/network_security_config"> + + \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8c3ab8d1833feb38df8bc8a2a03f00efee0a8598..7fa01e3f4e8226ae66e8cba665b023245478a37f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -57,7 +57,6 @@ android:scheme="rocketchat" /> - -