Update the uploaded files count on the request page #781
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #774
When a request is approved and has files uploading in the background, we want to be able to keep the user updated as the files upload. This adds a view that renders just the uploaded file count snippet, and uses htmx to poll it for updates. If the request isn't in an upload-in-progress state, we don't include the htmx attributes, so we don't poll when nothing will change.
If the request moves out of uploading state (either because it complete, or because it fails and won't re-try anything automatically anymore), we reload the page so we update other relevant elements as well (request status, release button etc).
Note that the audit log on the overview page should technically be also updated along with the file count, but I think it's probably acceptable that it does update until the page is reloaded. If users are staying on the page to wait for the uploads to complete, they probably aren't looking at the audit log until the request either completes or fails, and then it'll be reloaded and updated anyway.