Support manual deletion of book / chapter components that have never been published and lock book / chapter components that have been published
Context
Bookshelf staff can delete content (component) and file in the Silverlight CMS to avoid data integrity issues and should be able to do so in the BCMS too.
Currently Bookshelf staff have no way to correct the easy-to-make errors in creating components in the BCMS, which means they must create a new duplicate record to successfully process it.
Having duplicates with the same title means that the version of record is not clear to Bookshelf staff and other supported users when managing content, both by book or chapter and its package of version of record files. Based on extensive BCMS testing to date, an incorrect version often gets processed instead, causing data integrity issues in the PMC Books database of record, and possible duplicates displayed and indexed in Bookshelf and other NLM products, such as PubMed.
Proposal
Support ability for Bookshelf staff (System Admin) to manually delete components or files and one or more of their versions IF they are NOT and HAVE NEVER BEEN in a published status, and if they are OR once were in a published status, to lock them from future use, in cases they are a duplicate. This does not need to be in synch with the PMC Books Domain Service, as Bookshelf staff can have that duplicate suppressed in the PMC Books database by manual means when necessary.
Design
Design pending. Notes:
- The user should be able to "Lock" a version on any statuses except in-progress status: converting, loading, tagging.
- The choice to "Lock" is not dependent on creating a new version.
- Delete is button in bottom right of the files tab on the individual chapter version or book version
- Deleting chapter versions in bulk is button in bottom right of of Book Manager page
- Deleting book versions in bulk is button in bottom right of of Dashboard page (this should be implemented with #1322)
Implementation (if applicable)
Delete book or chapter version
Rules:
- Users cannot delete any version that has been published before.
- Users cannot delete any version that is not the current version.
Query last published value of the current version:
- wholebook or complete document: does the book version have a last published value?
- No: allow user to delete
- Yes: Show "Lock" option
- chapter-processed book: do any of the chapters within the book have a last published value?
- No: allow user to delete
- Yes: Show "Lock" option
- chapter: does the chapter version have a last published value?
- No: allow user to delete
- Yes: Show "Lock" option
Lock book or chapter version
When locked, this means that no actions can be taken except downloading files. Once a version has been locked, allow sys admin to lock/unlock at any time.
Rules:
- Previous versions: Show a "Lock" option on all previous versions for Sys Admin.
- Current version: If current version is not published, then user can delete OR Lock. If current version is published, then user can choose to:
- lock current version only OR
- lock current version and create new version OR
- Do not lock current version and create new version
How does this effect the creation of chapter versions from bulk upload?
- check on backend: if filename exists and the current version of chapter is locked, ignore the file
- on frontend: display error in bulk upload modal "The chapter with this file name is locked and cannot be updated."
Acceptance Criteria
-
If any book or chapter component version has never been published, System Admin has the ability with a Delete button to Delete that component. When the component is deleted it is removed from the BCMS database and does not show on any dashboards or searches / filters. -
If any book or chapter component version has at some point been published, System Admin has the ability with a Lock button to Lock that component. When the component is locked no user can upload files or process files until / unless they unlock the component. Users can see the component is locked on the component page and all dashboards / book manager pages.
Alternative approaches (if applicable)
Scheduling
Estimates
- Implementing delete functionality at the backend is necessary to all the following cases. 3d
- delete or lock on individual version (FrontEnd work) 1d
- delete chapters in bulk on Book manager page (FrontEnd work) 1d
- delete books in bulk on Dashboard page (FrontEnd work) 1d