Disable the release files button until all files have attempted to upload the max number of times #772
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 #771
Change the displayed status for "Approved" in the status pills to "Approved - Files uploading"
![image](https://private-user-images.githubusercontent.com/6770950/412792820-23519dea-05a5-4b96-9201-2f5506fd3a87.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDM0MTMsIm5iZiI6MTczOTYwMzExMywicGF0aCI6Ii82NzcwOTUwLzQxMjc5MjgyMC0yMzUxOWRlYS0wNWE1LTRiOTYtOTIwMS0yZjU1MDZmZDNhODcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDcwNTEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGY0ZmYxYzNlNjkyYTM2OThjZTQ0YjI0ZGMwNjIwNmI4MWU3MzhkZWYxZTI3YzM2MTdiZGQ0NmY4MGJjOTk0ZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.3jlDAjybPFoNjpyQoR4oQ0ajzztz4p55fkPsCMgGNPw)
(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](https://private-user-images.githubusercontent.com/6770950/412796928-334be882-1227-40bf-abae-d23db3027cce.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDM0MTMsIm5iZiI6MTczOTYwMzExMywicGF0aCI6Ii82NzcwOTUwLzQxMjc5NjkyOC0zMzRiZTg4Mi0xMjI3LTQwYmYtYWJhZS1kMjNkYjMwMjdjY2UucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDcwNTEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWVmOTdkNjA3NDQ2ZmExNWU2OGZkZTM4NWFmNThiNzE1MWQwOGVhMjU3NDFjNzkwMWU1OGVjZjFkZGU4MmQwMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.l2bhv_Evtfp6eOg-GvZ0npvywxdD8nMtJm3mmhXZ6ww)
![image](https://private-user-images.githubusercontent.com/6770950/412794258-b4e8e991-2863-4b53-bcf8-3b726fcb0409.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDM0MTMsIm5iZiI6MTczOTYwMzExMywicGF0aCI6Ii82NzcwOTUwLzQxMjc5NDI1OC1iNGU4ZTk5MS0yODYzLTRiNTMtYmNmOC0zYjcyNmZjYjA0MDkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDcwNTEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmNjMTQ5MmVhNzAyMmM5NDNiNGM0NzdjNzg1YjY3MzU4Y2I0NTc5YTNlZmI0N2I3NDE5NTg3MGFkMmJmMjAxMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.WuCaan5nlsVtfctdMokW_zHWpVvtVlYB1jtYmNp5Mug)
Tooltips when files are uploading (disabled re-release button):
And when uploads have tried and failed (enabled re-release button):
![image](https://private-user-images.githubusercontent.com/6770950/412793864-7db9240a-8cf4-4ac6-9292-adfb3c0fa11f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDM0MTMsIm5iZiI6MTczOTYwMzExMywicGF0aCI6Ii82NzcwOTUwLzQxMjc5Mzg2NC03ZGI5MjQwYS04Y2Y0LTRhYzYtOTI5Mi1hZGZiM2MwZmExMWYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDcwNTEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGQ5MTJlYzcxODM5YjVmMmZjNDU2ZWYxMDg2YmFiNjU0NzRlYTNjYWZhOWU5ODI3Mjc0ZGEwZjZjNWQ4NzRmMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.CrSfhUTHOoS-A_MLvkuFc5RwExdIyBGN1j252aiM66c)
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.