From 3e9085fecec0c4a276aaec403310389efd1bdef8 Mon Sep 17 00:00:00 2001 From: "David P. Steelman" Date: Mon, 22 Sep 2025 15:29:28 -0400 Subject: [PATCH] LIBCIR-450. Make "Subcommunities and Collections" default tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified the "Browse" bar on the communities pages so that the "Subcommunities and Collections" tab is selected by default, instead of the "Search" tab. This required modifying the routing, replacing the "subcoms-cols" subpath that pointed to the "SubComColSectionComponent" with the empty subpath, and adding a new subpath, "search" for pointing to the "ComcolSearchSectionComponent". Note: This would be a BREAKING CHANGE for anyone who had an MD-SOAR search results page in their bookmarks – they would now get the “Subcommunities and Collections” page (with the “Subcommunities and Collections” tab highlighted), without any search results. https://umd-dit.atlassian.net/browse/LIBCIR-450 --- docs/MdsoarAngularCustomizations.md | 19 +++++++++++++++++++ .../community-page/community-page-routes.ts | 15 ++++++++++----- .../comcol-page-browse-by.component.ts | 11 +++++++++-- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/docs/MdsoarAngularCustomizations.md b/docs/MdsoarAngularCustomizations.md index 9e3d241111..64c975ed09 100644 --- a/docs/MdsoarAngularCustomizations.md +++ b/docs/MdsoarAngularCustomizations.md @@ -8,6 +8,25 @@ Angular code, to customize it for MD-SOAR. This document is intended to cover specific changes made to Angular behavior that are outside of "normal" DSpace customization. +## "Browse" Bar on Community Pages + +Modified the "Browse" bar on the community pages so that the +"Subcommunities and Collections" tab is selected by default, instead of the +"Search" tab. + +This required modifying the routing in the following files: + +* src/app/community-page/community-page-routes.ts +* src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts + +by removing the "subcoms-cols" URL subpath associated with the +"SubComColSectionComponent", and adding a "search" URL subpath for the +"ComcolSearchSectionComponent". + +Note: This is a BREAKING CHANGE for users that have bookmarks pointing to a +search results page, as the search results page is now under the "search" +subpath. + ## Disable "End User Agreement" The "End User Agreement" is not needed, and so is disabled in the diff --git a/src/app/community-page/community-page-routes.ts b/src/app/community-page/community-page-routes.ts index 2c8a7942a4..84c3cfca40 100644 --- a/src/app/community-page/community-page-routes.ts +++ b/src/app/community-page/community-page-routes.ts @@ -73,20 +73,25 @@ export const ROUTES: Route[] = [ menu: dsoEditMenuResolver, }, children: [ + // UMD Customization + // Make "Subcommunities and Collections" tab the default tab + // when there is no subpath for the URL + // "Search" tab displayed when URL has "search" subpath { path: '', pathMatch: 'full', - component: ComcolSearchSectionComponent, - }, - { - path: 'subcoms-cols', - pathMatch: 'full', component: SubComColSectionComponent, resolve: { breadcrumb: i18nBreadcrumbResolver, }, data: { breadcrumbKey: 'community.subcoms-cols' }, }, + { + path: 'search', + pathMatch: 'full', + component: ComcolSearchSectionComponent, + }, + // End UMD Customization { path: 'browse/:id', pathMatch: 'full', diff --git a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts index a7730ee7dd..d98be69890 100644 --- a/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts +++ b/src/app/shared/comcol/comcol-page-browse-by/comcol-page-browse-by.component.ts @@ -103,16 +103,23 @@ export class ComcolPageBrowseByComponent implements OnDestroy, OnInit { }); } else if (this.contentType === 'community') { comColRoute = getCommunityPageRoute(this.id); + // UMD Customization + // "Subcommunities and Colllections" tab is default tab (selected) + // when there is no subpath for the URL + // "Search" tab displayed as selected when URL has "search" subpath + // Note: "allOptions" order affects the order of display, so Search + // is first allOptions.push({ id: 'search', label: 'collection.page.browse.search.head', - routerLink: comColRoute, + routerLink: `${comColRoute}/search`, }); allOptions.push({ id: 'comcols', label: 'community.all-lists.head', - routerLink: `${comColRoute}/subcoms-cols`, + routerLink: comColRoute, }); + // End UMD Customization } allOptions.push(...browseDefListRD.payload.page.map((config: BrowseDefinition) => ({