Create new version button disabled when no new version in progress #2720
Labels
bug
claimed: Atmire
Atmire team is working on this issue & will contribute back
component: Item
(Archived) Item display or editing
component: versioning
Milestone
Describe the bug
If an item already has 1 or more (completed) versions the create new version is disabled claiming there is a version in progress, even when there is not.
Example item: https://demo.dspace.org/items/22d80b2d-c82b-46bf-b052-2c0648848ef2 (as dspace admin that created & deposited the second version)
To Reproduce
Steps to reproduce the behavior (As DSpace Admin):
Expected behavior
This button should only be disabled if there is a new version of the item already in progress in either workspace or workflow (regardless of which user is creating this version should be disabled for all users that are creating the version, perhaps for the user creating the version this button could be to resume the workspace/workflow item, but would be out of scope for this bug fix)
Likely cause/possible solution
This button uses versionhistory.draftVersion in
version-history-data.service.ts
hasDraftVersion$
here to check whether or not there is a version in progress, but something likely goes wrong there, & thestartWith(true)
is likely used hereVersionHistory modal in Angular assumes
draftVersion
contains just boolean on whether or not there is a draft version, but rather it contains the draft version item if it exists and user is allowed to access it, otherwise doesn't resolve (either gives 204 no content or not authorised error) => See VersionHistoryDraftVersionLinkRepositoryExample when there is no draft: https://demo.dspace.org/server/#https://demo.dspace.org/server/api/core/items/22d80b2d-c82b-46bf-b052-2c0648848ef2/version?embed=versionhistory => draftVersion
Needs a new property on endpoint indicating whether or not the is a version in progress regardless of whether or not it can be accessed by user
Related work
https://github.com/DSpace/dspace-angular/pull/1318/commits
The text was updated successfully, but these errors were encountered: