mirror of
https://github.com/inventree/inventree-app.git
synced 2025-10-10 11:22:20 +00:00
Stock display (#379)
* Display stock quantity more prominently * Cleanup search widget * Update for stock_detail widget * More tweaks * Change bottom bar icon * Display boolean parameters appropriately * Adds ability to edit part parameters * Bump icon size a bit * Improvements to filter options - Allow filtering by "option" type - To start with, filter stock by status code * Remove debug message * Remove getTriState method - No longer needed - Remove associated unit tests * Adjust filters based on server API version * Muted colors
This commit is contained in:
@@ -79,24 +79,37 @@ class _PaginatedStockItemListState extends PaginatedSearchState<PaginatedStockIt
|
||||
};
|
||||
|
||||
@override
|
||||
Map<String, Map<String, dynamic>> get filterOptions => {
|
||||
"in_stock": {
|
||||
"default": true,
|
||||
"label": L10().filterInStock,
|
||||
"help_text": L10().filterInStockDetail,
|
||||
"tristate": true,
|
||||
},
|
||||
"cascade": {
|
||||
"default": false,
|
||||
"label": L10().includeSublocations,
|
||||
"help_text": L10().includeSublocationsDetail,
|
||||
"tristate": false,
|
||||
},
|
||||
"serialized": {
|
||||
"label": L10().filterSerialized,
|
||||
"help_text": L10().filterSerializedDetail,
|
||||
Map<String, Map<String, dynamic>> get filterOptions {
|
||||
Map<String, Map<String, dynamic>> filters = {
|
||||
"in_stock": {
|
||||
"default": true,
|
||||
"label": L10().filterInStock,
|
||||
"help_text": L10().filterInStockDetail,
|
||||
"tristate": true,
|
||||
},
|
||||
"cascade": {
|
||||
"default": false,
|
||||
"label": L10().includeSublocations,
|
||||
"help_text": L10().includeSublocationsDetail,
|
||||
"tristate": false,
|
||||
},
|
||||
"serialized": {
|
||||
"label": L10().filterSerialized,
|
||||
"help_text": L10().filterSerializedDetail,
|
||||
},
|
||||
"status": {
|
||||
"label": L10().status,
|
||||
"help_text": L10().statusCode,
|
||||
"choices": InvenTreeAPI().StockStatus.choices,
|
||||
}
|
||||
};
|
||||
|
||||
if (!InvenTreeAPI().supportsStatusLabelEndpoints) {
|
||||
filters.remove("status");
|
||||
}
|
||||
};
|
||||
|
||||
return filters;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<InvenTreePageResponse?> requestPage(int limit, int offset, Map<String, String> params) async {
|
||||
@@ -125,6 +138,7 @@ class _PaginatedStockItemListState extends PaginatedSearchState<PaginatedStockIt
|
||||
trailing: Text("${item.displayQuantity}",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
color: InvenTreeAPI().StockStatus.color(item.status),
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user