Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/App into parasharrajat/vi…
Browse files Browse the repository at this point in the history
…ewtransactions
  • Loading branch information
parasharrajat committed Jan 22, 2025
2 parents bbb8385 + 2c501df commit 3238b9b
Show file tree
Hide file tree
Showing 166 changed files with 3,340 additions and 1,319 deletions.
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
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 1009008804
versionName "9.0.88-4"
versionCode 1009008806
versionName "9.0.88-6"
// 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
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
50 changes: 37 additions & 13 deletions contributingGuides/TS_CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,46 @@

- [1.4](#animated-style) **Animated styles**

```ts
import {useRef} from 'react';
import {Animated, StyleProp, ViewStyle} from 'react-native';
The recommended approach to creating animations is by using the `react-native-reanimated` library,
as it offers greater efficiency and convenience compared to using the `Animated` API directly from
React Native.

```ts
import React from 'react';
import { View, StyleSheet, StyleProp, ViewStyle } from 'react-native';
import Animated, { useAnimatedStyle, useSharedValue, withTiming, SharedValue, WithTimingConfig } from 'react-native-reanimated';

type MyComponentProps = {
style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
opacity: Animated.SharedValue<number>;
};

const MyComponent = ({ opacity }: MyComponentProps) => {
const animatedStyle = useAnimatedStyle(() => ({
opacity: opacity.value,
}));

return (
<Animated.View style={[styles.box, animatedStyle]} />
);
};

const App = () => {
const opacity = useSharedValue(0);

const startAnimation = () => {
opacity.value = withTiming(1, {
duration: 1000,
easing: Easing.inOut(Easing.quad),
});
};

return (
<View style={styles.container}>
<MyComponent opacity={opacity} />
<Button title="Animate" onPress={startAnimation} />
</View>
);
};

function MyComponent({ style }: MyComponentProps) {
return <Animated.View style={style} />;
}

function App() {
const anim = useRef(new Animated.Value(0)).current;
return <MyComponent style={{opacity: anim.interpolate({...})}} />;
}
```

<a name="render-prop"></a><a name="1.5"></a>
Expand Down
2 changes: 1 addition & 1 deletion desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ You will need to pass your Apple ID (username) and an [app-specific password](ht
Now that your credentials have been set up properly, you can push a build to Min.IO. Start by updating the version value in `package.json` to be much higher than it is currently (1.0.0-0 -> 2.0.0-0) so that the uploaded version is always higher than the version you're testing on. Then run the following, where `RootUserKey` and `RootPassKey` are the `RootUser` and `RootPass` values from step 3:
```shell
AWS_ACCESS_KEY_ID=RootUserKey AWS_SECRET_ACCESS_KEY=RootPassKey APPLE_ID=YOUR_APPLE_ID APPLE_APP_SPECIFIC_PASSWORD=YOUR_APP_SPECIFIC_PW npm run desktop-build
AWS_ACCESS_KEY_ID=RootUserKey AWS_SECRET_ACCESS_KEY=RootPassKey APPLE_ID=YOUR_APPLE_ID APPLE_TEAM_ID=YOUR_APPLE_TEAM_ID APPLE_APP_SPECIFIC_PASSWORD=YOUR_APP_SPECIFIC_PW npm run desktop-build
```
This command will create a build, notarize it, and push your build to the server. Note that it can take around 10 minutes for the command to complete.
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9.0.88.4</string>
<string>9.0.88.6</string>
<key>FullStory</key>
<dict>
<key>OrgId</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>9.0.88.4</string>
<string>9.0.88.6</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleShortVersionString</key>
<string>9.0.88</string>
<key>CFBundleVersion</key>
<string>9.0.88.4</string>
<string>9.0.88.6</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
Loading

0 comments on commit 3238b9b

Please sign in to comment.