Bug fix for list view filtering (#762)

This commit is contained in:
Oliver 2026-02-02 22:46:48 +11:00 committed by GitHub
parent ae457e8235
commit e38c51e947
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 2 deletions

View file

@ -3,7 +3,8 @@
- Support display of custom status codes
- Fix default values for list sorting
- Fix bug related to null values in list filters
- Updated translations
### 0.21.2 - January 2026
---

View file

@ -61,6 +61,14 @@ abstract class PaginatedSearchState<T extends PaginatedSearchWidget>
backup,
);
if (result == "null") {
if (tristate) {
return null;
} else {
return backup;
}
}
return result;
}
@ -69,7 +77,7 @@ abstract class PaginatedSearchState<T extends PaginatedSearchWidget>
final String settings_key = "${prefix}filter_${key}";
if (value == null) {
await InvenTreeSettingsManager().removeValue(settings_key);
await InvenTreeSettingsManager().setValue(settings_key, "null");
} else {
await InvenTreeSettingsManager().setValue(settings_key, value);
}

View file

@ -123,10 +123,22 @@ class _PaginatedBomListState extends PaginatedSearchState<PaginatedBomList> {
@override
Map<String, Map<String, dynamic>> get filterOptions => {
"sub_part_active": {
"label": L10().filterActive,
"help_text": L10().filterActiveDetail,
"tristate": true,
"default": true,
},
"sub_part_assembly": {
"label": L10().filterAssembly,
"help_text": L10().filterAssemblyDetail,
},
"sub_part_virtual": {
"label": L10().filterVirtual,
"help_text": L10().filterVirtualDetail,
"tristate": true,
"default": true,
},
};
@override