-
Notifications
You must be signed in to change notification settings - Fork 69
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
Save selected date preset into session #8983
Save selected date preset into session #8983
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +46 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
…tps://github.com/Automattic/woocommerce-payments into update/8972-save-payment-activity-preset-session
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.
Code looks safe & straightforward, no concerns.
This is what I tested:
- View
Payments > Overview
- Select
Last 3 months
preset, peruse the stats - Click a tile to view list of transactions
- Click back
- Widget shows
Last 3 months
✅
- Widget shows
- Reload page
- Widget shows
Last 3 months
✅
- Widget shows
So looking good.
I tried logging out and logging back in again, to see if it would revert back to default Last 7 days
. However, my Last 3 months
setting was used again! This seems minor, though maybe not what was intended.
@jessy-p do you know how/when the session storage clears out/resets? Do we need to do something to explicitly delete this on logout? What behaviour is desired here (i.e. when should it revert to default)?
Doh! I should have read the description more carefully! 🤦🏻
Close and re-open the tab, check that Payments Overview shows the default date range.
Retested this – closing tab reverts back to the default time period. ✅
So all good to merge IMO! 🚀
I didn’t review, just approving PR because it has been reviewed and there is no outstanding feedback to follow up. |
Fixes #8972
Changes proposed in this Pull Request
Save the user selected preset into session, so that it persists within the session.
Testing instructions
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge
Not applicable