-
Notifications
You must be signed in to change notification settings - Fork 36
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
Create CSV export with only selected query rows #3476
Conversation
@CarolineDenis since this branch was based on |
Triggered by 4062ef9 on branch refs/heads/issue-2348
@maxpatiiuk @CarolineDenis Can this change be transferred to production as we have no timeline for release yet for |
@grantfitzsimmons |
specifyweb/frontend/js_src/lib/components/QueryBuilder/Export.tsx
Outdated
Show resolved
Hide resolved
specifyweb/frontend/js_src/lib/components/QueryBuilder/Export.tsx
Outdated
Show resolved
Hide resolved
Triggered by f73d716 on branch refs/heads/issue-2348
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.
After thinking futher about this code, I do like your solution of making selectedRows accessible to parent components as this might even be useful for other use cases in the future.
The only advice I have here is to change resultsArray
from being a state to being a ref. Please think though implications of this change (i.e, what's the difference between state and ref, especially when it comes to triggering react re-renders) and why it's beneficial to do that change in here
specifyweb/frontend/js_src/lib/components/QueryBuilder/Export.tsx
Outdated
Show resolved
Hide resolved
specifyweb/frontend/js_src/lib/components/QueryBuilder/Export.tsx
Outdated
Show resolved
Hide resolved
Triggered by fd88531 on branch refs/heads/issue-2348
Triggered by 428eb63 on branch refs/heads/issue-2348
specifyweb/frontend/js_src/lib/components/QueryBuilder/ResultsWrapper.tsx
Outdated
Show resolved
Hide resolved
specifyweb/frontend/js_src/lib/components/QueryBuilder/Wrapped.tsx
Outdated
Show resolved
Hide resolved
Works. But exported files with only selected rows were .tsv |
Triggered by be660f5 on branch refs/heads/issue-2348
Good catch! The code should not be hardcoded to use The button however should always say |
specifyweb/frontend/js_src/lib/components/QueryBuilder/Export.tsx
Outdated
Show resolved
Hide resolved
specifyweb/frontend/js_src/lib/components/QueryBuilder/Export.tsx
Outdated
Show resolved
Hide resolved
specifyweb/frontend/js_src/lib/components/QueryBuilder/Export.tsx
Outdated
Show resolved
Hide resolved
specifyweb/frontend/js_src/lib/components/QueryBuilder/Export.tsx
Outdated
Show resolved
Hide resolved
Also the naming format of the exported files differs: query_results_2023-05-22T20_21_21.052320.csv vs taxon query - Mon May 22 2023.tsv |
Triggered by ae58862 on branch refs/heads/issue-2348
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.
Mainly related to maintaining consistency with the old Create CSV
Two things:
1- The old Create CSV
lets users download the file through the notifications while selected query are automatically downloaded.
2- Naming format of the exported files still differs from the old Create CSV
Yes, we should improve the back-end file name. But, Caroline created a separate issue for that, so it doesn't necessarily have to be fixed as part of this PR - #3525 As far as using notifications:
Thus, this inconsistency is justified |
|
@bronwyncombs can you expand upon this please? What exactly did you find while testing this? I tested this on When exporting a query to CSV that has not been saved, it exports correctly (only the selected rows). The Query name is New Query -_ Collection Object - Fri Jun 02 2023.csv Exporting a saved Query seems to work as intended. The selected rows export properly, and the file is named correctly. |
Fixes #2348