Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIIN-2859: Fetch facets with the same query as Contributor records when the search is done by selecting browse result. #2454

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

Dmytro-Melnyshyn
Copy link
Contributor

@Dmytro-Melnyshyn Dmytro-Melnyshyn commented Apr 22, 2024

Description

When a user hits a contributor record from the list of Browse results and is redirected to the Search lookup, then the query contributors.name==/string "%{query}" is used to get the same number of records as pointed out in the clicked record. If a user performs a regular search in the Search lookup, the query contributors.name="%{query}" is used. But facets use contributors.name="%{query}" for both options, so the number of records didn't match the number displayed next to facet options. Facets should build a query using the same logic as the search.

Extracted common logic into getTemplateForSelectedFromBrowseRecord and applied for both search and facets.
Added selectedBrowseResult to the deps in useEffect of the useFacets hook to fetch facet options when the only change is the selectedBrowseResult parameter. This takes place when a user hits a Browse contributor, is redirected to the Search lookup, and hits the search button again.

Approach

Refs

Screenshots

2024-04-22_15h13_50.mp4

Copy link

github-actions bot commented Apr 22, 2024

Jest Unit Test Statistics

    1 files  ±0  241 suites  ±0   12m 22s ⏱️ -33s
974 tests +2  972 ✔️ +2  2 💤 ±0  0 ±0 
980 runs  +2  978 ✔️ +2  2 💤 ±0  0 ±0 

Results for commit 7edc024. ± Comparison against base commit a808532.

♻️ This comment has been updated with latest results.

…en the search is done by selecting browse result.
Copy link

sonarcloud bot commented Apr 22, 2024

@Dmytro-Melnyshyn Dmytro-Melnyshyn merged commit 49cbaf7 into master Apr 22, 2024
5 checks passed
@Dmytro-Melnyshyn Dmytro-Melnyshyn deleted the UIIN-2859 branch April 22, 2024 15:27
mariia-aloshyna pushed a commit that referenced this pull request Apr 26, 2024
…en the search is done by selecting browse result. (#2454)

(cherry picked from commit 49cbaf7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants