-
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
Add kml selection exports #5300
base: production
Are you sure you want to change the base?
Conversation
Fix type errors (TODO: use XmlNode)
Fix data format Add xml header Attempt to fix types
While I'm sure that this is done to mimic CSV on frontend, I think a better implementation would be just to make an API call, but this time adding an extra filter to just select the ids that the user chose. Benefits:
@maxpatiiuk thoughts? I think, even for CSV, it would have been better to directly use backend. |
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.
Good use of the utility functions that we have available!
Nevertheless, I agree with Vinny that if it would reduce duplication, we should do this work on the back-end.
Aside from that, better communication about who is working on what is always nice to avoid redundant effort
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
I agree. I already came across issues myself having to implement the same feature twice on my last CSV export PR. I think the only downside is we'd lose the instant downloads from the frontend exports. |
I don't think it necessarily matters, especially for KML exports. For CSV, it is quite handy to do it within a few clicks, so don't change that (or users wouldn't like extra clicks needed now). For KML, definitely go the backend route. You'd learn about the query builder API quite a bit in the process! |
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.
👍
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.
Testing instructions
- In query builder, create a locality query with coordinate data (like Latitude1 and Longitude1).
- Run the query and "Create KML"
- Make sure the KML was exported correctly. The result should be the exact same as one created on production.
- Select any rows of the query results.
- Make sure the KML includes ONLY the rows that were selected. (Also keep in mind that any rows without valid coordinate data will not be exported.)
- Make sure CSV exports still work.
If you try to create KML without selecting any rows nothing happens. Creating a KML and selecting rows does work along with creating a CSV with or without selecting rows.
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.
- In query builder, create a locality query with coordinate data (like Latitude1 and Longitude1).
- Run the query and "Create KML"
- Make sure the KML was exported correctly. The result should be the exact same as one created on production.
- Select any rows of the query results.
- Make sure the KML includes ONLY the rows that were selected. (Also keep in mind that any rows without valid coordinate data will not be exported.)
- Make sure CSV exports still work.
Looks great! Everything works as expected.
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.
Testing instructions
- In query builder, create a locality query with coordinate data (like Latitude1 and Longitude1).
- Run the query and "Create KML"
- Make sure the KML was exported correctly. The result should be the exact same as one created on production.
- Select any rows of the query results.
- Make sure the KML includes ONLY the rows that were selected. (Also keep in mind that any rows without valid coordinate data will not be exported.)
- Make sure CSV exports still work.
Looks good!!
Fixes #3589
Adds the ability to export a KML file from a query using only the selected query results.
Checklist
and self-explanatory (or properly documented)
Testing instructions