Open sleidig opened 8 months ago
Still struggling with the types for the comparison. $lte
and $gte
should probably be of type number. However, this leads to strange behavior if the MongoDB database fields used for comparison are of type string. Those values should probably be converted to numbers before comparison. Two tasks for that:
I think point 1 is more or less done.
Still struggling with the types for the comparison.
$lte
and$gte
should probably be of type number. However, this leads to strange behavior if the MongoDB database fields used for comparison are of type string. Those values should probably be converted to numbers before comparison. Two tasks for that:
- Discuss logic of converting e.g. "schoolclass: 11b" to number.
- Implement conversion within the filter.
We agreed on limiting the numbers filter strictly to number fields, i.e. database fields of type number
In MongoDB. We might think of inventing logic for converting between strings and numbers in the future, but this is probably specific to concrete use cases and of out scope of the number filter as such.
As a user I want to filter a list not only by an exact number value but select a min and max value to display all records with a value in between. (e.g. any exam results with points between 50 - 80)
Proposed Solutions & Alternatives Similar to the DateFilter and DateRangeFilterComponent, implement another custom filter that allows to select two values and builds a filter function accordingly.
Proposed iterations
[ ] 1. Input field with two number components (similar to the input field for the date range filter)
Two values (start and end) can be entered manually.
They can also be increased or decreased via mouse or also keyboard.
See https://github.com/dineeek/ngx-numeric-range-form-field as an example
[ ] 2. Toggle to switch between input field with two numbers and the view allowing to select discrete values
A toggle icon (or something similar) in the input field allows switching between the two different views.
Being able to select discrete values of all the available ones (with buttons "Select all" and "Clear") is already implemented and the default right now.
The input field as such is read-only and only displays the numbers selected.
[ ] 3. Free text input field for defining ranges and discrete numbers
In the view allowing to select discrete values, a free text input field is added. This text input field can be used to enter numbers like "1-5, 7, 12, 18-22, 31" (as in some printer driver dialogs for the selecting the pages to be printed).
The free text input field and the selection of discrete values are interconnected.
The main input field probably stays read-only.
[ ] 4. Slider and histogram for the input field with two number components
The slider is limited and defined by the numbers available.
The available numbers are shown in a histogram (similar to hotel rooms available at certain price ranges).