can preview and publish with emtpy "Book source type"
Expected behaviour
Introduce a warning if try to submit, publish or reload to preview a book that doesn't have a "Book source type" filled in in metadata.
Current behaviour
Can preview and publish with empty Book source type in metadata modal.
Steps to reproduce
- create whole xml book
- manually upload source file (and related suppl/images)
- submit and wait for preview
- got to bookmeta modal - see that "Book source type" is empty
Same applies to chapter processed books.
NCBI's priority feedback
Book source type MUST be a REQUIRED FIELD - if somehow it goes missing during processing or migration it could break Bookshelf front end.
Proposed solution
- Make Book source type a required field in collection set up, so books in collections inherit the value correctly (that is done by #1217 (closed))
- Make Book source type a required field before submitting files, loading to preview, or publishing. When a user selects 'Submit', 'Reload preview' or 'Publish', if the Book source type is not present in metadata, a popup appears which says: 'Complete the required 'Book Source type' field in the Book Metadata, and then come back to this action.'
QA Steps
- Create a wholebook (this can be tested for all types and behavior is the same)
- Upload a source file
- Click
Submit
, a popup window should appear that the book source type is missing. - Upload the converted file
- Click
Reload preview
, the same popup window will appear. - Create a chapter processed book, and do not fill the required fields on the book metadata modal (same steps can be applied for all workflows)
- Upload a chapter
- Click submit via bulk action on book manager. The popup should appear and you are not allowed to submit.
- Click the chapter and go to files tab. Try submitting there and you should not be allowed as well.
- Upload the converted file for the chapter.
- Try reloading preview from the files tab of the chapter and also from the book manager and you will be not allowed to do so, because of the popup.
With this implementation you can't have a book or book component in status published or previewing if the book source type is missing.
However the QA team has tested if there are cases where book and book component might have these statuses, clicking the publish button while the book source type is empty, the popup will appear. To do that the QA team has manually modified the content on the database to confirm the functionality.
Same popups are also in the bulk actions for the collection manager page. Although the books part of a collection inherit the source type from the collection and that is a mandatory field.