-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add reimbursementpage loader right away #14619
Conversation
src/libs/actions/BankAccounts.js
Outdated
@@ -260,6 +260,8 @@ function validateBankAccount(bankAccountID, validateCode) { | |||
} | |||
|
|||
function openReimbursementAccountPage(stepToOpen, subStep, localCurrentStep) { | |||
// Show loader right away, as optimisticData might be set only later in case multiple calls are in the queue | |||
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isLoading: true}); |
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.
App/src/libs/actions/BankAccounts.js
Lines 386 to 393 in df05485
/** | |
* Set the reimbursement account loading so that it happens right away, instead of when the API command is processed. | |
* | |
* @param {Boolean} isLoading | |
*/ | |
function setReimbursementAccountLoading(isLoading) { | |
Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isLoading}); | |
} |
@nkuoch how about using common function above? This was already used in Reimburse expenses page.
App/src/pages/workspace/reimburse/WorkspaceReimburseView.js
Lines 182 to 185 in df05485
// Instead of setting the reimbursement account loading within the optimistic data of the API command, use a separate action so that the Onyx value is updated right away. | |
// openWorkspaceReimburseView uses API.read which will not make the request until all WRITE requests in the sequential queue have finished responding, so there would be a delay in | |
// updating Onyx with the optimistic data. | |
BankAccounts.setReimbursementAccountLoading(true); |
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
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.
Maybe you need to move setReimbursementAccountLoading
above openReimbursementAccountPage
to avoid lint error.
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.mp4Mobile Web - Safarimweb.mp4Desktopdesktop.moviOSios.mp4Androidandroid.mp4 |
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.
Yep, good call
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
🚀 Deployed to staging by https://github.com/Luke9389 in version: 1.2.62-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.2.62-1 🚀
|
Details
Loader didn't happen right away when opening the page, which resulted in being able to click the Plaid button when we shouldn't, resulting in the plaid modal not opening.
Fixed Issues
$ #14583
Tests
Create a workspace and quickly click on Connect Bank Account. Make sure you see the loader.
As soon as you see the Connect Online With Plaid button, click on it.
Make sure it opens the Plaid modal.
Offline tests
N/A
QA Steps
Create a workspace and quickly click on Connect Bank Account. Make sure you see the loader.
As soon as you see the Connect Online With Plaid button, click on it.
Make sure it opens the Plaid modal.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
2023-01-27_12-59-27.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
2023-01-27_13-12-39.mp4
iOS
Android