-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add Rillet integration import pages #94780
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
s77rt
wants to merge
52
commits into
Expensify:main
Choose a base branch
from
s77rt:Rillet-integration-import
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.
+1,617
−19
Open
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
9862aca
add constants for rillet integration
s77rt fd60e83
add generic transations for Rillet
s77rt f0c795b
add Rillet accounting option
s77rt 244a50b
fix displayed upgrade intro
s77rt 767672c
add ConnectToRilletFlow - wip
s77rt 6a501bc
add RilletSetupPage
s77rt 05a35e2
disable rillet form when offline
s77rt b56a8f3
add RilletExistingConnectionsPage
s77rt 9efb59d
add Rillet connections
s77rt 5890562
add Rillet types
s77rt 39f0056
Merge branch 'main' into Rillet-integration
s77rt 181eeb6
correct screen names
s77rt f71cd2a
add RilletSubsidiarySelector
s77rt 68d585e
add subsidiary row for Rillet
s77rt 3eaf1b1
add missing reusable connections for rillet
s77rt b119b35
add updateRilletSubsidiary command
s77rt a4c3c83
remove useMemo and useCallback from newly added pages
s77rt 6b9fd5a
add subscribtion keys for RBR
s77rt a8df9e5
add Rillet icon
s77rt 3558b6d
merge main
s77rt 27150f1
compress svg
s77rt b8edf92
lint
s77rt b44532c
merge main
s77rt 7f9df8a
use existing style
s77rt 2546ee4
lint
s77rt f00d8f9
add missed jsdocs
s77rt cc4a701
add spanish translation
s77rt a132dd1
lint
s77rt c852bc7
Revert "add spanish translation"
s77rt f5cb7ea
translate
s77rt 6b4919a
translate rillet sync stage
s77rt 77f13f7
Merge branch 'main' into Rillet-integration
s77rt 1d68d7e
add rillet sync stages
s77rt 3936bab
translate rillet sync stages
s77rt 9af34fc
use correct friendly name
s77rt 4d3185b
look in errorFields for RBR
s77rt d001fb7
Revert "translate"
s77rt 10b819d
add comment
s77rt 8c0035d
translate
s77rt 9ab4f2b
add RilletConding offline-feedback keys
s77rt ff34f88
subscribe to field mappings errors
s77rt 2b52774
add RilletImportPage
s77rt f7a53f8
use dynamic fields list
s77rt 2913a16
subscribe to dynamic field mappings
s77rt 5c84475
display tex rates sync toggle only if we have tax rates
s77rt 06d1dcc
add prepareRilletOptimisticData helper
s77rt a506a0c
add updateRilletEnableNewCategories
s77rt 03e0080
better types
s77rt 4c413fe
add updateRilletSyncTaxRates
s77rt de70b1b
add updateRilletFieldMapping
s77rt 4acce7c
lint
s77rt 2caaa84
add missing key in loop
s77rt 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,27 @@ | ||
| import {useEffect} from 'react'; | ||
| import useHasReusablePoliciesConnectedTo from '@hooks/useHasReusablePoliciesConnectedTo'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import CONST from '@src/CONST'; | ||
| import ROUTES from '@src/ROUTES'; | ||
|
|
||
| type ConnectToRilletFlowProps = { | ||
| policyID: string; | ||
| }; | ||
|
|
||
| function ConnectToRilletFlow({policyID}: ConnectToRilletFlowProps) { | ||
| const hasReusablePoliciesConnectedToRillet = useHasReusablePoliciesConnectedTo(CONST.POLICY.CONNECTIONS.NAME.RILLET, policyID); | ||
|
|
||
| useEffect(() => { | ||
| if (hasReusablePoliciesConnectedToRillet) { | ||
| Navigation.navigate(ROUTES.POLICY_ACCOUNTING_RILLET_EXISTING_CONNECTIONS.getRoute(policyID)); | ||
| return; | ||
| } | ||
| Navigation.navigate(ROUTES.POLICY_ACCOUNTING_RILLET_SETUP.getRoute(policyID)); | ||
| // This needs to run once as we will navigate away | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, []); | ||
|
|
||
| return null; | ||
| } | ||
|
|
||
| export default ConnectToRilletFlow; | ||
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
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.
❌ PERF-16 (docs)
This
useEffecthas an empty dependency array and performsNavigation.navigate(...), which is non-idempotent. React Strict Mode intentionally double-invokes effects in development, so this effect can fire two navigations on mount. There is no guard (module-level flag or ref) preventing the second run — theif (hasReusablePoliciesConnectedToRillet)check validates a precondition but does not stop re-execution if the same precondition still holds on the second invocation.Guard the one-time initialization so it runs exactly once regardless of rendering mode:
Reviewed at: 2caaa84 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.