Skip to content

Conversation

annavik
Copy link
Member

@annavik annavik commented Mar 24, 2025

Summary

In this PR we implement views to make export features available to users from UI.

As part if this work, we add following views:

  • List exports
  • Show export details
  • Register new export
  • Delete export
  • List export jobs
  • Show details for export job

Related Issues

Closes #737.

How to Test the Changes

The changes has to be tested with a backend that has export support. The easiest way to do that is to checkout this branch locally.

Screenshots

List exports:
Screenshot 2025-04-01 at 16 45 28

Export details:
Screenshot 2025-04-01 at 16 47 40

Register new export:
Screenshot 2025-04-01 at 16 49 10

Delete export:
Screenshot 2025-04-01 at 16 49 29

List export jobs:
Screenshot 2025-04-01 at 16 48 38

Export job details:
Screenshot 2025-04-01 at 16 48 46

mohamedelabbas1996 and others added 30 commits February 17, 2025 02:22
- Designed a structured framework for data exports.
- Integrated export registry for modular and extensible export formats.
- Implemented occurrences export for simple JSON and CSV formats.
- Added 'project' relationship to DataExport model.
- Refactored 'status' and 'file_url' in DataExport to be computed properties from the associated Job.
- Updated DataExportViewSet.get_queryset() to filter by active project and optimize queries with select_related('job').
- Updated DataExportSerializer to include nested Job details instead of separate job-related fields.
- Removed redundant retrieve and list methods from DataExportViewSet, relying on DRF's default behavior.
- Added DataExportAdmin with list display, filtering, and a new action to manually trigger an export job.
- Squashed migrations to consolidate schema changes and reduce migration overhead.
@annavik
Copy link
Member Author

annavik commented Apr 2, 2025

Thanks for pushing those changes! 🙏

It makes sense, I don't expect the data export model to handle progress, I just want to present progress information in UI but how we return this info is up to you!

I think our current solution works well though! We show total records and a progress bar next to it (based on job progress). If it was a bit easier to access number of records exported, I could present that as well, but no biggie! I would currently have to search the dynamic jobs stages after this specific key. I think a bit unnecessary complexity in frontend code for a small win.

Let's keep things as is!

Base automatically changed from feat/export-occurrences-data to main April 8, 2025 21:24
@mihow mihow merged commit b15f6ae into main Apr 9, 2025
8 checks passed
@mihow mihow deleted the feat/export-ui branch April 9, 2025 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI for creating & downloading data exports

3 participants