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

feat: Configurable operators for free text filtering in property filter #70

Conversation

youdz
Copy link
Contributor

@youdz youdz commented Mar 20, 2024

Description of changes: Adding the ability to customize free text filtering operators for the Property Filter, just like every other property operator.
See: k6RfAb8hHR1t

Prototyping this quickly showed the agreed upon API was a perfect 1:1 match for this package, and the change was small enough to jump straight to PR.

Corresponding code change on @cloudscape-design/components has a first prototype here, pending new unit tests and probably more dev app updates. But I can't submit a clean PR for it until this PR is merged given the direct dependency.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@youdz youdz force-pushed the eudes/property-filter-free-text-operators branch from 65d7eb6 to c196ed1 Compare March 20, 2024 19:12
@youdz youdz marked this pull request as ready for review March 20, 2024 19:23
@youdz youdz requested a review from a team as a code owner March 20, 2024 19:23
@youdz youdz requested review from pan-kot and removed request for a team March 20, 2024 19:23
@@ -101,17 +101,35 @@ describe('free text tokens', () => {

expect(processed).toEqual([items[2], items[3]]);
});
test('do not filter by a property, which does not support the operator of the token', () => {
Copy link
Member

Choose a reason for hiding this comment

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

The change looks good overall but I would also keep the original test to verify the free-text filtering returns false (and true for negated) when matching properties that do not have the corresponding operator. For example, if using the : operator but the property only defines =, !=, the property must not be matched.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sorry, I meant to comment on the PR for this and forgot. The current code today has this test duplicated, down to every character. Looks like a forgotten copy-paste.

So yes, the test you're asking for is still here, lines 92 to 103. 😅

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (22418f4) to head (48e4348).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #70   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          452       455    +3     
  Branches       159       160    +1     
=========================================
+ Hits           452       455    +3     

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

@youdz youdz force-pushed the eudes/property-filter-free-text-operators branch from c196ed1 to 48e4348 Compare March 21, 2024 19:05
@youdz
Copy link
Contributor Author

youdz commented Mar 21, 2024

I just clicked the Rebase button to confirm there were no conflicts, before I log off tonight. No conflicts at all, we're good. 👍

@pan-kot pan-kot merged commit 59dcd9c into cloudscape-design:main Mar 25, 2024
29 checks passed
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.

4 participants