add search icon to community and collection#109
Conversation
add search icon to community and collection, click should navigate to community/collection pre-selected advance search page add tests to confirm the new navigation
There was a problem hiding this comment.
Pull request overview
This PR adds a "search" icon/button to Community and Collection pages that allows users to navigate directly to the search page with the scope preselected to the current community or collection. This enhancement improves user experience by making scoped searches more accessible.
Changes:
- Added a new "search-dso" menu entry to the edit menu for Communities and Collections in the resolver
- Enabled queryParams binding on menu link items to support navigation with query parameters
- Wrapped the edit menu component in a flexbox container for proper alignment on Community and Collection pages
- Added comprehensive test coverage for the new feature
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/shared/dso-page/dso-edit-menu.resolver.ts | Added "search-dso" menu entry with search icon that links to /search with scope and spc.page query parameters for Communities and Collections |
| src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.html | Added [queryParams] binding to the anchor tag to support passing query parameters through RouterLink |
| src/app/shared/dso-page/dso-edit-menu/dso-edit-menu-section/dso-edit-menu-section.component.spec.ts | Added test to verify queryParams are correctly bound to the link element, and updated test fixture data |
| src/app/shared/dso-page/dso-edit-menu.resolver.spec.ts | Added comprehensive tests verifying the search entry appears for Communities and Collections with correct properties and queryParams, and is absent for Items |
| src/app/community-page/community-page.component.html | Wrapped ds-dso-edit-menu in a flex container for proper alignment with header content |
| src/app/community-page/community-page.component.spec.ts | Added new test file to verify the edit menu renders correctly on the community page |
| src/app/collection-page/collection-page.component.html | Wrapped ds-dso-edit-menu in a flex container for proper alignment with header content |
| src/app/collection-page/collection-page.component.spec.ts | Added new test file to verify the edit menu renders correctly on the collection page |
| </ds-comcol-page-content> | ||
| </header> | ||
| <ds-dso-edit-menu></ds-dso-edit-menu> | ||
| <div class="d-flex align-items-start"> |
There was a problem hiding this comment.
I’m not entirely sure what the original purpose was – I had added that d-flex align-items-start wrapper thinking it might improve alignment. But after removing it, everything still looks correct and no layout issues appear. So it was redundant. Thanks for the review – I’ve removed it. :)
Remove redundant wrapper div from collection/community page
|
Backport branch created but failed to create PR. Please create the PR manually: Or via GitHub CLI: gh pr create --repo dataquest-dev/dspace-angular --base dtq-dev --head ufal:backport-109-to-dtq-dev --title "[Port dtq-dev] add search icon to community and collection" --body "Port of #109 by @amadulhaxxani to `dtq-dev`."(see action log for full error response) |
Problem description
Add a "search" menu entry on Community and Collection pages to allow users to navigate to the search page with the scope preselected (community or collection). This makes it easier for users to limit search results to a specific community or collection.
Analysis
queryParamsare correctly bound to menu links to navigate with the scoped search.queryParamsbinding, and rendering of the edit menu.Problems
No unexpected problems occurred during the implementation.
Copilot review