Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #649
Enabled all users to view and use the "Export Job List to CSV" on the Job List view.
Refactored view logic with respect to session storage and user-job access into dedicated utility classes.
Superusers and those with the statistics.view_job permission (e.g., staff users) may view and export all jobs.
Project PIs and managers may view and export:
Their own jobs across any project, and
Jobs submitted by any user under projects they manage.
Other users may view and export their own jobs.
Limited the maximum number of jobs that may be exported to 100,000.
An error appears if an export of a larger number is attempted.
Updated tests.
Type of change
Please delete options that are not relevant.
New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Log in as users (admins, project managers, regular users), and ensure that the jobs viewable in the list view and exportable via the export button are limited to those they may access.
Inspect the contents of the exported CSV and verify that they match the filtered jobs in the list view.
Try to export more than 100,000 jobs. Ensure that an error appears.
Ensure that tests in coldfront.core.statistics.tests.test_job_views pass.
PR Self Evaluation
Strikethrough things that don’t make sense for your PR.
[x] My code follows the agreed upon best practices
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation (if needed)
[x] My changes generate no new warnings
[x] Any dependent changes have been merged and published in the appropriate modules
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes #649
statistics.view_job
permission (e.g., staff users) may view and export all jobs.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
coldfront.core.statistics.tests.test_job_views
pass.PR Self Evaluation
Strikethrough things that don’t make sense for your PR.