add New version action for archived submission items#130
Open
amadulhaxxani wants to merge 3 commits intoclarin-v7from
Open
add New version action for archived submission items#130amadulhaxxani wants to merge 3 commits intoclarin-v7from
amadulhaxxani wants to merge 3 commits intoclarin-v7from
Conversation
add New version action for archived submission items
There was a problem hiding this comment.
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
ItemActionsComponentto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
Copilot review