-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[CBN] USD flow refactor #86645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
koko57
wants to merge
33
commits into
Expensify:main
Choose a base branch
from
callstack-internal:refactor/79048-enable-payments-usd-flow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[CBN] USD flow refactor #86645
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
87ab095
feat: create new route and add to config
koko57 cbcebe8
fix: change page names
koko57 b9608e5
feat: migrate main steps
koko57 2deff29
feat: change props
koko57 131310d
fix: route fixes
koko57 07ba024
fix: types
koko57 a31ac82
feat: migrate substeps to sub pages
koko57 1879cc6
fix: delay focus on inputs
koko57 8019251
fix: focus for industry step
koko57 b3d5bc9
fix: resolve conflicts
koko57 11ab86b
fix: navigation conflicting route names
koko57 3f49189
Merge branch 'main' into refactor/79048-enable-payments-usd-flow
koko57 ab5534a
fix: handle backTo param
koko57 4f045ff
fix: navigating back from UBO step
koko57 29f8c33
Merge branch 'main' into refactor/79048-enable-payments-usd-flow
koko57 05534d6
fix: show loading before navigating to the next step
koko57 3eaf0f5
fix: show proper success page
koko57 2d34201
fix: remove unnecessary comment
koko57 befbf49
fix: eslint, prettier
koko57 fdf92e3
fix: minor fix
koko57 ff25202
fix: onfido step
koko57 049c2da
Merge branch 'main' into refactor/79048-enable-payments-usd-flow
koko57 507fc44
fix: remove unused import
koko57 78ba0f5
fix: eslint
koko57 580ca4a
fix: minor fix
koko57 79dde51
Merge branch 'main' into refactor/79048-enable-payments-usd-flow
koko57 875c157
fix: remove useSubPage for BankInfo page
koko57 c4b3b84
fix: remove useSubPage for CompleteVerification page
koko57 5b5f8a8
fix: beneficial owners step
koko57 779cb18
fix: resolve conflicts
koko57 d06355a
fix: change useEffect to useFocusEffet
koko57 82e54e3
Merge branch 'main' into refactor/79048-enable-payments-usd-flow
koko57 8299b90
fix: add PINATM to cspell
koko57 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -552,6 +552,7 @@ | |
| "phonenumber", | ||
| "Picklist", | ||
| "picklists", | ||
| "PINATM", | ||
| "PINGPONG", | ||
| "pkill", | ||
| "Pluginfile", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||
| import {useCallback, useEffect, useRef} from 'react'; | ||||||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||||||
| import useOnyx from './useOnyx'; | ||||||
|
|
||||||
| /** | ||||||
| * Defers navigation (onSubmit) until the reimbursement account API call completes. | ||||||
| * Instead of navigating to the next step immediately after firing the API call, | ||||||
| * this hook waits for `isLoading` to go back to `false` and checks for errors. | ||||||
| * | ||||||
| * @param onSubmit - callback that navigates to the next step | ||||||
| * @returns markSubmitting - call this right after firing the API action | ||||||
| */ | ||||||
| export default function useReimbursementAccountSubmit(onSubmit?: () => void) { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT); | ||||||
| const isSubmittingRef = useRef(false); | ||||||
|
|
||||||
| useEffect(() => { | ||||||
| if (!isSubmittingRef.current || reimbursementAccount?.isLoading || reimbursementAccount?.errors) { | ||||||
| return; | ||||||
| } | ||||||
| isSubmittingRef.current = false; | ||||||
| onSubmit?.(); | ||||||
| }, [reimbursementAccount?.isLoading, reimbursementAccount?.errors, onSubmit]); | ||||||
|
|
||||||
| return useCallback(() => { | ||||||
| isSubmittingRef.current = true; | ||||||
| }, []); | ||||||
| } | ||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update these routes to match what we have in the doc? A few others seem to differ as well