Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new version button disabled when no new version in progress #2720

Closed
MarieVerdonck opened this issue Dec 20, 2023 · 2 comments · Fixed by #2761
Closed

Create new version button disabled when no new version in progress #2720

MarieVerdonck opened this issue Dec 20, 2023 · 2 comments · Fixed by #2761
Assignees
Labels
bug claimed: Atmire Atmire team is working on this issue & will contribute back component: Item (Archived) Item display or editing component: versioning
Milestone

Comments

@MarieVerdonck
Copy link
Contributor

MarieVerdonck commented Dec 20, 2023

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):

  1. Create new version of an item without any versions
  2. Deposit version
  3. Go to the latest version page
  4. The create new version button is disabled

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, & the startWith(true) is likely used here

VersionHistory 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 VersionHistoryDraftVersionLinkRepository

Example 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

@MarieVerdonck MarieVerdonck added bug needs triage New issue needs triage and/or scheduling labels Dec 20, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Triage in DSpace Backlog Dec 20, 2023
@tdonohue tdonohue added help wanted Needs a volunteer to claim to move forward component: versioning component: Item (Archived) Item display or editing and removed needs triage New issue needs triage and/or scheduling labels Dec 20, 2023
@MarieVerdonck
Copy link
Contributor Author

Atmire would like to claim this issue

@tdonohue
Copy link
Member

tdonohue commented Jan 8, 2024

Thanks @MarieVerdonck . Assigning you.

@tdonohue tdonohue added claimed: Atmire Atmire team is working on this issue & will contribute back and removed help wanted Needs a volunteer to claim to move forward labels Jan 8, 2024
@tdonohue tdonohue moved this from 📋 To Do to 🏗 In Progress in DSpace 8.x and 7.6.x Maintenance Jan 8, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in DSpace 8.x and 7.6.x Maintenance May 30, 2024
@tdonohue tdonohue added this to the 7.6.2 milestone May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug claimed: Atmire Atmire team is working on this issue & will contribute back component: Item (Archived) Item display or editing component: versioning
Projects
Development

Successfully merging a pull request may close this issue.

2 participants