Repository navigation
[Port dspace-9_x] Support multiple search instances on a single page - #5739
Open
alijaber-atmire wants to merge 13 commits into
Open
alijaber-atmire wants to merge 13 commits into
alijaber-atmire wants to merge 13 commits into
Conversation
added 2 commits
May 30, 2026 23:09
…with searchInstanceId
Adds support for running multiple search components on a single page by
prefixing all search-related route and query parameters with a unique
search instance id (${searchInstanceId}.${parameterName}). Previously only
sort and pagination parameters were scoped; configuration, fixedFilterQuery,
scope, query, dsoType, view and filter queries (f.xxx) are now scoped too.
…w2p-141627_search-instance-params-9.x_contribute # Conflicts: # src/app/core/shared/search/search-configuration.service.ts
This was referenced May 31, 2026
added 2 commits
June 8, 2026 01:15
…refixed params on load
…to w2p-141627_search-instance-params-9.x_contribute
12 tasks
alijaber-atmire
marked this pull request as ready for review
June 24, 2026 21:44
added 2 commits
July 16, 2026 09:29
…onents to use scoped config service
…to w2p-141627_search-instance-params-9.x_contribute
added 6 commits
October 16, 2026 09:24
The collapsed/expanded state and facet page of search filters were stored by filter name only, so multiple searches on the same page (e.g. exhibit search blocks) shared that state. Resetting the filters of one search re-initialized the filter panels of every other search with the same filter names, hiding their selected values. The state keys are now prefixed with the search instance id. Also pass inPlaceSearch to the small-screen search sidebar, so its filter and "Reset filters" links stay on the current page instead of going to /search.
|
Hi @alijaber-atmire, |
…arch-instance-params-9.x_contribute # Conflicts: # src/app/shared/testing/pagination-service.stub.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Description
Extends the per-search-instance prefixing (currently only applied to
sortandpagination) to all remaining search route and query parameters, so multiple search components can coexist on a single page without interfering with each other.Instructions for Reviewers
This builds on the existing mechanism that prefixes
sort/paginationparams with a unique search-instance identifier, and applies the same approach to every other search parameter.List of changes in this PR:
searchInstanceIdtoSearchConfigurationServiceand helper methods to build/read instance-scoped parameters:getSearchInstanceParam,getCurrentSearchInstanceParam,getCurrentSearchInstanceQueryParam,getSearchInstanceFilterParam,getCurrentSearchInstanceFilterParam, andgetSearchInstanceFilterParamPrefix.getCurrentConfiguration,getCurrentScope,getCurrentQuery, andgetCurrentDSOTypeto resolve their values from instance-prefixed route/query parameters (with a fallback to the legacy unprefixed parameter for backwards compatibility).SearchFilterServiceandSearchServiceto read/write thef.xxxfilter parameters andviewusing the instance prefix.search.component,search-form.component,search-results.component,search-settings.component,search-switch-configuration.component,search-navbar.component,search-page.component,configuration-search-page.component,themed(-configuration)-search.component, the facet/range filter option components, andobject-collection.component— to use the instance-prefixed parameter names.recent-item-list,my-dspace-configuration.service, andmy-dspace.guardto use the new instance-scoped params.search-configuration-service/pagination-servicetest stubs accordingly.How to test (multiple search instances):
yarn start/npm start).SearchConfigurationServiceinjection, so use two separateConfigurationSearchPageComponent/SearchPageComponentinstances — not twoSearchComponentinstances sharing a singleSearchConfigurationService. BecausesearchInstanceIdis stored as an instance variable on the service, twoSearchComponents backed by the same service would overwrite each other's id.searchInstanceIdby explicitly passing it in (e.g.[searchInstanceId]="'first'"and[searchInstanceId]="'second'"), since the components default to the same id otherwise.dsoType, and apply facet/range filters.first.query,first.f.author,first.configuration) and that the second instance is unaffected, and vice versa.How to test (backwards compatibility of legacy URLs):
/search?query=cats&f.author=Smith,equals&view=list), as produced by older versions / external links / bookmarks.spc.query=cats&spc.f.author=Smith,equals&spc.view=list) and the search results, active filters, and view mode reflect those values.Checklist
mainbranch of code — N/A: this is a version-specific PR targetingdspace-10_x(the bug is being fixed on the 7.6/9.x/10.x lines).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.