-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Ask non-USD Workspaces to update currency before adding VBBA #19638
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
Conversation
|
@rushatgabhane @thienlnam One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@rushatgabhane Will you be able to complete the checklist on this one or should we ask some other C+? |
|
@mountiny I'll be able to complete it |
|
We're run into a similar situation where we're navigating to a page and the onyx data hasn't been set yet. Creating a new room and immediately navigating to it. What we ended up doing was using onyx.set for the items we needed for navigation bc it was much faster, would that be possible here as well? |
|
Is what Jack proposed possible here? Otherwise I feel like if new command works for this then it could be a way to go. It matches the 1:1:1 strategy |
|
Now that I'm thinking more about it, I'm not sure if the issue @rushatgabhane is seeing is a race condition. I'll try to reproduce it on my end to investigate. |
|
So it does seem to be an Onyx race condition. I updated |
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.
LGTM
cc: @mountiny
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #16744... Please reach out for help on Slack if no one gets assigned! |
mountiny
left a comment
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.
One change requested, otherwise LGTM
|
@mountiny updated! |
thienlnam
left a comment
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.
Thanks, sending it!
|
Jk, can't need Vit to re-approve |
mountiny
left a comment
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.
Thanks everyone!
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.30-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.30-5 🚀
|
| if (this.state.shouldShowContinueSetupButton) { | ||
| return ( | ||
| <ContinueBankAccountSetup | ||
| reimbursementAccount={this.props.reimbursementAccount} | ||
| continue={this.continue} | ||
| policyName={policyName} | ||
| /> |
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.
cc @luacmartins, This block is duplicated now, check line 384 ,we intentionally changed the order of rendering in this PR #20406.
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.
ah nice catch. Do we have a PR to fix this already?
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.
No we don't have a PR yet, needed to confirm before moving forward. I will create a PR.
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.
PR is ready : #22253
| <Text>{this.props.translate('bankAccount.hasBeenThrottledError')}</Text> | ||
| </View> | ||
| ); | ||
| const hasUnsupportedCurrency = lodashGet(this.props.policy, 'outputCurrency', '') !== CONST.CURRENCY.USD; |
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.
This line caused an edge case regression, when the policy is empty (deleted from other device) it will display the CurrencyError, we fixed that by displaying FullPageNotFoundView when policy is deleted.
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| // We use SET because it's faster than merge and avoids a race condition when setting the currency and navigating the user to the Bank account page in confirmCurrencyChangeAndHideModal | ||
| onyxMethod: Onyx.METHOD.SET, |
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.
Coming from #37254 (comment)
Because we're using Onyx.set, we should have spread the old pendingFields.
Details
Part 1 of 2 from #16744
Here we'll start preventing users from initiating/completing the VBBA flow if their Workspace currency is different than USD.
Fixed Issues
$ #16744
Tests
Settings > Workspace > Settings > Default CurrencyAEDSettings > Workspace > Bank accountCancelBank accountagain and verify that the modal opens againUpdate to USDConnect bank accountpageSettings > Workspace > Settings > Default CurrencyUSDAEDagainSteps below are for Web only:
9283AFFC0378797Binworkspace/9283AFFC0378797B/settings/bank-account/CompanyStep?policyID=<Workspace id>, replacing<Workspace id>with the value copied in step 14Oops! It appears that your workspace currency is set to a different currency than USD. To proceed, please set it to USD and try againOffline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
chrome.mov
Mobile Web - Safari
safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov