2
0
mirror of https://github.com/inventree/inventree-app.git synced 2026-03-11 12:45:00 +00:00

Fix bool fields (#778)

* Improved UX for boolean fields

- Use segmented button
- Allow tristate
- Improved filtering options

* Bug fix for null filter values

* Prevent null filters from being sent to the server

* Update release notes
This commit is contained in:
Oliver
2026-02-27 13:55:08 +11:00
committed by GitHub
parent 286daf2567
commit 04f98559fc
4 changed files with 97 additions and 19 deletions

View File

@@ -92,9 +92,10 @@ abstract class PaginatedSearchState<T extends PaginatedSearchWidget>
// Skip null values
if (value == null) {
continue;
f[k] = "null";
} else {
f[k] = value.toString();
}
f[k] = value.toString();
}
return f;
@@ -341,7 +342,16 @@ abstract class PaginatedSearchState<T extends PaginatedSearchWidget>
Map<String, String> f = await constructFilters();
if (f.isNotEmpty) {
params.addAll(f);
for (String k in f.keys) {
// Remove any existing filter keys
dynamic value = f[k];
if (value == null || value == "null") {
params.remove(k);
} else {
params[k] = value.toString();
}
}
}
final page = await requestPage(_pageSize, pageKey, params);