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

✨ Add custom matchers to client side filters #1922

Merged
merged 3 commits into from
May 29, 2024

Conversation

rszwajko
Copy link
Collaborator

Before this PR, all values were matched in the same way:

  1. value needs to be string or have string representation via
    getItemValue
  2. positive match is returned if (lowercased) value contains
    (lowercased) filter value.

After this PR, a custom algorithm can be provided using "matcher"
property. Direct motivation is DateRange filter which stores filter
values as ISO 8601 time intervals i.e. "2024-04-01/2024-05-01".
Positive match (value is in the range) requires parsing to date objects.

Reference-Url: https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
Reference-Url: #1913

Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.10%. Comparing base (b654645) to head (d42349d).
Report is 146 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1922      +/-   ##
==========================================
+ Coverage   39.20%   42.10%   +2.90%     
==========================================
  Files         146      163      +17     
  Lines        4857     5235     +378     
  Branches     1164     1309     +145     
==========================================
+ Hits         1904     2204     +300     
- Misses       2939     3015      +76     
- Partials       14       16       +2     
Flag Coverage Δ
client 42.10% <100.00%> (+2.90%) ⬆️
server ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Before this PR, all values were matched in the same way:
1. value needs to be string or have string representation via
   getItemValue
2. positive match is returned if (lowercased) value contains
   (lowercased) filter value.
After this PR, a custom algorithm can be provided using "matcher"
property. Direct motivation was DateRange filter which stores filter
values as ISO 8601 time intervals i.e. "2024-04-01/2024-05-01".
Positive match (value is in the range) requires parsing to date objects.

Reference-Url: https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
Signed-off-by: Radoslaw Szwajkowski <[email protected]>
@rszwajko rszwajko marked this pull request as ready for review May 23, 2024 15:46
@sjd78 sjd78 added this to the v0.5.0 milestone May 23, 2024
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants