Skip to content

Commit

Permalink
Merge branch 'main' into fix/36267-report-name-formula
Browse files Browse the repository at this point in the history
  • Loading branch information
paultsimura committed Feb 28, 2024
2 parents 903527f + bee752a commit 77c360b
Show file tree
Hide file tree
Showing 305 changed files with 5,573 additions and 4,527 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/node_modules/*
**/dist/*
android/**/build/*
.github/actions/**/index.js"
docs/vendor/**
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const restrictedImportPatterns = [
];

module.exports = {
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-hooks/recommended', 'plugin:react-native-a11y/basic', 'plugin:@dword-design/import-alias/recommended', 'prettier'],
plugins: ['react-hooks', 'react-native-a11y'],
extends: ['expensify', 'plugin:storybook/recommended', 'plugin:react-native-a11y/basic', 'plugin:@dword-design/import-alias/recommended', 'prettier'],
plugins: ['react-native-a11y'],
parser: 'babel-eslint',
ignorePatterns: ['!.*', 'src/vendor', '.github/actions/**/index.js', 'desktop/dist/*.js', 'dist/*.js', 'node_modules/.bin/**', 'node_modules/.cache/**', '.git/**'],
env: {
Expand All @@ -87,6 +87,7 @@ module.exports = {
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
plugins: ['react'],
rules: {
'prefer-regex-literals': 'off',
'rulesdir/no-multiple-onyx-in-file': 'off',
'rulesdir/onyx-props-must-have-default': 'off',
'react-native-a11y/has-accessibility-hint': ['off'],
Expand All @@ -112,6 +113,7 @@ module.exports = {
'@styles': './src/styles',
// This path is provide alias for files like `ONYXKEYS` and `CONST`.
'@src': './src',
'@desktop': './desktop',
},
},
],
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/NewLibraryRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ labels: Weekly, AutoAssignerAppLibraryReview
---
In order to properly evaluate if a new library can be added to `package.json`, please fill out this request form. It will be automatically assigned someone from our review team that will go through and vet the library.

*In order to add any new production dependency, it must be approved by the App Deployer team. They will evaluate the library and decide if it's something we want to move forward with or if other alternatives should be explored.*

Note: This is only for production dependencies. While we don't want people to add packages to dev-dependencies willy-nilly, we recognize that there isn't as great of a need there to secure them.

# Name of library:
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/composite/setupNode/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Set up Node
description: Set up Node

outputs:
cache-hit:
description: Was there a cache hit on the main node_modules?
value: ${{ steps.cache-node-modules.outputs.cache-hit }}

runs:
using: composite
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ jobs:
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}

- name: Setup Node
id: setup-node
uses: ./.github/actions/composite/setupNode

- name: Setup Ruby
Expand All @@ -197,7 +198,7 @@ jobs:
id: pods-cache
with:
path: ios/Pods
key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock') }}
key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock', 'firebase.json') }}
restore-keys: ${{ runner.os }}-pods-cache-

- name: Compare Podfile.lock and Manifest.lock
Expand All @@ -206,7 +207,7 @@ jobs:

- name: Install cocoapods
uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350
if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true'
if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true' || steps.setup-node.outputs.cache-hit != 'true'
with:
timeout_minutes: 10
max_attempts: 5
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ jobs:
echo "PULL_REQUEST_NUMBER=$PULL_REQUEST_NUMBER" >> .env.adhoc
- name: Setup Node
id: setup-node
uses: ./.github/actions/composite/setupNode

- name: Setup XCode
Expand All @@ -170,7 +171,7 @@ jobs:
id: pods-cache
with:
path: ios/Pods
key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock') }}
key: ${{ runner.os }}-pods-cache-${{ hashFiles('ios/Podfile.lock', 'firebase.json') }}
restore-keys: ${{ runner.os }}-pods-cache-

- name: Compare Podfile.lock and Manifest.lock
Expand All @@ -179,7 +180,7 @@ jobs:

- name: Install cocoapods
uses: nick-invision/retry@0711ba3d7808574133d713a0d92d2941be03a350
if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true'
if: steps.pods-cache.outputs.cache-hit != 'true' || steps.compare-podfile-and-manifest.outputs.IS_PODFILE_SAME_AS_MANIFEST != 'true' || steps.setup-node.outputs.cache-hit != 'true'
with:
timeout_minutes: 10
max_attempts: 5
Expand Down
15 changes: 14 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ module.exports = {
arrowParens: 'always',
printWidth: 190,
singleAttributePerLine: true,
importOrder: ['@assets/(.*)$', '@components/(.*)$', '@hooks/(.*)$', '@libs/(.*)$', '@navigation/(.*)$', '@pages/(.*)$', '@styles/(.*)$', '@userActions/(.*)$', '@src/(.*)$', '^[./]'],
/** `importOrder` should be defined in an alphabetical order. */
importOrder: [
'@assets/(.*)$',
'@components/(.*)$',
'@desktop/(.*)$',
'@hooks/(.*)$',
'@libs/(.*)$',
'@navigation/(.*)$',
'@pages/(.*)$',
'@styles/(.*)$',
'@userActions/(.*)$',
'@src/(.*)$',
'^[./]',
],
importOrderSortSpecifiers: true,
importOrderCaseInsensitive: true,
};
1 change: 1 addition & 0 deletions __mocks__/react-native-localize.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-import-module-exports
import mockRNLocalize from 'react-native-localize/mock';

module.exports = mockRNLocalize;
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type {View as RNView} from 'react-native';

jest.mock('react-native-webview', () => {
const {View} = require('react-native');
return {
WebView: () => View,
WebView: () => View as RNView,
};
});
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001044314
versionName "1.4.43-14"
versionCode 1001044407
versionName "1.4.44-7"
}

flavorDimensions "default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.media.AudioAttributes;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.service.notification.StatusBarNotification;
Expand All @@ -31,6 +33,7 @@
import androidx.core.graphics.drawable.IconCompat;
import androidx.versionedparcelable.ParcelUtils;

import com.expensify.chat.R;
import com.urbanairship.AirshipConfigOptions;
import com.urbanairship.json.JsonMap;
import com.urbanairship.json.JsonValue;
Expand Down Expand Up @@ -105,6 +108,9 @@ protected NotificationCompat.Builder onExtendBuilder(@NonNull Context context, @
builder.setChannelId(CHANNEL_MESSAGES_ID);
} else {
builder.setPriority(PRIORITY_MAX);
// Set sound for versions below Oreo
// for Oreo and above we set sound on the notification's channel level
builder.setSound(getSoundFile(context));
}

// Attempt to parse data and apply custom notification styling
Expand All @@ -130,6 +136,13 @@ private void createAndRegisterNotificationChannel(@NonNull Context context) {
NotificationChannelGroup channelGroup = new NotificationChannelGroup(NOTIFICATION_GROUP_CHATS, CHANNEL_GROUP_NAME);
NotificationChannel channel = new NotificationChannel(CHANNEL_MESSAGES_ID, CHANNEL_MESSAGES_NAME, NotificationManager.IMPORTANCE_HIGH);

AudioAttributes audioAttributes = new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_NOTIFICATION)
.build();

channel.setSound(getSoundFile(context), audioAttributes);

NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
notificationManager.createNotificationChannelGroup(channelGroup);
notificationManager.createNotificationChannel(channel);
Expand Down Expand Up @@ -333,4 +346,8 @@ private Bitmap fetchIcon(@NonNull Context context, String urlString) {

return null;
}

private Uri getSoundFile(Context context) {
return Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.receive);
}
}
Loading

0 comments on commit 77c360b

Please sign in to comment.