Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
Browse files Browse the repository at this point in the history
…ture/32187-referral-page-redesign
  • Loading branch information
rezkiy37 committed Dec 11, 2023
2 parents e035dbd + ab4449c commit f5b7305
Show file tree
Hide file tree
Showing 135 changed files with 5,767 additions and 900 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001041000
versionName "1.4.10-0"
versionCode 1001041001
versionName "1.4.10-1"
}

flavorDimensions "default"
Expand Down
18 changes: 14 additions & 4 deletions contributingGuides/NAVIGATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,17 @@ When creating RHP flows, you have to remember a couple things:

An example of adding `Settings_Workspaces` page:

1. Add path to `ROUTES.ts`: https://github.com/Expensify/App/blob/main/src/ROUTES.ts
1. Add the page name to `SCREENS.ts` which will be reused throughout the app (linkingConfig, navigators, etc.):

```ts
const SCREENS = {
SETTINGS: {
WORKSPACES: 'Settings_Workspaces',
},
} as const;
```

2. Add path to `ROUTES.ts`: https://github.com/Expensify/App/blob/main/src/ROUTES.ts

```ts
export const ROUTES = {
Expand All @@ -55,11 +65,11 @@ export const ROUTES = {

```

2. Add `Settings_Workspaces` page to proper RHP flow in `linkingConfig.ts`: https://github.com/Expensify/App/blob/3531af22dcadaa94ed11eccf370517dca0b8c305/src/libs/Navigation/linkingConfig.js#L40-L42
3. Add `Settings_Workspaces` page to proper RHP flow in `linkingConfig.ts`: https://github.com/Expensify/App/blob/fbc11ca729ffa4676fb3bc8cd110ac3890debff6/src/libs/Navigation/linkingConfig.ts#L47-L50

3. Add your page to proper navigator (it should be aligned with where you've put it in the previous step) https://github.com/Expensify/App/blob/3531af22dcadaa94ed11eccf370517dca0b8c305/src/libs/Navigation/AppNavigator/ModalStackNavigators.js#L334-L338
4. Add your page to proper navigator (it should be aligned with where you've put it in the previous step) https://github.com/Expensify/App/blob/fbc11ca729ffa4676fb3bc8cd110ac3890debff6/src/libs/Navigation/AppNavigator/ModalStackNavigators.js#L141

4. Make sure `HeaderWithBackButton` leads to the previous page in navigation flow of your page: https://github.com/Expensify/App/blob/3531af22dcadaa94ed11eccf370517dca0b8c305/src/pages/workspace/WorkspacesListPage.js#L186
5. Make sure `HeaderWithBackButton` leads to the previous page in navigation flow of your page: https://github.com/Expensify/App/blob/3531af22dcadaa94ed11eccf370517dca0b8c305/src/pages/workspace/WorkspacesListPage.js#L186

## Performance solutions

Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.4.10.0</string>
<string>1.4.10.1</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</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>1.4.10.0</string>
<string>1.4.10.1</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.4.10-0",
"version": "1.4.10-1",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down Expand Up @@ -51,6 +51,7 @@
"symbolicate:android": "npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map",
"symbolicate:ios": "npx metro-symbolicate main.jsbundle.map",
"test:e2e": "node tests/e2e/testRunner.js --development --skipCheckout --skipInstallDeps --buildMode none",
"test:e2e:dev": "node tests/e2e/testRunner.js --development --skipCheckout --config ./config.dev.js --buildMode skip --skipInstallDeps",
"gh-actions-unused-styles": "./.github/scripts/findUnusedKeys.sh",
"workflow-test": "./workflow_tests/scripts/runWorkflowTests.sh",
"workflow-test:generate": "node workflow_tests/utils/preGenerateTest.js",
Expand Down
10 changes: 10 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,8 @@ const CONST = {
},

IOU: {
// This is the transactionID used when going through the create money request flow so that it mimics a real transaction (like the edit flow)
OPTIMISTIC_TRANSACTION_ID: '1',
// Note: These payment types are used when building IOU reportAction message values in the server and should
// not be changed.
PAYMENT_TYPE: {
Expand All @@ -1147,6 +1149,11 @@ const CONST = {
SPLIT: 'split',
REQUEST: 'request',
},
REQUEST_TYPE: {
DISTANCE: 'distance',
MANUAL: 'manual',
SCAN: 'scan',
},
REPORT_ACTION_TYPE: {
PAY: 'pay',
CREATE: 'create',
Expand Down Expand Up @@ -2755,6 +2762,9 @@ const CONST = {
NEW_CHAT: 'chat',
NEW_ROOM: 'room',
RECEIPT_TAB_ID: 'ReceiptTab',
IOU_REQUEST_TYPE: 'iouRequestType',
},
TAB_REQUEST: {
MANUAL: 'manual',
SCAN: 'scan',
DISTANCE: 'distance',
Expand Down
80 changes: 79 additions & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function getUrlWithBackToParam<TUrl extends string>(url: TUrl, backTo?: string):

const ROUTES = {
HOME: '',
/** This is a utility route used to go to the user's concierge chat, or the sign-in page if the user's not authenticated */

// This is a utility route used to go to the user's concierge chat, or the sign-in page if the user's not authenticated
CONCIERGE: 'concierge',
FLAG_COMMENT: {
route: 'flag/:reportID/:reportActionID',
Expand Down Expand Up @@ -306,6 +307,82 @@ const ROUTES = {
MONEY_REQUEST_MANUAL_TAB: ':iouType/new/:reportID?/manual',
MONEY_REQUEST_SCAN_TAB: ':iouType/new/:reportID?/scan',

MONEY_REQUEST_CREATE: {
route: 'create/:iouType/start/:transactionID/:reportID',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}` as const,
},
MONEY_REQUEST_STEP_CONFIRMATION: {
route: 'create/:iouType/confirmation/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/confirmation/${transactionID}/${reportID}/` as const,
},
MONEY_REQUEST_STEP_AMOUNT: {
route: 'create/:iouType/amount/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/amount/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_CATEGORY: {
route: 'create/:iouType/category/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/category/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_CURRENCY: {
route: 'create/:iouType/currency/:transactionID/:reportID/:pageIndex?/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, pageIndex = '', backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/currency/${transactionID}/${reportID}/${pageIndex}`, backTo),
},
MONEY_REQUEST_STEP_DATE: {
route: 'create/:iouType/date/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/date/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_DESCRIPTION: {
route: 'create/:iouType/description/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/description/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_DISTANCE: {
route: 'create/:iouType/distance/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/distance/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_MERCHANT: {
route: 'create/:iouType/merchante/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/merchante/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_PARTICIPANTS: {
route: 'create/:iouType/participants/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/participants/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_SCAN: {
route: 'create/:iouType/scan/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/scan/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_TAG: {
route: 'create/:iouType/tag/:transactionID/:reportID/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/tag/${transactionID}/${reportID}/`, backTo),
},
MONEY_REQUEST_STEP_WAYPOINT: {
route: 'create/:iouType/waypoint/:transactionID/:reportID/:pageIndex/',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, pageIndex = '', backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/waypoint/${transactionID}/${reportID}/${pageIndex}`, backTo),
},
MONEY_REQUEST_CREATE_TAB_DISTANCE: {
route: 'create/:iouType/start/:transactionID/:reportID/distance',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}/distance` as const,
},
MONEY_REQUEST_CREATE_TAB_MANUAL: {
route: 'create/:iouType/start/:transactionID/:reportID/manual',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}/manual` as const,
},
MONEY_REQUEST_CREATE_TAB_SCAN: {
route: 'create/:iouType/start/:transactionID/:reportID/scan',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}/scan` as const,
},

IOU_REQUEST: 'request/new',
IOU_SEND: 'send/new',
IOU_SEND_ADD_BANK_ACCOUNT: 'send/new/add-bank-account',
Expand Down Expand Up @@ -391,6 +468,7 @@ const ROUTES = {
MONEY2020: 'money2020',
} as const;

export {getUrlWithBackToParam};
export default ROUTES;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
120 changes: 74 additions & 46 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,62 @@ const SCREENS = {
UNLINK_LOGIN: 'UnlinkLogin',
SETTINGS: {
ROOT: 'Settings_Root',
PREFERENCES: 'Settings_Preferences',
SHARE_CODE: 'Settings_Share_Code',
WORKSPACES: 'Settings_Workspaces',
SECURITY: 'Settings_Security',
STATUS: 'Settings_Status',
PROFILE: 'Settings_Profile',
PRONOUNS: 'Settings_Pronouns',
DISPLAY_NAME: 'Settings_Display_Name',
TIMEZONE: 'Settings_Timezone',
TIMEZONE_SELECT: 'Settings_Timezone_Select',
CONTACT_METHODS: 'Settings_ContactMethods',
CONTACT_METHOD_DETAILS: 'Settings_ContactMethodDetails',
NEW_CONTACT_METHOD: 'Settings_NewContactMethod',
SHARE_CODE: 'Settings_Share_Code',
ABOUT: 'Settings_About',
APP_DOWNLOAD_LINKS: 'Settings_App_Download_Links',
LOUNGE_ACCESS: 'Settings_Lounge_Access',

PERSONAL_DETAILS_INITIAL: 'Settings_PersonalDetails_Initial',
PERSONAL_DETAILS_LEGAL_NAME: 'Settings_PersonalDetails_LegalName',
PERSONAL_DETAILS_DATE_OF_BIRTH: 'Settings_PersonalDetails_DateOfBirth',
PERSONAL_DETAILS_ADDRESS: 'Settings_PersonalDetails_Address',
PERSONAL_DETAILS_ADDRESS_COUNTRY: 'Settings_PersonalDetails_Address_Country',

WALLET: 'Settings_Wallet',
WALLET_DOMAIN_CARD: 'Settings_Wallet_DomainCard',
WALLET_CARD_GET_PHYSICAL: {
NAME: 'Settings_Card_Get_Physical_Name',
PHONE: 'Settings_Card_Get_Physical_Phone',
ADDRESS: 'Settings_Card_Get_Physical_Address',
CONFIRM: 'Settings_Card_Get_Physical_Confirm',
},
WALLET_TRANSFER_BALANCE: 'Settings_Wallet_Transfer_Balance',
WALLET_CHOOSE_TRANSFER_ACCOUNT: 'Settings_Wallet_Choose_Transfer_Account',
WALLET_ENABLE_PAYMENTS: 'Settings_Wallet_EnablePayments',
WALLET_CARD_ACTIVATE: 'Settings_Wallet_Card_Activate',
WALLET_REPORT_VIRTUAL_CARD_FRAUD: 'Settings_Wallet_ReportVirtualCardFraud',
WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS: 'Settings_Wallet_Cards_Digital_Details_Update_Address',

ADD_DEBIT_CARD: 'Settings_Add_Debit_Card',
ADD_BANK_ACCOUNT: 'Settings_Add_Bank_Account',
PREFERENCES_PRIORITY_MODE: 'Settings_Preferences_PriorityMode',
PREFERENCES_LANGUAGE: 'Settings_Preferences_Language',
PREFERENCES_THEME: 'Settings_Preferences_Theme',
CLOSE: 'Settings_Close',
STATUS_SET: 'Settings_Status_Set',
TWO_FACTOR_AUTH: 'Settings_TwoFactorAuth',
REPORT_CARD_LOST_OR_DAMAGED: 'Settings_ReportCardLostOrDamaged',

PROFILE: {
ROOT: 'Settings_Profile',
DISPLAY_NAME: 'Settings_Display_Name',
CONTACT_METHODS: 'Settings_ContactMethods',
CONTACT_METHOD_DETAILS: 'Settings_ContactMethodDetails',
NEW_CONTACT_METHOD: 'Settings_NewContactMethod',
STATUS: 'Settings_Status',
STATUS_SET: 'Settings_Status_Set',
PRONOUNS: 'Settings_Pronouns',
TIMEZONE: 'Settings_Timezone',
TIMEZONE_SELECT: 'Settings_Timezone_Select',

PERSONAL_DETAILS: {
INITIAL: 'Settings_PersonalDetails_Initial',
LEGAL_NAME: 'Settings_PersonalDetails_LegalName',
DATE_OF_BIRTH: 'Settings_PersonalDetails_DateOfBirth',
ADDRESS: 'Settings_PersonalDetails_Address',
ADDRESS_COUNTRY: 'Settings_PersonalDetails_Address_Country',
},
},

PREFERENCES: {
ROOT: 'Settings_Preferences',
PRIORITY_MODE: 'Settings_Preferences_PriorityMode',
LANGUAGE: 'Settings_Preferences_Language',
THEME: 'Settings_Preferences_Theme',
},

WALLET: {
ROOT: 'Settings_Wallet',
DOMAIN_CARD: 'Settings_Wallet_DomainCard',
CARD_GET_PHYSICAL: {
NAME: 'Settings_Card_Get_Physical_Name',
PHONE: 'Settings_Card_Get_Physical_Phone',
ADDRESS: 'Settings_Card_Get_Physical_Address',
CONFIRM: 'Settings_Card_Get_Physical_Confirm',
},
TRANSFER_BALANCE: 'Settings_Wallet_Transfer_Balance',
CHOOSE_TRANSFER_ACCOUNT: 'Settings_Wallet_Choose_Transfer_Account',
ENABLE_PAYMENTS: 'Settings_Wallet_EnablePayments',
CARD_ACTIVATE: 'Settings_Wallet_Card_Activate',
REPORT_VIRTUAL_CARD_FRAUD: 'Settings_Wallet_ReportVirtualCardFraud',
CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS: 'Settings_Wallet_Cards_Digital_Details_Update_Address',
},
},
SAVE_THE_WORLD: {
ROOT: 'SaveTheWorld_Root',
Expand Down Expand Up @@ -102,6 +111,22 @@ const SCREENS = {
SAML_SIGN_IN: 'SAMLSignIn',

MONEY_REQUEST: {
MANUAL_TAB: 'manual',
SCAN_TAB: 'scan',
DISTANCE_TAB: 'distance',
CREATE: 'Money_Request_Create',
STEP_CONFIRMATION: 'Money_Request_Step_Confirmation',
STEP_AMOUNT: 'Money_Request_Step_Amount',
STEP_CATEGORY: 'Money_Request_Step_Category',
STEP_CURRENCY: 'Money_Request_Step_Currency',
STEP_DATE: 'Money_Request_Step_Date',
STEP_DESCRIPTION: 'Money_Request_Step_Description',
STEP_DISTANCE: 'Money_Request_Step_Distance',
STEP_MERCHANT: 'Money_Request_Step_Merchant',
STEP_PARTICIPANTS: 'Money_Request_Step_Participants',
STEP_SCAN: 'Money_Request_Step_Scan',
STEP_TAG: 'Money_Request_Step_Tag',
STEP_WAYPOINT: 'Money_Request_Step_Waypoint',
ROOT: 'Money_Request',
AMOUNT: 'Money_Request_Amount',
PARTICIPANTS: 'Money_Request_Participants',
Expand Down Expand Up @@ -177,10 +202,21 @@ const SCREENS = {
CURRENCY: 'EditRequest_Currency',
},

NEW_CHAT: {
ROOT: 'NewChat_Root',
NEW_CHAT: 'chat',
NEW_ROOM: 'room',
},

SPLIT_DETAILS: {
ROOT: 'SplitDetails_Root',
EDIT_REQUEST: 'SplitDetails_Edit_Request',
EDIT_CURRENCY: 'SplitDetails_Edit_Currency',
},

I_KNOW_A_TEACHER: 'I_Know_A_Teacher',
INTRO_SCHOOL_PRINCIPAL: 'Intro_School_Principal',
I_AM_A_TEACHER: 'I_Am_A_Teacher',

ENABLE_PAYMENTS_ROOT: 'EnablePayments_Root',
ADD_PERSONAL_BANK_ACCOUNT_ROOT: 'AddPersonalBankAccount_Root',
REIMBURSEMENT_ACCOUNT_ROOT: 'Reimbursement_Account_Root',
Expand All @@ -193,15 +229,7 @@ const SCREENS = {
ROOM_MEMBERS_ROOT: 'RoomMembers_Root',
ROOM_INVITE_ROOT: 'RoomInvite_Root',
SEARCH_ROOT: 'Search_Root',
NEW_CHAT_ROOT: 'NewChat_Root',
FLAG_COMMENT_ROOT: 'FlagComment_Root',

SPLIT_DETAILS: {
ROOT: 'SplitDetails_Root',
EDIT_REQUEST: 'SplitDetails_Edit_Request',
EDIT_CURRENCY: 'SplitDetails_Edit_Currency',
},

REIMBURSEMENT_ACCOUNT: 'ReimbursementAccount',
GET_ASSISTANCE: 'GetAssistance',
REFERRAL_DETAILS: 'Referral_Details',
Expand Down
3 changes: 0 additions & 3 deletions src/components/ConfirmedRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ function ConfirmedRoute({mapboxAccessToken, transaction}) {
}

export default withOnyx({
transaction: {
key: ({transactionID}) => `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
},
mapboxAccessToken: {
key: ONYXKEYS.MAPBOX_ACCESS_TOKEN,
},
Expand Down
Loading

0 comments on commit f5b7305

Please sign in to comment.