Add DualEntry integration export pages - #97513
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e00d20908e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| cardList ?? {}, | ||
| CONST.COMPANY_CARDS.EXPORT_CARD_TYPES.NVP_DUALENTRY_EXPORT_ACCOUNT, | ||
| ), | ||
| onAdvancedPagePress: () => null, |
There was a problem hiding this comment.
Hide the dead DualEntry advanced row
For a connected DualEntry workspace, PolicyAccountingPage still renders the standard Advanced menu item and wires it to integrationData?.onAdvancedPagePress, but this DualEntry handler is a no-op and there are no DualEntry advanced routes/pages in this change. Users will see an enabled Advanced row that does nothing when tapped, while it can still show pending/error badges for the listed advanced settings; either hide the row for DualEntry or add the page it should navigate to.
Useful? React with 👍 / 👎.
| value: DualEntryAccount['id']; | ||
| }; | ||
|
|
||
| function DualEntryCompanyCardAccountPage({policy}: WithPolicyConnectionsProps) { |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
This file is a near-verbatim copy of DualEntryCompanyCardAccountPage.tsx — the account-list building (dualentryData?.accounts?.filter(... CREDIT_CARD || BANK).map(...)), headerContent, listEmptyContent, and the entire SelectionScreen render are duplicated between the two pages, differing only in which account ID field is read/written. The duplication also carried over a copy-paste bug: this Expensify Card page still declares its component as function DualEntryCompanyCardAccountPage and passes displayName="DualEntryCompanyCardAccountPage", so it renders under the wrong name.
Extract the shared account-selection logic (filtering active credit-card/bank accounts, empty/header content, and the SelectionScreen wiring) into a single reusable component/hook that takes the selected ID + update handler as params, and have both pages consume it. At minimum, rename this component and its displayName to DualEntryExpensifyCardAccountPage to avoid the incorrect name.
function DualEntryExpensifyCardAccountPage({policy}: WithPolicyConnectionsProps) {
// ...
return (
<SelectionScreen
displayName="DualEntryExpensifyCardAccountPage"
// ...
/>
);
}
export default withPolicyConnections(DualEntryExpensifyCardAccountPage);Reviewed at: e00d209 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
|
🚧 dubielzyk-expensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
Initial test looks good 👍 |
JmillsExpensify
left a comment
There was a problem hiding this comment.
LGTM, part of an existing product initiative.
The merge-base changed after approval.
|
@s77rt Could you resolve conflict? |
|
@ShridharGoel Could you take a look at this PR? |
|
@MelvinBot Fix the conflicts and update this PR. Check if write access allows you to update the PR even if it is from a fork. |
|
🤖 I can't update this PR to resolve the conflicts. On your question about fork write access: this PR has "Allow edits from maintainers" enabled (
The PR is currently To have me do it: |
| shouldBeBlocked | ||
| > | ||
| <View> | ||
| <Text style={[styles.ph5, styles.pb5]}>{translate('workspace.dualentry.exportDescription')}</Text> |
There was a problem hiding this comment.
App crashes when opening this page;
withPolicyConnections.tsx:32 Error: workspace.dualentry.exportDescription was not found in the en locale
| @@ -0,0 +1,8 @@ | |||
| import type {DualEntryAccount} from '@src/types/onyx/Policy'; | |||
|
|
|||
| type UpdateDualEntryCreditCardAccountParams = { | |||
There was a problem hiding this comment.
The type name here is UpdateDualEntryCreditCardAccountParams — looks like it was copied from the credit card params file.
Could we rename it to UpdateDualEntryExpensifyCardAccountParams to match the file and the re-export?
| ); | ||
| } | ||
|
|
||
| export default withPolicyConnections(DualEntryCompanyCardAccountPage); |
There was a problem hiding this comment.
The displayName and default export all use DualEntryCompanyCardAccountPage instead of DualEntryExpensifyCardAccountPage.
Would you mind updating these to DualEntryExpensifyCardAccountPage?
| initiallyFocusedOptionKey={expensifyCardAccountID} | ||
| onBackButtonPress={() => Navigation.goBack(backPath)} | ||
| connectionName={CONST.POLICY.CONNECTIONS.NAME.DUALENTRY} | ||
| pendingAction={settingsPendingAction([CONST.DUALENTRY_CONFIG.EXPENSIFY_CARD_ACCOUNT_ID], dualentryConfig?.pendingFields)} |
There was a problem hiding this comment.
This constant doesn't exist in DUALENTRY_CONFIG.
| function updateDualEntryExpensifyCardAccount( | ||
| policyID: string, | ||
| expensifyCardAccountID: DualEntryExport['expensifyCardAccountID'], | ||
| oldExpensifyCardAccountID?: DualEntryExport['expensifyCardAccountID'], |
There was a problem hiding this comment.
It uses DualEntryExport['expensifyCardAccountID'] but the DualEntryExport type in Policy.ts has no expensifyCardAccountID field.
|
@MelvinBot Address the above review comments and update this PR |
|
I worked through the review comments and prepared fixes for all of them, but I can't push them to update this PR. My token is a fine-grained PAT scoped to the What I changed
Already resolved in a newer commit (no change needed): the Not addressed (want your call):
Patch —
|
|
@MelvinBot Can you create a new PR with all the changes applied? |
|
Done — created a mirror PR in Since this PR lives on a fork branch my token can't push to, the new PR is on an upstream branch (
It's opened as a draft with A couple of things I did not change (same as noted earlier — your call): the dead Advanced row for DualEntry ( |
Explanation of Change
Fixed Issues
$ #97238
PROPOSAL:
Tests
Test 1
Test 2
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari