-
-
Notifications
You must be signed in to change notification settings - Fork 803
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
Add (not) between modifiers for number criterion #1559
Add (not) between modifiers for number criterion #1559
Conversation
06540de
to
195bd05
Compare
8271be9
to
1ee1b0f
Compare
Didn't check this branch in a while. But did some testing and bug fixing and I think it's good to go now (although it might be up for discussion whether more refactoring should be done on the filter inputs, but the "between" filter is ready). |
This approach is going to break existing clients and (as you mentioned) saved filters. The client shouldn't have to remember to put the value in The approach I would prefer is that |
1ee1b0f
to
6b59789
Compare
Rebased and made the requested change. After all the refactoring I already did it was still pretty simple to convert back to an optional |
I don't think this is intuitive behaviour. If I select "between" as a filter option, I'd personally expect it to be inclusive, regardless of the rest of the filter options. Conversely, "not between" would be exclusive of the two values. |
Extract the filters from the AddFiltersDialog into custom components. This allows for further refactorring where components will be bound to criterions.
6b59789
to
426da3e
Compare
Updated so between is inclusive instead of exclusive, as requested. |
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.
Made a minor change so that existing saved filters with number criteria continue to work. Otherwise, looks good.
Whoops, obviously should have tested that during development. And sorry about the |
This adds support for between and not between filters for number and duration criterions.
The implemtation is a bit quirky on the following points:
value
is splitted in three,exact
,lower
andupper
, for respectively (not) equals, greater than and less than. In case of (not) between both will be used obviously. But this means that switching between these types "removes" the set value. So changingequals 10
toless than
(orgreater than
) means another input is shown which doesn't have a value set, and the same applies when switching between less/greater than. This most likely will also mean that saved filters will be broken. I did think about convertingvalue
to a string so a range could be specified asX-Y
but that would mean changing a lot more code, would accept more broken input (being any string which must be validated) and possibly still break saved filters.0
. Initially I made all three optional. But this would make them pointers server side which would require more trickery to get the value, require validation if the value was actually set, etc.At the moment I'm marking this PR as WIP as I still want to do some refactoring on the client side. This being splitting the
AddFilterDialog
into multiple components for the different criterion types and making a factory method / ... which will create the correct component for that criterion. This because the HierarchicalCriterion already made it a bit of a mess, and adding a specific branch for numeric, and both numeric and duration having three inputs makes it a mess.Fixes #1504
Fixes #1557