Commit 8d41ae1
authored
fix(backend): allow negative numbers in rollup field filter input (baserow#5429)
* fix(backend): include number_negative in rollup field response (baserow#3925)
The rollup field's API response was missing the `number_negative` key
because `RollupFieldType.serializer_field_names` was built from
`BASEROW_FORMULA_TYPE_ALLOWED_FIELDS`, which does not include it (unlike
`BASEROW_FORMULA_TYPE_SERIALIZER_FIELD_NAMES` used by `LookupFieldType`).
As a result, the frontend filter input's `isValidChar` check
(`numberField.js`) silently dropped the `-` keypress, making it
impossible to type negative numbers when filtering a rollup field.
Add `number_negative` explicitly to Rollup's serializer field list and
overrides as a read-only boolean defaulting to True. Formula-backed
number fields never enforce a 'no negatives' restriction, so the default
is always correct, and `read_only=True` keeps the write API unchanged.
* fix(backend): align Rollup field similar to lookup1 parent 412763d commit 8d41ae1
3 files changed
Lines changed: 58 additions & 10 deletions
File tree
- backend
- src/baserow/contrib/database/fields
- tests/baserow/contrib/database/field
- changelog/entries/unreleased/bug
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6229 | 6229 | | |
6230 | 6230 | | |
6231 | 6231 | | |
6232 | | - | |
| 6232 | + | |
| 6233 | + | |
| 6234 | + | |
| 6235 | + | |
| 6236 | + | |
| 6237 | + | |
| 6238 | + | |
| 6239 | + | |
| 6240 | + | |
| 6241 | + | |
6233 | 6242 | | |
6234 | 6243 | | |
6235 | 6244 | | |
6236 | 6245 | | |
6237 | 6246 | | |
6238 | | - | |
| 6247 | + | |
6239 | 6248 | | |
6240 | 6249 | | |
6241 | 6250 | | |
| |||
6252 | 6261 | | |
6253 | 6262 | | |
6254 | 6263 | | |
6255 | | - | |
6256 | | - | |
6257 | | - | |
6258 | | - | |
6259 | | - | |
6260 | | - | |
6261 | | - | |
6262 | | - | |
6263 | 6264 | | |
6264 | 6265 | | |
6265 | 6266 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments