konveyor / tackle2-ui

Tackle (2nd generation) UI component.
Apache License 2.0
8 stars 43 forks source link

:sparkles: Add custom matchers to client side filters #1922

Closed rszwajko closed 5 months ago

rszwajko commented 6 months ago

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: https://github.com/konveyor/tackle2-ui/pull/1913

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1922/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | Coverage Δ | | |---|---|---| | [client](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1922/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `42.10% <100.00%> (+2.90%)` | :arrow_up: | | [server](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1922/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.