Skip to content

feat:(search-bar): Hide asterisk character for contains ops #93848

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nsdeschenes
Copy link
Contributor

This PR updates the function that formats values being rendered in the search bar so that they won't render the asterisks when all values are considered to be wildcard'ed values.

Example:

Screenshot 2025-06-18 at 15 13 50

@nsdeschenes nsdeschenes requested a review from malwilley June 18, 2025 19:22
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 18, 2025
@nsdeschenes nsdeschenes marked this pull request as ready for review June 18, 2025 19:26
export function formatFilterValue(token: TokenResult<Token.FILTER>['value']): string {
export function formatFilterValue(
token: TokenResult<Token.FILTER>['value'],
allContains = false
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding a second argument, can you make this {token, allContains}?

Copy link
Member

Choose a reason for hiding this comment

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

Also, I wonder if the naming can be a bit more descriptive for what it is doing in this function. Like stripWildcards or something

switch (token.type) {
case Token.VALUE_TEXT: {
const content = token.value ? token.value : token.text;
const cleanedContent = allContains ? content.replace(/\*/g, '') : content;
Copy link
Member

Choose a reason for hiding this comment

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

This won't work for values that have a wildcard within them like *a*b*c*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants