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

Filtering by a role that contains space does not return result in the Users UI #13276

Closed
MikeAlhayek opened this issue Feb 20, 2023 · 6 comments · Fixed by #14468
Closed

Filtering by a role that contains space does not return result in the Users UI #13276

MikeAlhayek opened this issue Feb 20, 2023 · 6 comments · Fixed by #14468
Labels
Milestone

Comments

@MikeAlhayek
Copy link
Member

MikeAlhayek commented Feb 20, 2023

Describe the bug

The role filter in the Users UI does not return records if you filter for a role name that contains a space.

reason that breaks is we create a filter that looks like this role:role name but it should be role:"role name"

To Reproduce

Steps to reproduce the behavior:

  1. Create a role with a name that contains a space
  2. Give at least one user access to the new role.
  3. Go to the users UI, use the filter to filter by the new role.

I am guessing this issue exists into all any filter “including contents filter” where the filterable value contains a space. We should wrap every filterable value with double quote when the value contains at least one space.

@hishamco
Copy link
Member

Is this could be done in QueryFilterResult?

@MikeAlhayek
Copy link
Member Author

I think it has to be done on the UI because space would used to separate filters.

@hishamco
Copy link
Member

How when we surround the value with double quote it works, needs to check if this part of YesSQL filter or not

@MikeAlhayek
Copy link
Member Author

When you wrap the string with double quotes, the whole string including a space is treated as a value. If you don't, a space is used to separate each filter I believe.

@hishamco
Copy link
Member

When you wrap the string with double quotes, the whole string including a space is treated as a value

Exactly, but I'm asking who evaluate that if it's YesSQL that means we could wrap the value with double quote from OC

@MikeAlhayek
Copy link
Member Author

I think in OC we use the YesSql parser IQueryParser<User> to parse the filter. Look at the https://github.com/sebastienros/yessql/blob/6681e3d7053f1d8d0fac623aa78bf7dda6ff75a6/src/YesSql.Filters.Abstractions/Services/FilterResult.cs

@sebastienros sebastienros added this to the 1.x milestone Mar 16, 2023
MikeAlhayek added a commit that referenced this issue Oct 9, 2023
@MikeAlhayek MikeAlhayek modified the milestones: 1.x, 1.8 Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants