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

FieldFilter should support absolute value #3860

Open
haynesjm42 opened this issue Dec 16, 2024 · 1 comment
Open

FieldFilter should support absolute value #3860

haynesjm42 opened this issue Dec 16, 2024 · 1 comment
Assignees
Labels

Comments

@haynesjm42
Copy link
Member

FieldFilter should have a flag to use the absolute value of the value when being evaluated. Currently an app needs to make a CompoundFilter with the inverse operator and value in order to accomplish this.

Unsure it we need to worry about this in FilterChooser or other components, if not a ton of work then it probably makes sense but as a starting point the API should at least allow for it.

@amcclain
Copy link
Member

Agreed this seems like an important add - thanks for filing.

Briefly wondered if it should be generalized into something like a valueTransform that could support additional tokens (e.g. case insensitive equals for strings), but that was the only other hypothetical usage I could think of at the moment. We privilege abs in our custom grid sorting, and given our domain it seems reasonable to give it a dedicated flag in field filter - don't want to over-complicate.

It's a good question how problematic it would be to release without FilterChooser / grid filters having a way to render / set this flag. Opens the possibility of a filter created programatically via another means displaying in FC, user could remove and then attempt to re-add it but would not be able to get it back to how it was. Guidance to devs could be to simply avoid this case - don't use the flag if you're also using FC - so I don't think it needs to be a blocker at all. But we would have a pretty strong desire to close that gap ... as soon as we had a chance to think through how that could actually work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants