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: Property filter token groups #74

Merged
merged 7 commits into from
Aug 29, 2024
Merged

Conversation

pan-kot
Copy link
Member

@pan-kot pan-kot commented Jun 13, 2024

Added support for token groups in property filter.

Property filter PR: cloudscape-design/components#2626

Rel: [qUFhApKfmWEg]

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

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.17%. Comparing base (e537686) to head (2d46a07).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #74   +/-   ##
=======================================
  Coverage   99.16%   99.17%           
=======================================
  Files          13       13           
  Lines         478      482    +4     
  Branches      168      170    +2     
=======================================
+ Hits          474      478    +4     
  Misses          4        4           

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

@pan-kot pan-kot force-pushed the property-filter-token-groups branch 4 times, most recently from ab0bdc9 to e991757 Compare July 10, 2024 10:44
@pan-kot pan-kot changed the title feat: Property filter token groups feat: Property filter token groups (internal) Jul 23, 2024
@pan-kot pan-kot changed the title feat: Property filter token groups (internal) chore: Property filter token groups (internal) Jul 23, 2024
@pan-kot pan-kot changed the title chore: Property filter token groups (internal) feat: Property filter token groups Jul 23, 2024
@pan-kot pan-kot marked this pull request as ready for review August 28, 2024 13:18
@pan-kot pan-kot requested a review from a team as a code owner August 28, 2024 13:18
@pan-kot pan-kot requested review from YueyingLu and removed request for a team August 28, 2024 13:18
return result;
return evaluate({
operation: query.operation,
tokens: query.tokenGroups ?? query.tokens.map(token => ({ operation: 'and', tokens: [token] })),
Copy link
Member

Choose a reason for hiding this comment

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

Why is the operation always and but not token.operation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Great question. The query.tokens has type Token[] so no operation there. As the tokens list is always a single token the operation is irrelevant.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this transformation as unneeded as the evaluate function takes either token groups or tokens

@pan-kot pan-kot force-pushed the property-filter-token-groups branch from e991757 to 789cc7b Compare August 29, 2024 13:35
@pan-kot pan-kot requested a review from YueyingLu August 29, 2024 13:41
@pan-kot pan-kot enabled auto-merge August 29, 2024 13:48
@pan-kot pan-kot added this pull request to the merge queue Aug 29, 2024
Merged via the queue into main with commit 0ec7db3 Aug 29, 2024
30 checks passed
@pan-kot pan-kot deleted the property-filter-token-groups branch August 29, 2024 14:20
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