Only show previews for "Latest" book versions, and only permit NCBI System Admin to modify non-latest book versions
cc @jordandc
Expected behaviour
Previews displayed in preview tabs are accurate for the book version content
Current behaviour
Previews displayed in preview tabs for inactive book versions are not active if a active book version is in a previewing or published status, because that active book version's preview overwries all book version preview tabs.
Steps to reproduce
- See: https://ncbi.cloud68.co/organizations/e64c2930-090b-46c6-bc90-1e88331a957c/bookmanager/e1ff9166-70b8-4618-b68b-9b91dce4246f
- See the preview for the Published PDF is actually that of the active Full Text, not the Published PDF Only that has not full text
Possible solution
- disable preview for non-latest version(s), could add note: 'Previews are only supported for the latest version.'
- disable updates to previous (non-"latest" created) versions except for System admins.
- Outcome of development: when System admins republish older versions they will need to look at the latest version to see the preview for the older version, press the publish button from the older version, and then they would need to go back to the latest version to republish it in order to reset it's preview.
NCBI's priority feedback
Y, for deployment
QA Steps
- Create a new version of a whole book (the existing and new versions must be PDF or XML wholebooks).
- Check that when you create a new version, you cannot see the preview of the previous version, instead there is the note 'Previews are only supported for the latest version.'
- Upload source files for the new version and publish it.
- As a sys admin, check that you can upload Source and Converted files in the previous version and also Publish the previous version.
- Sign in as an Org Admin/Editor (for the Editor you have to add this user as part of the team in both versions) and check that you cannot Publish, Upload Source or Converted files in the previous version.
- If you republish an older version, on the preview tab for the latest created version the content should get updated with the preview corresponding to the latest updated (older) version.
- To update the preview in the latest created (new) version with the latest created (new) version's real content, you need to preview or publish the latest created (new) version again.