Bulk update book metadata in chapter files
Context
At the moment the only way to update book metadata in multiple chapters at the same time is to bulk select all the chapters in the book and either select “reload preview” or “publish” — but this will be a tedious task for users of large books once pagination is introduced. For example, if we show 100 chapters per page and the book has 2000 chapters, the user would have to click through 10 pages to perform this action.
In a meeting in 11 April we discussed the implementation of a simpler way for users to update book metadata, such as a button in the UI to choose to update book metadata in all published chapters. We also discussed the possibility of using a cron job to republish chapters that have had their book metadata updated in the last 24 hours, but concluded that this could disrupt other processes. Ultimately, we decide to let users initiate the update in the UI and that the update should apply to chapters in a "previewing" and "published" status.
Proposal
The user flow and BCMS results:
- The user decides to update some book metadata in the Book Metadata UI, and selects save.
- The user decides to update the book metadata in all chapters that are "previewing" and "published" by selecting a button (wording and placement TBD).
- The BCMS writes the
<book-meta>
node into the relevant chapter files. - The BCMS updates the chapter status:
- 'Previewing' changes to 'loading preview'
- 'Published' changes to 'Publishing'
- The BCMS creates the chapter packages and loads them to PMC according the to current implementation.
Design
TBD - Propose an "Update" button next to the "Save" button on the chapter-processed book metadata modal - see:
Acceptance Criteria
-
Users have one button from the chapter-processed book Metadata modal page to update all their chapters in a Previewing or Published status. -
When user presses the "Update" button it successfully reloads to preview all components in "Previewing" status and republishes all components in "Publishing" status indicated by the updated / last published dates being updated from the time the "Update" button was triggered -
User will see the most recent book metadata entered into the Metadata modal in their Previews / Published pages
Implementation (if applicable)
Alternative approaches (if applicable)
Scheduling
Dev Estimate: 2 days for front and backend.