mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-02-04 07:23:18 +00:00
Bug fix for list view filtering (#762)
This commit is contained in:
parent
ae457e8235
commit
e38c51e947
3 changed files with 23 additions and 2 deletions
|
|
@ -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
|
||||
---
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue