-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Currently, it's only possible to delete an edition via the edit UI:
Proposal & Constraints
We should update this to have a (super-librarian-only) button to delete a work and all of its editions:
Note: it should show a confirmation dialog warning that the work and all of its editions will be deleted. If N > 1000, it should say the operation is not possible (due to #5949 )
Context
Today, when you click "edit" on a book page, you are brought to the edit UI and are given the option to select either the work or the edition. Thers is a button in both cases that says, "Delete Record". My understanding is this button will delete the edition and not the work. The goal is to edit the code so that there is a Delete Work button (that requires a confirmation via a js native dialogue popup). If you click Delete Work, a POST would be made such that the backend will check if you are a super librarian, then batch the work's editions in batches of 1000 and delete them and add a commit message like, "deleting work and its editions, batch 1"
It shouldn't take much code as the edit UI is already wired together. Propose what files (html and backend) would need to change
Work delete functionality should already should exist here:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/books/edit/edition.html. We want update this to allow batching (i.e. delete all editions, not just 1000)

