Repository navigation
Includes a redirect to the 404 page when accessing community, collect… - #6269
Conversation
…ion, and item pages without an ID.
|
Hi @DanGastardelli , many thanks for your work on this, much appreciated. Overall the approach looks good to me, I would just consider to applying the same fix also on other routes, for instance: /edit-items or /bitstreams In general all the routes that ends with a param like :id/:something can produce this issue. For consistency with the app-level 404 page and to avoid issue with the missing title I would suggest to use the same configuration we have in the main routing file, something like:
|
|
I’ve made the requested adjustments, expanding on the proposed approach. |
FrancescoMolinaro
left a comment
There was a problem hiding this comment.
Hi @DanGastardelli , many thanks for addressing my feedback, I left just a comment for src/app/browse-by/browse-by-page-routes.ts, otherwise the PR looks good to me.
|
Hi @DanGastardelli, many thanks for your work on this and sorry for the delay, it looks good to me! |
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thanks @DanGastardelli ! I gave this a test today as well and it works well. The code looks good too.
I'll attempt to auto-backport this to all maintenance releases.
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-8_x
git worktree add -d .worktree/backport-6269-to-dspace-8_x origin/dspace-8_x
cd .worktree/backport-6269-to-dspace-8_x
git switch --create backport-6269-to-dspace-8_x
git cherry-pick -x 24a274d2758c7f2fb8a1e174231d109e32c10744 |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-9_x
git worktree add -d .worktree/backport-6269-to-dspace-9_x origin/dspace-9_x
cd .worktree/backport-6269-to-dspace-9_x
git switch --create backport-6269-to-dspace-9_x
git cherry-pick -x 24a274d2758c7f2fb8a1e174231d109e32c10744 |
|
Successfully created backport PR for |
DSpace#6269) * Includes a redirect to the 404 page when accessing community, collection, and item pages without an ID. * Fix for the last commit * Extending handling to new components and code adjustments * Aligning with best practices * Aligning with best practices * Update browse-by component * Update browse-by component
#6269) (#6538) * Includes a redirect to the 404 page when accessing community, collection, and item pages without an ID. * Fix for the last commit * Extending handling to new components and code adjustments * Aligning with best practices * Aligning with best practices * Update browse-by component * Update browse-by component (cherry picked from commit 24a274d) Co-authored-by: Daniel Pais <55243638+DanGastardelli@users.noreply.github.com>
#6269) (#6539) * Includes a redirect to the 404 page when accessing community, collection, and item pages without an ID. * Fix for the last commit * Extending handling to new components and code adjustments * Aligning with best practices * Aligning with best practices * Update browse-by component * Update browse-by component Co-authored-by: Daniel Pais <55243638+DanGastardelli@users.noreply.github.com>
References
#6260
Description
When accessing a community, collection, or item page without an ID, a blank page appears with no message or error.
The user should see a 404 error page instead.
Instructions for Reviewers
Access pages such as:
http://localhost:4000/communities
http://localhost:4000/collections
http://localhost:4000/items
The 404 error page should be displayed.
In the "community-page", "collection-page", and "item-page" components, I added the following handling in the routing configuration:
{
path: '',
component: ThemedPageNotFoundComponent,
canActivate: [endUserAgreementCurrentUserGuard],
}