Skip to content
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

Disable the release files button until all files have attempted to upload the max number of times #772

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

rebkwok
Copy link
Contributor

@rebkwok rebkwok commented Feb 13, 2025

Fixes #771

Change the displayed status for "Approved" in the status pills to "Approved - Files uploading"
image

(Note that I haven't changed it in the main request overview panel, which is consistent with how we dislay other statuses that have a custom label (i.e. partially reviewed/reviewed))

When the request is approved, but files are still uploading, the "Release files" button is disabled, and changes to "Re-release files" (as in screenshot above).

When all files have been attempted 3x, and some are still not uploaded, the "Re-release files" button is enabled so that the user can re-try the release.
image
Tooltips when files are uploading (disabled re-release button):
image

And when uploads have tried and failed (enabled re-release button):
image

Note: tooltip placement is a bit wonky, but this is the case already and not something for this ticket.

Currently the page needs to be manually refreshed to see changes to the file upload status - I'm deliberately not handling this in this PR, there will be a follow up one to poll via htmx for upload status changes.

Preventing the user from re-trying the release is done in the frontend only. The BLL doesn't prohibit re-tries in the release_files() method. This was a conscious decision; nothing terrible happens if a user was to re-try unnecessarily - the audit log will register it, but if the file is already uploaded - and registered as such in the RequestFile, we won't attempt to re-upload it, and it a file was uploaded but not registered, we'd re-attempt it, but we handle already uploaded file errors from job-server.

Also update the functional tests
To identify uploading status of a file and an overall request. This
will allow us to determine whether to disable or enable the "release
files" button and what tooltips to show.
Modify the label, enabled state, and tooltip for the "release
files" button based on whether the request is:
- reviewed, yet to be released (enable, show label "release files")
- approved, uploads still in progress (disable, show "re-release files")
- approved, not all files uploaded, all non-uploaded files have been
  attempted the max times (enabled, show "re-release files")
@rebkwok rebkwok merged commit 6e83ce4 into main Feb 13, 2025
10 checks passed
@rebkwok rebkwok deleted the approved-status branch February 13, 2025 12:57
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.

Disable the release files button until all files have attempted to upload the max number of times
2 participants