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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user