Skip to content

ZCU-PUB/Display full community path in sidebar search results#1235

Open
Paurikova2 wants to merge 6 commits intocustomer/zcu-pubfrom
zcu-pub/sidebar-search-full-community-hierarchy-path
Open

ZCU-PUB/Display full community path in sidebar search results#1235
Paurikova2 wants to merge 6 commits intocustomer/zcu-pubfrom
zcu-pub/sidebar-search-full-community-hierarchy-path

Conversation

@Paurikova2
Copy link
Collaborator

Problem description

Display the complete hierarchical path from root to parent for communities
and collections in the sidebar search modal, instead of showing only the
immediate parent.

Changes:

  • Modified getParentTitle() in SidebarSearchListElementComponent to use
    DSOBreadcrumbsService.getBreadcrumbs() for communities/collections,
    building full hierarchical path (e.g., "Test / FKU" instead of "FKU")
  • Fixed runtime type checking to handle both string and ResourceType
    values, as REST API deserializes type as plain string
  • Added OnInit interface implementation to base component
  • Updated PersonSidebarSearchListElementComponent constructor to include
    missing dsoBreadcrumbsService parameter
  • Enhanced test factory with DSOBreadcrumbsService mock to support
    breadcrumb testing

Impact:

When creating new Collections or Communities, users now see the complete
path context in search results (e.g., "Test / FKU / Home" hierarchy),
making it easier to identify and select the correct parent community.

Manual Testing (if applicable)

Copilot review

  • Requested review from Copilot

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates sidebar search list elements to show a full hierarchical parent path (breadcrumbs) for Communities and Collections in the sidebar search modal, improving context when selecting parents during creation workflows.

Changes:

  • Updated SidebarSearchListElementComponent.getParentTitle() to use DSOBreadcrumbsService.getBreadcrumbs() for Communities/Collections and join ancestors into a full path.
  • Extended sidebar-search list element components (Community/Collection/Person) to inject DSOBreadcrumbsService after updating the base component constructor.
  • Enhanced the shared sidebar-search list element test factory to provide a DSOBreadcrumbsService mock.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts Builds full parent path for community/collection results via breadcrumbs service.
src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.spec.ts Adds breadcrumbs service mock to shared test factory.
src/app/shared/object-list/sidebar-search-list-element/community/community-sidebar-search-list-element.component.ts Fixes selector and wires constructor deps through to updated base class.
src/app/shared/object-list/sidebar-search-list-element/collection/collection-sidebar-search-list-element.component.ts Wires constructor deps through to updated base class.
src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts Adds missing breadcrumbs service injection and passes it to base constructor.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

@Paurikova2 Paurikova2 requested a review from milanmajchrak March 5, 2026 13:05
@Paurikova2
Copy link
Collaborator Author

@milanmajchrak If we want to include this PR, we should also offer it to Vanilla and cherry-pick it for other customers (mainly dtq-dev).

const typeValue = this.dso.type?.value ?? (this.dso as any).type;
if (this.dso && (typeValue === DSpaceObjectType.COMMUNITY.toLowerCase() || typeValue === DSpaceObjectType.COLLECTION.toLowerCase())) {
// For communities and collections, build hierarchical path via breadcrumbs
return this.dsoBreadcrumbsService.getBreadcrumbs(this.dso as unknown as ChildHALResource & DSpaceObject, '').pipe(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot it be done without as unknown as - it seems like big hack

@Paurikova2
Copy link
Collaborator Author

@milanmajchrak I wanted to add it to scenarios earlier, but then I realized we should first merge it into dtq-dev (zcu-pub isn’t used for testing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants