Skip to content

allow admin to delete files from ListOfFiles page #476

Open

Description

@amahuli03

Current State

Currently, there is no option to delete a file. In /listoffiles, there is only an "edit" button and a "download" button for each file.

Image

We do have a backend endpoint for this at DELETE /v1/api/uploadFile. The view is at /server/api/views/uploadFile/views.py/UploadFileView/delete, but it is not called by the frontend currently. It allows only the uploader of the file to delete it.

Expected Behavior

  • Any admin (superuser) can delete any file from the /listoffiles page.
  • Shows a confirmation prompt before deletion
    • Make accidental deletion near impossible by requiring them to type "delete"
  • Deleted file disappears from the list without page reload

Changes needed

Backend:

  • in uploadFile/views.py/uploadFileView/delete, update the permission check to allow superusers (admin):
    if upload_file.uploaded_by != request.user and not request.user.is_superuser:

Frontend:

  • Add a delete button to each FileRow alongside the existing edit and download buttons
  • Add the confirmation dialog before sending the delete request
  • call DELETE /api/v1/api/uploadFile with { guid: file.guid } and JWT auth header (same pattern as the existing edit handler around FileRow.tsx/FileRow/handleSave)
  • On success, remove the file from the parent component's state, making it disappear without a reload
    • for reference, check out how updateFileName works
    • you'll need to create a new onDelete prop, defined in ListOfFiles and passed to FileRow.

@sue-hntr Sue is a UX designer and can weigh in on design decisions and other specifics

Activity

  1. changed the title [-]Feature Request: Allow admin to delete files[/-] [+]feature request: allow admin to delete files[/+] on Mar 10, 2026
  2. changed the title [-]feature request: allow admin to delete files[/-] [+]feat: allow admin to delete files[/+] on Mar 10, 2026
  3. changed the title [-]feat: allow admin to delete files[/-] [+]feat: allow admin to delete files from ListOfFiles page[/+] on Mar 10, 2026
  4. moved this to Ready to Pick Up in Balanceron Mar 10, 2026
  5. moved this from Ready to Pick Up to In Progress in Balanceron Mar 31, 2026
  6. moved this from In Progress to Ready to Pick Up in Balanceron Jul 7, 2026
  7. moved this from Ready to Pick Up to Backlog in Balanceron Jul 8, 2026
  8. changed the title [-]feat: allow admin to delete files from ListOfFiles page[/-] [+]allow admin to delete files from ListOfFiles page[/+] on Jul 8, 2026
  9. moved this from Backlog to Ready to Pick Up in Balanceron Jul 8, 2026
  10. moved this from Ready to Pick Up to Priority in Balanceron Jul 8, 2026
  11. added
    Bug
    on Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    • Status
      Priority

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions