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
| }, [hasConnectionsDataBeenFetched, props.policy, isOffline, isConnectionDataFetchNeeded]); | ||
|
|
||
| if (props.policy?.areConnectionsEnabled && (!props.policy || status === 'loading' || hasConnectionsDataBeenFetched === false)) { | ||
| if (props.policy?.areConnectionsEnabled && status === 'loading') { |
There was a problem hiding this comment.
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.
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.
probably we can close this one @s77rt and close related GH issue as well
There was a problem hiding this comment.
The problem is that on other pages we are not using any loader indicator
There was a problem hiding this comment.
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
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>
| }, [props.policy?.id, isConnectionDataFetchNeeded]); | ||
|
|
||
| if (props.policy?.areConnectionsEnabled && status === 'loading') { | ||
| if (props.policy?.areConnectionsEnabled && status === 'loading' && shouldBlockView) { |
There was a problem hiding this comment.
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.
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! |
|
✋ 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
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