[DSpace-CRIS] Implement detailed error handling for custom url conflicts#5475
[DSpace-CRIS] Implement detailed error handling for custom url conflicts#5475FrancescoMolinaro wants to merge 2 commits intoDSpace:mainfrom
Conversation
There was a problem hiding this comment.
👍 Thanks @FrancescoMolinaro ! This looks great to me! I like the new detailed error message, and I find it useful that it provides advice and direct links to correct the problem. I tested this and found it works well. Code looks good too
So, in my opinion, this looks like a good solution to fix the blocker issue.
@kskaiser or @nwoodward : pinging both of you as you both helped with the initial testing of this Custom URL feature. Let me know if you have any outstanding concerns about the approach taken here. I plan to merge this PR later this week, assuming no objections.
|
👍 Thanks @FrancescoMolinaro! I tested this PR today, and it works well. I appreciate the links to edit the items with the same custom URL. This isn't a showstopper for me, but my only issue is those edit links appear for everyone, including anonymous users and users who don't have permission to edit the items. Clicking on the links sends those users to a 403 Forbidden, so there's no chance they will edit them. In theory, it would be nice in that case if users only saw a simple text list of items that share the same custom URL instead of the edit links, but again, I don't think this issue is large enough to delay this PR. |
|
Hi @nwoodward , @tdonohue , many thanks for the feedback, I have adapted the template so that for unauthenticated users only plain text will be displayed. |
References
Fixes: #5078
Relates to: #4814
Description
Implemented error handling on item page for custom url conflict.
Added direct link to administrative edit for item correction.
Instructions for Reviewers
Implemented a new component shown on the item page when a custom URL lookup returns a 500 error, which indicates that multiple items share the same dspace.customurl value.
Uses SearchService.search() with a dspace.customurl filter to find all items with the conflicting value, then renders a direct edit link (/edit-items/:FULL) for each result so administrators can immediately navigate to and fix the affected items.
Placed inside the item page template when itemRD.statusCode === 500 and the resolved route param is not a UUID (i.e. it was a custom URL lookup).
Step to reproduce:
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.