-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(search-bar): Add string filter wildcard operators #92570
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
Merged
nsdeschenes
merged 17 commits into
master
from
nd/feat-search-bar-add-wildcard-operators
Jun 4, 2025
Merged
feat(search-bar): Add string filter wildcard operators #92570
nsdeschenes
merged 17 commits into
master
from
nd/feat-search-bar-add-wildcard-operators
Jun 4, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
malwilley
reviewed
Jun 2, 2025
static/app/components/searchQueryBuilder/tokens/filter/filterOperator.tsx
Outdated
Show resolved
Hide resolved
static/app/components/searchQueryBuilder/tokens/filter/utils.tsx
Outdated
Show resolved
Hide resolved
static/app/components/searchQueryBuilder/tokens/filter/filterOperator.tsx
Outdated
Show resolved
Hide resolved
static/app/components/searchQueryBuilder/tokens/filter/filterOperator.tsx
Outdated
Show resolved
Hide resolved
static/app/components/searchQueryBuilder/tokens/filter/filterOperator.tsx
Show resolved
Hide resolved
nsdeschenes
commented
Jun 2, 2025
Comment on lines
245
to
268
if (token.value.type === Token.VALUE_TEXT && hasWildcardOperators) { | ||
if (token.negated) { | ||
isDoesNotContain = token.value.wildcard === WildcardOperators.SURROUNDED; | ||
} else { | ||
isContains = token.value.wildcard === WildcardOperators.SURROUNDED; | ||
isStartsWith = token.value.wildcard === WildcardOperators.LEADING; | ||
isEndsWith = token.value.wildcard === WildcardOperators.TRAILING; | ||
} | ||
} else if (token.value.type === Token.VALUE_TEXT_LIST && hasWildcardOperators) { | ||
if (token.negated) { | ||
isDoesNotContain = token.value.items.every( | ||
entry => entry.value?.wildcard === WildcardOperators.SURROUNDED | ||
); | ||
} else { | ||
isContains = token.value.items.every( | ||
entry => entry.value?.wildcard === WildcardOperators.SURROUNDED | ||
); | ||
isStartsWith = token.value.items.every( | ||
entry => entry.value?.wildcard === WildcardOperators.LEADING | ||
); | ||
isEndsWith = token.value.items.every( | ||
entry => entry.value?.wildcard === WildcardOperators.TRAILING | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that starts with and ends with here are backwards 🤦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These have been fixed
malwilley
reviewed
Jun 2, 2025
static/app/components/searchQueryBuilder/tokens/filter/filterOperator.tsx
Outdated
Show resolved
Hide resolved
static/app/components/searchQueryBuilder/tokens/filter/filterOperator.tsx
Outdated
Show resolved
Hide resolved
static/app/components/searchQueryBuilder/tokens/filter/utils.tsx
Outdated
Show resolved
Hide resolved
static/app/components/searchQueryBuilder/tokens/filter/utils.tsx
Outdated
Show resolved
Hide resolved
7733f56
to
b5d5eb2
Compare
malwilley
reviewed
Jun 4, 2025
1cede9c
to
52480af
Compare
malwilley
approved these changes
Jun 4, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅ Additional details and impacted files@@ Coverage Diff @@
## master #92570 +/- ##
==========================================
- Coverage 86.66% 81.72% -4.95%
==========================================
Files 10268 10268
Lines 589513 589493 -20
Branches 22926 22923 -3
==========================================
- Hits 510884 481735 -29149
- Misses 78183 106501 +28318
- Partials 446 1257 +811 |
andrewshie-sentry
pushed a commit
that referenced
this pull request
Jun 4, 2025
This PR focuses on updating the `FilterOperator` component to display some upcoming wildcard operators options `"contains", "does not contain", "starts with", "ends with"`. To accomplish this, I added in a new enum with the new term operators as they aren't actual operators with related symbols (e.g. `>=`), instead they will detect wildcard (`*`) characters and their location and depending on those wildcards it will determine which operator to display. Currently if you select one of the operators it will break. The underlying work to update the value with the respective wildcards will come in a follow up PR.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR focuses on updating the
FilterOperator
component to display some upcoming wildcard operators options"contains", "does not contain", "starts with", "ends with"
.To accomplish this, I added in a new enum with the new term operators as they aren't actual operators with related symbols (e.g.
>=
), instead they will detect wildcard (*
) characters and their location and depending on those wildcards it will determine which operator to display. Currently if you select one of the operators it will break. The underlying work to update the value with the respective wildcards will come in a follow up PR.Example:
