-
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
Draft PR: retain current UX but use server based export for both download on browser and email export #10049
base: develop
Are you sure you want to change the base?
Conversation
server export instead of using CSV export.
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: -31 B (0%) Total Size: 1.36 MB
ℹ️ View Unchanged
|
I did a manual test on the transactions page with less than 25 transactions filtered.
|
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.
🌟 Very nice @jessy-p! I prefer this approach to removing client-side download completely.
We can implement server-side logic to significantly increase the client-side download row-count limit higher than 25-100 (10,000? 1,000,000?). We can test server performance to find where this limit should be → when async export is required.
I think this would offer a better UX for most flows, with the existing email-based flow remaining in place for very large and slow exports.
const link = document.createElement( 'a' ); | ||
link.href = response.download_url; | ||
link.click(); |
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.
💭 Note, this could be a window.location.href
, but maybe there's a benefit to link.click()
that I'm not thinking about?
const link = document.createElement( 'a' ); | |
link.href = response.download_url; | |
link.click(); | |
window.location.href = response.download_url; |
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.
Won't window.location.href
load the current file in that tab? I was trying to get the same behaviour that we have now with saveFile
which is to download the file in background.
Definitely! But I think we can focus on matching it with pagesize (25-100) currently, so that it adheres to the existing and Core UX principles, which seems to be:
|
Alternative approach for #9969
Changes proposed in this Pull Request
In this PR, the UX for browser download remains the same, but the backend implementation is changed so that the server export is used for generating the CSV which is made available immediately. This approach does NOT change the UX for merchant (i.e. download is available immediately for single page export), but it solves the overhead and issues of maintaining multiple implementations that do not match.
The corresponding server changes are on https://github.com/Automattic/transact-platform-server/pull/7077
NOTE:
This is a draft PR and needs to refined to make the final solution.
Testing instructions
Apply changes from Server PR https://github.com/Automattic/transact-platform-server/pull/7077 along with this branch
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