fix(bitstream): restore item UUID in edit redirect#154
Open
amadulhaxxani wants to merge 2 commits into
Open
Conversation
fix(bitstream): restore item UUID in edit redirect
There was a problem hiding this comment.
Pull request overview
This PR fixes redirects after editing a bitstream so users return to the correct item bitstreams edit page (/items/<UUID>/edit/bitstreams or /entities/<type>/<UUID>/edit/bitstreams) instead of a URL missing the item UUID.
Changes:
- Pass
itemId(andentityType) as query params when navigating from the item bitstreams table to the bitstream edit page. - Reintroduce fallback logic in the bitstream edit page to resolve
itemIdfrom the owning bundle’sitemlink when query params are missing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.html |
Adds query params (itemId, entityType) to the “Edit bitstream” routerLink so redirects can reconstruct the correct item edit route. |
src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts |
Restores item resolution logic in navigateToItemEditBitstreams() to prevent redirects from losing the item UUID when query params aren’t present. |
fix(bitstream): improve fallback navigation and error handling
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
When editing a bitstream (from the item bitstreams page) and clicking Save or Cancel, the user is redirected to
items/edit/bitstreamsinstead ofitems/<UUID>/edit/bitstreams. The item UUID is missing from the redirect URL.Analysis
The redirect uses
this.itemIdto construct the URL. This value comes from:itemId) – missing when navigating from the item bitstreams page edit button.bundle.iteminngOnInit– may not have completed or may be undefined if the link is not resolved on theBundlemodel.The edit button in
item-edit-bitstream-bundle.component.htmlonly uses[routerLink]without passing query params. The fallback logic innavigateToItemEditBitstreams()was removed previously, so navigation proceeds withundefineditemId.Copilot review