Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
huult committed Jan 23, 2025
2 parents f9bb038 + 523edfe commit efc527c
Show file tree
Hide file tree
Showing 125 changed files with 3,215 additions and 1,170 deletions.
14 changes: 13 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
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.
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
9 changes: 6 additions & 3 deletions .github/workflows/testBuildHybrid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ jobs:
const pullRequest = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: env.PULL_REQUEST_NUMBER,
pull_number: '${{ env.PULL_REQUEST_NUMBER }}'',
});
const body = pullRequest.data.body;
const regex = /MOBILE-EXPENSIFY:(?<prNumber>.*)/;
const regex = /MOBILE-EXPENSIFY:(?<prNumber>\d+)/;
const found = body.match(regex)?.groups?.prNumber || "";
return found.trim();
Expand All @@ -93,11 +93,14 @@ jobs:
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 }} --json headRefOid --jq '.headRefOid')" >> "$GITHUB_OUTPUT"
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 }}

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
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
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
Binary file added docs/assets/images/travel-link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/images/travel-soft-approval.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
142 changes: 98 additions & 44 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,30 @@ type OnboardingMessage = {
const EMAIL_WITH_OPTIONAL_DOMAIN =
/(?=((?=[\w'#%+-]+(?:\.[\w'#%+-]+)*@?)[\w.'#%+-]{1,64}(?:@(?:(?=[a-z\d]+(?:-+[a-z\d]+)*\.)(?:[a-z\d-]{1,63}\.)+[a-z]{2,63}))?(?= |_|\b))(?<end>.*))\S{3,254}(?=\k<end>$)/;

const EMAIL = {
ACCOUNTING: '[email protected]',
ACCOUNTS_PAYABLE: '[email protected]',
ADMIN: '[email protected]',
BILLS: '[email protected]',
CHRONOS: '[email protected]',
CONCIERGE: '[email protected]',
CONTRIBUTORS: '[email protected]',
FIRST_RESPONDER: '[email protected]',
GUIDES_DOMAIN: 'team.expensify.com',
QA_DOMAIN: 'applause.expensifail.com',
HELP: '[email protected]',
INTEGRATION_TESTING_CREDS: '[email protected]',
NOTIFICATIONS: '[email protected]',
PAYROLL: '[email protected]',
QA: '[email protected]',
QA_TRAVIS: '[email protected]',
RECEIPTS: '[email protected]',
STUDENT_AMBASSADOR: '[email protected]',
SVFG: '[email protected]',
EXPENSIFY_EMAIL_DOMAIN: '@expensify.com',
EXPENSIFY_TEAM_EMAIL_DOMAIN: '@team.expensify.com',
};

const CONST = {
HEIC_SIGNATURES: [
'6674797068656963', // 'ftypheic' - Indicates standard HEIC file
Expand Down Expand Up @@ -670,6 +694,7 @@ const CONST = {
PER_DIEM: 'newDotPerDiem',
NEWDOT_MERGE_ACCOUNTS: 'newDotMergeAccounts',
NEWDOT_MANAGER_MCTEST: 'newDotManagerMcTest',
NEWDOT_INTERNATIONAL_DEPOSIT_BANK_ACCOUNT: 'newDotInternationalDepositBankAccount',
NSQS: 'nsqs',
},
BUTTON_STATES: {
Expand Down Expand Up @@ -930,6 +955,7 @@ const CONST = {
CONFIGURE_REIMBURSEMENT_SETTINGS_HELP_URL: 'https://help.expensify.com/articles/expensify-classic/workspaces/Configure-Reimbursement-Settings',
COPILOT_HELP_URL: 'https://help.expensify.com/articles/expensify-classic/copilots-and-delegates/Assign-or-remove-a-Copilot',
DELAYED_SUBMISSION_HELP_URL: 'https://help.expensify.com/articles/expensify-classic/reports/Automatically-submit-employee-reports',
ENCRYPTION_AND_SECURITY_HELP_URL: 'https://help.expensify.com/articles/new-expensify/settings/Encryption-and-Data-Security',
PLAN_TYPES_AND_PRICING_HELP_URL: 'https://help.expensify.com/articles/new-expensify/billing-and-subscriptions/Plan-types-and-pricing',
TEST_RECEIPT_URL: `${CLOUDFRONT_URL}/images/fake-receipt__tacotodds.png`,
// Use Environment.getEnvironmentURL to get the complete URL with port number
Expand Down Expand Up @@ -1669,29 +1695,7 @@ const CONST = {
SEARCH_SKELETON_VIEW_ITEM_HEIGHT: 108,
EXPENSIFY_PARTNER_NAME: 'expensify.com',
EXPENSIFY_MERCHANT: 'Expensify, Inc.',
EMAIL: {
ACCOUNTING: '[email protected]',
ACCOUNTS_PAYABLE: '[email protected]',
ADMIN: '[email protected]',
BILLS: '[email protected]',
CHRONOS: '[email protected]',
CONCIERGE: '[email protected]',
CONTRIBUTORS: '[email protected]',
FIRST_RESPONDER: '[email protected]',
GUIDES_DOMAIN: 'team.expensify.com',
QA_DOMAIN: 'applause.expensifail.com',
HELP: '[email protected]',
INTEGRATION_TESTING_CREDS: '[email protected]',
NOTIFICATIONS: '[email protected]',
PAYROLL: '[email protected]',
QA: '[email protected]',
QA_TRAVIS: '[email protected]',
RECEIPTS: '[email protected]',
STUDENT_AMBASSADOR: '[email protected]',
SVFG: '[email protected]',
EXPENSIFY_EMAIL_DOMAIN: '@expensify.com',
EXPENSIFY_TEAM_EMAIL_DOMAIN: '@team.expensify.com',
},
EMAIL,

FULL_STORY: {
MASK: 'fs-mask',
Expand Down Expand Up @@ -3155,27 +3159,30 @@ const CONST = {
WORKSPACE_FEATURES: 'WorkspaceFeatures',
WORKSPACE_RULES: 'WorkspaceRules',
},
get EXPENSIFY_EMAILS() {
return [
this.EMAIL.ACCOUNTING,
this.EMAIL.ACCOUNTS_PAYABLE,
this.EMAIL.ADMIN,
this.EMAIL.BILLS,
this.EMAIL.CHRONOS,
this.EMAIL.CONCIERGE,
this.EMAIL.CONTRIBUTORS,
this.EMAIL.FIRST_RESPONDER,
this.EMAIL.HELP,
this.EMAIL.INTEGRATION_TESTING_CREDS,
this.EMAIL.NOTIFICATIONS,
this.EMAIL.PAYROLL,
this.EMAIL.QA,
this.EMAIL.QA_TRAVIS,
this.EMAIL.RECEIPTS,
this.EMAIL.STUDENT_AMBASSADOR,
this.EMAIL.SVFG,
];
},
EXPENSIFY_EMAILS_OBJECT: Object.entries(EMAIL).reduce((prev, [, email]) => {
// eslint-disable-next-line no-param-reassign
prev[email] = true;
return prev;
}, {} as Record<string, boolean>),
EXPENSIFY_EMAILS: [
EMAIL.ACCOUNTING,
EMAIL.ACCOUNTS_PAYABLE,
EMAIL.ADMIN,
EMAIL.BILLS,
EMAIL.CHRONOS,
EMAIL.CONCIERGE,
EMAIL.CONTRIBUTORS,
EMAIL.FIRST_RESPONDER,
EMAIL.HELP,
EMAIL.INTEGRATION_TESTING_CREDS,
EMAIL.NOTIFICATIONS,
EMAIL.PAYROLL,
EMAIL.QA,
EMAIL.QA_TRAVIS,
EMAIL.RECEIPTS,
EMAIL.STUDENT_AMBASSADOR,
EMAIL.SVFG,
] as string[],
get EXPENSIFY_ACCOUNT_IDS() {
return [
this.ACCOUNT_ID.ACCOUNTING,
Expand Down Expand Up @@ -6452,6 +6459,53 @@ const CONST = {
},
},

CORPAY_FIELDS: {
EXCLUDED_COUNTRIES: ['IR', 'CU', 'SY', 'UA', 'KP', 'RU'] as string[],
EXCLUDED_CURRENCIES: ['IRR', 'CUP', 'SYP', 'UAH', 'KPW', 'RUB'] as string[],
BANK_ACCOUNT_DETAILS_FIELDS: ['accountNumber', 'localAccountNumber', 'routingCode', 'localRoutingCode', 'swiftBicCode'] as string[],
ACCOUNT_TYPE_KEY: 'BeneficiaryAccountType',
ACCOUNT_HOLDER_COUNTRY_KEY: 'accountHolderCountry',
BANK_INFORMATION_FIELDS: ['bankName', 'bankAddressLine1', 'bankAddressLine2', 'bankCity', 'bankRegion', 'bankPostal', 'BeneficiaryBankBranchName'] as string[],
ACCOUNT_HOLDER_FIELDS: [
'accountHolderName',
'accountHolderAddress1',
'accountHolderAddress2',
'accountHolderCity',
'accountHolderRegion',
'accountHolderCountry',
'accountHolderPostal',
'accountHolderPhoneNumber',
'accountHolderEmail',
'ContactName',
'BeneficiaryCPF',
'BeneficiaryRUT',
'BeneficiaryCedulaID',
'BeneficiaryTaxID',
] as string[],
SPECIAL_LIST_REGION_KEYS: ['bankRegion', 'accountHolderRegion'] as string[],
SPECIAL_LIST_ADDRESS_KEYS: ['bankAddressLine1', 'accountHolderAddress1'] as string[],
STEPS_NAME: {
COUNTRY_SELECTOR: 'CountrySelector',
BANK_ACCOUNT_DETAILS: 'BankAccountDetails',
ACCOUNT_TYPE: 'AccountType',
BANK_INFORMATION: 'BankInformation',
ACCOUNT_HOLDER_INFORMATION: 'AccountHolderInformation',
CONFIRMATION: 'Confirmation',
SUCCESS: 'Success',
},
INDEXES: {
MAPPING: {
COUNTRY_SELECTOR: 0,
BANK_ACCOUNT_DETAILS: 1,
ACCOUNT_TYPE: 2,
BANK_INFORMATION: 3,
ACCOUNT_HOLDER_INFORMATION: 4,
CONFIRMATION: 5,
SUCCESS: 6,
},
},
},

HYBRID_APP: {
REORDERING_REACT_NATIVE_ACTIVITY_TO_FRONT: 'reorderingReactNativeActivityToFront',
},
Expand Down
Loading

0 comments on commit efc527c

Please sign in to comment.