Skip to content

add New version action for archived submission items#130

Open
amadulhaxxani wants to merge 3 commits intoclarin-v7from
129-add-the-new-version-button-to-workspace-your-submissions
Open

add New version action for archived submission items#130
amadulhaxxani wants to merge 3 commits intoclarin-v7from
129-add-the-new-version-button-to-workspace-your-submissions

Conversation

@amadulhaxxani
Copy link
Copy Markdown

Problem description

On the MyDSpace Your Submissions page, archived item rows only showed the View action.
The New version action existed on item pages, but not in the submissions list, making version creation harder to discover.

Analysis

Implemented the minimal scoped solution in ds-item-actions only (archived items), without changing workspace draft actions.

  • Added New version button to archived submission actions next to View
  • Reused existing versioning flow from DsoVersioningModalService
  • Reused existing authorization check CanCreateVersion
  • Reused existing tooltip/disabled logic for draft version cases
  • Reused existing translation keys:
    • item.page.version.create
    • item.page.version.hasDraft
  • Added unit tests for:
    • visibility when authorized
    • hidden state when unauthorized
    • disabled state when draft exists
    • click handler opening create-version modal

Copilot review

  • Requested review from Copilot

 add New version action for archived submission items
Copilot AI review requested due to automatic review settings April 7, 2026 13:55
@amadulhaxxani amadulhaxxani linked an issue Apr 7, 2026 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves discoverability of item versioning from the MyDSpace “Your Submissions” list by adding a New version action to archived item rows, reusing the existing versioning modal flow and authorization checks already used on item pages.

Changes:

  • Added versioning-related observables and a click handler to ItemActionsComponent to drive button visibility/disabled state/tooltip.
  • Updated the archived item actions template to render a New version button alongside View.
  • Added unit tests covering visibility, authorization, disabled state, and modal invocation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/app/shared/mydspace-actions/item/item-actions.component.ts Adds authorization + versioning state wiring and handler to open the create-version modal from the submissions list.
src/app/shared/mydspace-actions/item/item-actions.component.html Renders the New version button with tooltip/aria-label and disabled logic.
src/app/shared/mydspace-actions/item/item-actions.component.spec.ts Adds tests for button presence/absence, disabled state, and click behavior.

Import shareReplay and apply .pipe(shareReplay(1)) to the version draft observable in ItemActionsComponent. This shares the subscription and caches the latest emission so multiple subscribers won't trigger duplicate work or requests.
Use the disableNewVersion$ observable to compute newVersionTooltip$ (with map) and apply shareReplay to disableNewVersion$, instead of calling getVersioningTooltipMessage unconditionally. This avoids invoking the tooltip service when the button is disabled. Added map import and updated unit test to assert the tooltip is derived from the disabled state and that getVersioningTooltipMessage is not called.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the "New version" button to workspace (your submissions)

2 participants