Skip to content

Commit

Permalink
Merge branch 'main' into krishna2323/issue/53617
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishna2323 authored Jan 24, 2025
2 parents 2334017 + 2c846db commit 737f1f0
Show file tree
Hide file tree
Showing 408 changed files with 10,640 additions and 5,482 deletions.
8 changes: 1 addition & 7 deletions .eslintrc.changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ module.exports = {
},
overrides: [
{
files: [
'src/libs/actions/IOU.ts',
'src/libs/actions/Report.ts',
'src/pages/workspace/WorkspaceInitialPage.tsx',
'src/pages/home/report/PureReportActionItem.tsx',
'src/libs/SidebarUtils.ts',
],
files: ['src/pages/workspace/WorkspaceInitialPage.tsx', 'src/pages/home/report/PureReportActionItem.tsx', 'src/libs/SidebarUtils.ts'],
rules: {
'rulesdir/no-default-id-values': 'off',
},
Expand Down
18 changes: 17 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@ const path = require('path');
const restrictedImportPaths = [
{
name: 'react-native',
importNames: ['useWindowDimensions', 'StatusBar', 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', 'Text', 'ScrollView'],
importNames: [
'useWindowDimensions',
'StatusBar',
'TouchableOpacity',
'TouchableWithoutFeedback',
'TouchableNativeFeedback',
'TouchableHighlight',
'Pressable',
'Text',
'ScrollView',
'Animated',
],
message: [
'',
"For 'useWindowDimensions', please use '@src/hooks/useWindowDimensions' instead.",
"For 'TouchableOpacity', 'TouchableWithoutFeedback', 'TouchableNativeFeedback', 'TouchableHighlight', 'Pressable', please use 'PressableWithFeedback' and/or 'PressableWithoutFeedback' from '@components/Pressable' instead.",
"For 'StatusBar', please use '@libs/StatusBar' instead.",
"For 'Text', please use '@components/Text' instead.",
"For 'ScrollView', please use '@components/ScrollView' instead.",
"For 'Animated', please use 'Animated' from 'react-native-reanimated' instead.",
].join('\n'),
},
{
Expand Down Expand Up @@ -134,6 +146,10 @@ module.exports = {
{
selector: ['variable', 'property'],
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
filter: {
regex: '^private_[a-z][a-zA-Z0-9]+$',
match: false,
},
},
{
selector: 'function',
Expand Down
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/TooltipsTemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: 'Tooltips Template'
about: Create this issue when adding a new tooltip to New Expensify
labels: Daily, Design, WaitingForCopy
title: 'Tooltips Template'
---
Refer to https://stackoverflowteams.com/c/expensify/questions/20762 for the full process to add a tooltip.

### Problem
Enter the problem that currently exists without the tooltip.

### Solution
Enter the solution that implementing the tooltip will achieve.

### What is the purpose of the tooltip?
Enter the purpose.

### How should the tooltip look
Add the Figma Mock Up that Design builds.

### Condition
We should show this tooltip to:

### Decide the prioritisation

Priority score:

NOTE: Only one tooltip is shown at a time.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ $
PROPOSAL:


<!---
If you want to trigger adhoc build of hybrid app from specific Mobile-Expensify PR please specify it like follows:
MOBILE-EXPENSIFY: PR number
--->

### Tests
<!---
Add a numbered list of manual tests you performed that validates your changes work on all platforms, and that there are no regressions present.
Expand Down
12 changes: 6 additions & 6 deletions .github/actions/javascript/proposalPoliceComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18007,6 +18007,11 @@ async function run() {
console.log('Comment body is either empty or doesn\'t contain the keyword "Proposal": ', payload.comment?.body);
return;
}
// If event is `edited` and comment was already edited by the bot, return early
if (isCommentEditedEvent(payload) && payload.comment?.body.trim().includes('Edited by **proposal-police**')) {
console.log('Comment was already edited by proposal-police once.\n', payload.comment?.body);
return;
}
console.log('ProposalPolice™ Action triggered for comment:', payload.comment?.body);
console.log('-> GitHub Action Type: ', payload.action?.toUpperCase());
if (!isCommentCreatedEvent(payload) && !isCommentEditedEvent(payload)) {
Expand All @@ -18033,12 +18038,7 @@ async function run() {
if (isCommentCreatedEvent(payload) && isActionRequired) {
const formattedResponse = message
// replace {user} from response template with @username
.replaceAll('{user}', `@${payload.comment?.user.login}`)
// replace {proposalLink} from response template with the link to the comment
.replaceAll('{proposalLink}', payload.comment?.html_url)
// remove any double quotes from the final comment because sometimes the assistant's
// response contains double quotes / sometimes it doesn't
.replaceAll('"', '');
.replaceAll('{user}', `@${payload.comment?.user.login}`);
// Create a comment with the assistant's response
console.log('ProposalPolice™ commenting on issue...');
await GithubUtils_1.default.createComment(CONST_1.default.APP_REPO, github_1.context.issue.number, formattedResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ async function run() {
return;
}

// If event is `edited` and comment was already edited by the bot, return early
if (isCommentEditedEvent(payload) && payload.comment?.body.trim().includes('Edited by **proposal-police**')) {
console.log('Comment was already edited by proposal-police once.\n', payload.comment?.body);
return;
}

console.log('ProposalPolice™ Action triggered for comment:', payload.comment?.body);
console.log('-> GitHub Action Type: ', payload.action?.toUpperCase());

Expand Down Expand Up @@ -73,14 +79,7 @@ async function run() {
if (isCommentCreatedEvent(payload) && isActionRequired) {
const formattedResponse = message
// replace {user} from response template with @username
.replaceAll('{user}', `@${payload.comment?.user.login}`)

// replace {proposalLink} from response template with the link to the comment
.replaceAll('{proposalLink}', payload.comment?.html_url)

// remove any double quotes from the final comment because sometimes the assistant's
// response contains double quotes / sometimes it doesn't
.replaceAll('"', '');
.replaceAll('{user}', `@${payload.comment?.user.login}`);

// Create a comment with the assistant's response
console.log('ProposalPolice™ commenting on issue...');
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ The GitHub workflows require a large list of secrets to deploy, notify and test
1. `CSC_LINK` - Required to be set for desktop code signing: https://www.electron.build/code-signing.html#travis-appveyor-and-other-ci-servers
1. `CSC_KEY_PASSWORD` - Required to be set for desktop code signing: https://www.electron.build/code-signing.html#travis-appveyor-and-other-ci-servers
1. `APPLE_ID` - Required for notarizing desktop code in `desktop/notarize.js`
1. `APPLE_TEAM_ID` - Required for notarizing desktop code in `desktop/notarize.js`
1. `APPLE_ID_PASSWORD` - Required for notarizing desktop code in `desktop/notarize.js`
1. `AWS_ACCESS_KEY_ID` - Required for hosting website and desktop compiled code
1. `AWS_SECRET_ACCESS_KEY` - Required for hosting website and desktop compiled code
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ jobs:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ jobs:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
81 changes: 62 additions & 19 deletions .github/workflows/testBuildHybrid.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
name: Build and deploy hybird apps for testing
name: Build and deploy hybrid apps for testing

on:
workflow_dispatch:
inputs:
PULL_REQUEST_NUMBER:
description: Pull Request number for correct placement of apps
required: true
OLD_DOT_COMMIT:
description: The branch, tag or SHA to checkout on Old Dot side
required: false
pull_request_target:
types: [opened, synchronize, labeled]
branches: ['*ci-test/**']

env:
PULL_REQUEST_NUMBER: ${{ github.event.number || github.event.inputs.PULL_REQUEST_NUMBER }}
OLD_DOT_COMMIT: ${{ github.event.inputs.OLD_DOT_COMMIT }}

jobs:
validateActor:
Expand Down Expand Up @@ -63,6 +59,51 @@ jobs:
echo "REF=$(gh pr view ${{ github.event.inputs.PULL_REQUEST_NUMBER }} --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

getOldDotPR:
runs-on: ubuntu-latest
needs: validateActor
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
outputs:
OLD_DOT_PR: ${{ steps.old-dot-pr.outputs.result }}
steps:
- name: Check if author specifed Old Dot PR
id: old-dot-pr
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
result-encoding: string
script: |
const pullRequest = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: '${{ env.PULL_REQUEST_NUMBER }}'',
});
const body = pullRequest.data.body;
const regex = /MOBILE-EXPENSIFY:(?<prNumber>\d+)/;
const found = body.match(regex)?.groups?.prNumber || "";
return found.trim();
getOldDotBranchRef:
runs-on: ubuntu-latest
needs: getOldDotPR
if: ${{ needs.getOldDotPR.outputs.OLD_DOT_PR != '' }}
outputs:
OLD_DOT_REF: ${{ steps.getHeadRef.outputs.REF }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check if pull request number is correct
id: getHeadRef
run: |
set -e
echo "REF=$(gh pr view ${{ needs.getOldDotPR.outputs.OLD_DOT_PR }} -R 'Expensify/Mobile-Expensify' --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


postGitHubCommentBuildStarted:
runs-on: ubuntu-latest
Expand All @@ -84,7 +125,7 @@ jobs:
androidHybrid:
name: Build Android HybridApp
needs: [validateActor, getBranchRef]
needs: [validateActor, getBranchRef, getOldDotBranchRef]
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
runs-on: ubuntu-latest-xl
outputs:
Expand All @@ -100,15 +141,16 @@ jobs:
fetch-depth: 0

- name: Update submodule to match main
env:
OLD_DOT_COMMIT: ${{ env.OLD_DOT_COMMIT }}
run: |
git submodule update --init --remote
if [[ -z "$OLD_DOT_COMMIT" ]]; then
git fetch
git checkout ${{ env.OLD_DOT_COMMIT }}
fi
- name: Checkout Old Dot to author specified branch or commit
if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
run: |
cd Mobile-Expensify
git fetch
git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}

Expand Down Expand Up @@ -194,7 +236,7 @@ jobs:
iosHybrid:
name: Build and deploy iOS for testing
needs: [validateActor, getBranchRef]
needs: [validateActor, getBranchRef, getOldDotBranchRef]
if: ${{ fromJSON(needs.validateActor.outputs.READY_TO_BUILD) }}
env:
DEVELOPER_DIR: /Applications/Xcode_16.2.0.app/Contents/Developer
Expand All @@ -210,14 +252,15 @@ jobs:
fetch-depth: 0

- name: Update submodule to match main
env:
OLD_DOT_COMMIT: ${{ env.OLD_DOT_COMMIT }}
run: |
git submodule update --init --remote
if [[ -z "$OLD_DOT_COMMIT" ]]; then
git fetch
git checkout ${{ env.OLD_DOT_COMMIT }}
fi
- name: Checkout Old Dot to author specified branch or commit
if: ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF != '' }}
run: |
cd Mobile-Expensify
git fetch
git checkout ${{ needs.getOldDotBranchRef.outputs.OLD_DOT_REF }}
- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion Mobile-Expensify
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -794,20 +794,6 @@ The commands used to compile a production or staging desktop build are `npm run
HOWEVER, by default those commands will try to notarize the build (signing it as Expensify) and publish it to the S3 bucket where it's hosted for users. In most cases you won't actually need or want to do that for your local testing. To get around that and disable those behaviors for your local build, apply the following diff:

```diff
diff --git a/config/electronBuilder.config.js b/config/electronBuilder.config.js
index e4ed685f65..4c7c1b3667 100644
--- a/config/electronBuilder.config.js
+++ b/config/electronBuilder.config.js
@@ -42,9 +42,6 @@ module.exports = {
entitlements: 'desktop/entitlements.mac.plist',
entitlementsInherit: 'desktop/entitlements.mac.plist',
type: 'distribution',
- notarize: {
- teamId: '368M544MTT',
- },
},
dmg: {
title: 'New Expensify',
diff --git a/scripts/build-desktop.sh b/scripts/build-desktop.sh
index 791f59d733..526306eec1 100755
--- a/scripts/build-desktop.sh
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009008603
versionName "9.0.86-3"
versionCode 1009008902
versionName "9.0.89-2"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
5 changes: 5 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
android:theme="@style/AppTheme"
tools:replace="android:supportsRtl">

<service
android:name="com.expensify.reactnativebackgroundtask.BackgroundJobService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false" />

<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
Expand Down
3 changes: 0 additions & 3 deletions config/electronBuilder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ module.exports = {
entitlements: 'desktop/entitlements.mac.plist',
entitlementsInherit: 'desktop/entitlements.mac.plist',
type: 'distribution',
notarize: {
teamId: '368M544MTT',
},
target: [
{
target: 'default',
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
// We are importing this worker as a string by using asset/source otherwise it will default to loading via an HTTPS request later.
// This causes issues if we have gone offline before the pdfjs web worker is set up as we won't be able to load it from the server.
{
test: new RegExp('node_modules/pdfjs-dist/build/pdf.worker.min.mjs'),
test: new RegExp('node_modules/pdfjs-dist/legacy/build/pdf.worker.mjs'),
type: 'asset/source',
},

Expand Down
Loading

0 comments on commit 737f1f0

Please sign in to comment.