-
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 skeleton to loading Accounting options #41980
Add skeleton to loading Accounting options #41980
Conversation
@eVoloshchak Please 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] |
cc @s77rt |
This is not fixing the root cause and we don't need a skeleton loader here. The enable accounting switch works offline and we should be able to view the accounting page immediately. |
@s77rt Issue with "Hmmm page is not here" - was already fixed before. Current PR is for removing loader - when accounting resources and fetching. When you do it offline - you will see 2 hardcoded values like Quickbooks and Xero - but it can be more coming from API request - that's why we should show skeleton instead of loader for the whole page. |
@shawnborton are we good with such skeleton? Same height for each item and same positions for all elements: Screen.Recording.2024-05-13.at.14.45.43.mov |
@shawnborton good? or make it a bit more bigger? currently it's 20% - let me know which percent i should add Screen.Recording.2024-05-13.at.15.39.51.mov |
That looks good to me. I can see where it might be nice to have one of those be slightly wider than the other, to create some variance, but I can totally get down with what you have. cc @Expensify/design for viz. |
I don't mind the skeleton lines being the same width I don't think, but I kinda want them to be a litttttttle bit wider, maybe like 40% instead of 20? Honestly not a huge deal. It's looking pretty good as is. |
Cool, that works for me! |
# Conflicts: # src/pages/workspace/accounting/PolicyAccountingPage.tsx
|
||
if (props.policy?.areConnectionsEnabled && (!props.policy || status === 'loading' || hasConnectionsDataBeenFetched === false)) { | ||
if (props.policy?.areConnectionsEnabled && status === 'loading') { |
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.
I'm still trying to see in which cases we will end up using the loader. The status initially will be loaded because initWithStoredValues is false
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.
seems like that we do not have any choice to show skeleton instead of loader. Just if we put back hasConnectionsDataBeenFetched === false - page with Accounting will not be loaded
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.
probably we can close this one @s77rt and close related GH issue as well
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.
The problem is that on other pages we are not using any loader indicator
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.
You can add a second parameter to withPolicyConnections to decide if we want to use the full screen loader
function withPolicyConnections<TProps extends WithPolicyConnectionsProps>(WrappedComponent: ComponentType<TProps>, shouldBlockView = true) {
Use that parameter with the rendering condition and in PolicyAccountingPage pass that parameter as false
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.
Yeah that works! @s77rt
Co-authored-by: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com>
Co-authored-by: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com>
Co-authored-by: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com>
@@ -41,7 +41,7 @@ function withPolicyConnections<TProps extends WithPolicyConnectionsProps>(Wrappe | |||
openPolicyAccountingPage(props.policy.id); | |||
}, [props.policy?.id, isConnectionDataFetchNeeded]); | |||
|
|||
if (props.policy?.areConnectionsEnabled && status === 'loading') { | |||
if (props.policy?.areConnectionsEnabled && status === 'loading' && shouldBlockView) { |
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.
Remove the status, I think it does not do match, instead use isConnectionDataFetchNeeded
|
||
if (props.policy?.areConnectionsEnabled && (!props.policy || status === 'loading' || hasConnectionsDataBeenFetched === false)) { | ||
if (props.policy?.areConnectionsEnabled && isConnectionDataFetchNeeded && shouldBlockView) { | ||
return ( | ||
<FullPageOfflineBlockingView> |
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.
Remove <FullPageOfflineBlockingView />
The accounting pages are accessible offline. Also since we are using isConnectionDataFetchNeeded
we will render this only when online afterall. However we need to disable the Set up buttons on the connections (QBO and Xero) since the setup requires connection
Co-authored-by: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com>
Co-authored-by: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com>
Code looks good to me. Testing... |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb ChromeNetworking issue iOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #41250 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
@narefyev91 Thank you! |
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!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Thank you too! As usual nice to work with you! |
🚀 Deployed to staging by https://github.com/youssef-lr in version: 1.4.74-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.4.74-6 🚀
|
Details
If the data is not ready, we should see a skeleton loader on the Connections card in the Accounting page, not "Hmm... it's not here" page
Fixed Issues
$ #41250
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android-web.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov