From 896af4a50af06ae8556cf5bd7053ea78f7d8197e Mon Sep 17 00:00:00 2001 From: Daniel Pais <55243638+DanGastardelli@users.noreply.github.com> Date: Fri, 13 Nov 2026 17:07:50 -0300 Subject: [PATCH] =?UTF-8?q?Includes=20a=20redirect=20to=20the=20404=20page?= =?UTF-8?q?=20when=20accessing=20community,=20collect=E2=80=A6=20(#6269)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 24a274d2758c7f2fb8a1e174231d109e32c10744) --- src/app/bitstream-page/bitstream-page-routes.ts | 9 +++++++++ src/app/browse-by/browse-by-page-routes.ts | 12 +++++++++++- src/app/collection-page/collection-page-routes.ts | 9 +++++++++ src/app/community-page/community-page-routes.ts | 9 +++++++++ src/app/edit-item/edit-item-routes.ts | 9 +++++++++ src/app/item-page/item-page-routes.ts | 9 +++++++++ 6 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/app/bitstream-page/bitstream-page-routes.ts b/src/app/bitstream-page/bitstream-page-routes.ts index da9d2f7c60c..42c0df21bf5 100644 --- a/src/app/bitstream-page/bitstream-page-routes.ts +++ b/src/app/bitstream-page/bitstream-page-routes.ts @@ -3,6 +3,7 @@ import { authenticatedGuard } from '@dspace/core/auth/authenticated.guard'; import { bitstreamBreadcrumbResolver } from '@dspace/core/breadcrumbs/bitstream-breadcrumb.resolver'; import { i18nBreadcrumbResolver } from '@dspace/core/breadcrumbs/i18n-breadcrumb.resolver'; +import { ThemedPageNotFoundComponent } from '../pagenotfound/themed-pagenotfound.component'; import { ResourcePolicyCreateComponent } from '../shared/resource-policies/create/resource-policy-create.component'; import { ResourcePolicyEditComponent } from '../shared/resource-policies/edit/resource-policy-edit.component'; import { resourcePolicyResolver } from '../shared/resource-policies/resolvers/resource-policy.resolver'; @@ -101,4 +102,12 @@ export const ROUTES: Route[] = [ }, ], }, + { + path: '', + component: ThemedPageNotFoundComponent, + pathMatch: 'full', + data: { + title: '404.page-not-found', + }, + }, ]; diff --git a/src/app/browse-by/browse-by-page-routes.ts b/src/app/browse-by/browse-by-page-routes.ts index 2a0259e92af..3d50517d804 100644 --- a/src/app/browse-by/browse-by-page-routes.ts +++ b/src/app/browse-by/browse-by-page-routes.ts @@ -1,6 +1,7 @@ import { Route } from '@angular/router'; import { i18nBreadcrumbResolver } from '@dspace/core/breadcrumbs/i18n-breadcrumb.resolver'; +import { ThemedPageNotFoundComponent } from '../pagenotfound/themed-pagenotfound.component'; import { browseByDSOBreadcrumbResolver } from './browse-by-dso-breadcrumb.resolver'; import { BrowseByGeospatialDataComponent } from './browse-by-geospatial-data/browse-by-geospatial-data.component'; import { browseByGuard } from './browse-by-guard'; @@ -27,5 +28,14 @@ export const ROUTES: Route[] = [ resolve: { breadcrumb: browseByI18nBreadcrumbResolver }, data: { title: 'browse.title.page', breadcrumbKey: 'browse.metadata' }, }, + { + path: '', + component: ThemedPageNotFoundComponent, + pathMatch: 'full', + data: { + title: '404.page-not-found', + }, + }, ], - }]; + }, +]; diff --git a/src/app/collection-page/collection-page-routes.ts b/src/app/collection-page/collection-page-routes.ts index 217b222fb83..da56f3b82d0 100644 --- a/src/app/collection-page/collection-page-routes.ts +++ b/src/app/collection-page/collection-page-routes.ts @@ -7,6 +7,7 @@ import { i18nBreadcrumbResolver } from '@dspace/core/breadcrumbs/i18n-breadcrumb import { ObjectAuditLogsComponent } from '../audit-page/object-audit-overview/object-audit-logs.component'; import { browseByGuard } from '../browse-by/browse-by-guard'; import { browseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver'; +import { ThemedPageNotFoundComponent } from '../pagenotfound/themed-pagenotfound.component'; import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component'; import { ComcolSearchSectionComponent } from '../shared/comcol/sections/comcol-search-section/comcol-search-section.component'; import { MenuRoute } from '../shared/menu/menu-route.model'; @@ -132,4 +133,12 @@ export const ROUTES: Route[] = [ }, ], }, + { + path: '', + component: ThemedPageNotFoundComponent, + pathMatch: 'full', + data: { + title: '404.page-not-found', + }, + }, ]; diff --git a/src/app/community-page/community-page-routes.ts b/src/app/community-page/community-page-routes.ts index d944194ed72..53c4297f642 100644 --- a/src/app/community-page/community-page-routes.ts +++ b/src/app/community-page/community-page-routes.ts @@ -6,6 +6,7 @@ import { i18nBreadcrumbResolver } from '@dspace/core/breadcrumbs/i18n-breadcrumb import { ObjectAuditLogsComponent } from '../audit-page/object-audit-overview/object-audit-logs.component'; import { browseByGuard } from '../browse-by/browse-by-guard'; import { browseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver'; +import { ThemedPageNotFoundComponent } from '../pagenotfound/themed-pagenotfound.component'; import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component'; import { ComcolSearchSectionComponent } from '../shared/comcol/sections/comcol-search-section/comcol-search-section.component'; import { MenuRoute } from '../shared/menu/menu-route.model'; @@ -131,4 +132,12 @@ export const ROUTES: Route[] = [ }, ], }, + { + path: '', + component: ThemedPageNotFoundComponent, + pathMatch: 'full', + data: { + title: '404.page-not-found', + }, + }, ]; diff --git a/src/app/edit-item/edit-item-routes.ts b/src/app/edit-item/edit-item-routes.ts index f6b6afb3223..390b9594157 100644 --- a/src/app/edit-item/edit-item-routes.ts +++ b/src/app/edit-item/edit-item-routes.ts @@ -3,6 +3,7 @@ import { editItemBreadcrumbResolver } from '@dspace/core/breadcrumbs/edit-item-b import { i18nBreadcrumbResolver } from '@dspace/core/breadcrumbs/i18n-breadcrumb.resolver'; import { authenticatedGuard } from '../core/auth/authenticated.guard'; +import { ThemedPageNotFoundComponent } from '../pagenotfound/themed-pagenotfound.component'; import { pendingChangesGuard } from '../submission/edit/pending-changes/pending-changes.guard'; import { ThemedSubmissionEditComponent } from '../submission/edit/themed-submission-edit.component'; @@ -29,4 +30,12 @@ export const ROUTES: Route[] = [ }, ], }, + { + path: '', + component: ThemedPageNotFoundComponent, + pathMatch: 'full', + data: { + title: '404.page-not-found', + }, + }, ]; diff --git a/src/app/item-page/item-page-routes.ts b/src/app/item-page/item-page-routes.ts index d6a6ab20ec1..4e636cd6eed 100644 --- a/src/app/item-page/item-page-routes.ts +++ b/src/app/item-page/item-page-routes.ts @@ -6,6 +6,7 @@ import { itemBreadcrumbResolver } from '@dspace/core/breadcrumbs/item-breadcrumb import { REQUEST_COPY_MODULE_PATH } from '../app-routing-paths'; import { ObjectAuditLogsComponent } from '../audit-page/object-audit-overview/object-audit-logs.component'; +import { ThemedPageNotFoundComponent } from '../pagenotfound/themed-pagenotfound.component'; import { MenuRoute } from '../shared/menu/menu-route.model'; import { viewTrackerResolver } from '../statistics/angulartics/dspace/view-tracker.resolver'; import { BitstreamRequestACopyPageComponent } from './bitstreams/request-a-copy/bitstream-request-a-copy-page.component'; @@ -109,4 +110,12 @@ export const ROUTES: Route[] = [ }, ], }, + { + path: '', + component: ThemedPageNotFoundComponent, + pathMatch: 'full', + data: { + title: '404.page-not-found', + }, + }, ];