Skip to content

Add button to delete work and all editions #7973

@cdrini

Description

@cdrini

Currently, it's only possible to delete an edition via the edit UI:

image

Proposal & Constraints

We should update this to have a (super-librarian-only) button to delete a work and all of its editions:

image

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)

Additional context

Stakeholders

@jimman2003

Metadata

Metadata

Assignees

Labels

Affects: LibrariansIssues related to features that librarians particularly need. [managed]Lead: @cdriniIssues overseen by Drini (Staff: Team Lead & Solr, Library Explorer, i18n) [managed]Priority: 2Important, as time permits. [managed]Type: Feature RequestIssue describes a feature or enhancement we'd like to implement. [managed]

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions