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

WEBDEV-5583 Add filters param to handle facet/date-range constraints #23

Merged
merged 21 commits into from
Nov 21, 2022

Conversation

latonv
Copy link
Contributor

@latonv latonv commented Nov 7, 2022

The PPS accepts a filter_map URL parameter that specifies constraints on metadata field values, such as including/excluding certain values or ensuring they are within a given numeric range. This PR adds a filters param and related types to the search service so that it can accept and pass along these constraints. This will allow constraints like selected/negative facets and date picker queries to be more cleanly passed to the PPS (rather than the current approach of joining them into the query string itself).

This PR also includes several updates to the demo app, both to enable testing multiple filters and to improve readabililty/folding.

@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Merging #23 (e0422f1) into main (6b6a839) will increase coverage by 3.10%.
The diff coverage is 100.00%.

❗ Current head e0422f1 differs from pull request most recent head 563a895. Consider uploading reports for the commit 563a895 to get more accurate results

@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   82.05%   85.15%   +3.10%     
==========================================
  Files          24       26       +2     
  Lines        1989     2405     +416     
  Branches      106      108       +2     
==========================================
+ Hits         1632     2048     +416     
  Misses        345      345              
  Partials       12       12              
Impacted Files Coverage Δ
src/filter-map-builder.ts 100.00% <100.00%> (ø)
src/search-param-url-generator.ts 100.00% <100.00%> (ø)
src/search-params.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

PR Preview Action v1.2.0
Preview removed because the pull request was closed.
2022-11-21 20:33 UTC

Copy link

@mmcnl mmcnl left a comment

Choose a reason for hiding this comment

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

LGTM! I especially appreciated the way that filter-map-builder-test.ts shows how to use the class

src/filter-map-builder.ts Outdated Show resolved Hide resolved
test/filter-map-builder.test.ts Outdated Show resolved Hide resolved
@latonv latonv merged commit 750164d into main Nov 21, 2022
@latonv latonv deleted the webdev5583-add-filter-map branch November 21, 2022 20:32
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.

None yet

2 participants