mirror of
https://github.com/inventree/inventree-app.git
synced 2026-01-22 10:49:41 +00:00
List filtering fix (#746)
* Bug fix for API forms without URL - Ensure submitted data is returned * Translate search fields * Update release notes * Remove debug message * dart format
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
---
|
||||
|
||||
- Fixes bug which launched camera twice when uploading an attachment
|
||||
- Fixed bug related to list sorting and filtering
|
||||
|
||||
### 0.21.1 - November 2025
|
||||
---
|
||||
|
||||
@@ -1011,17 +1011,16 @@ Future<void> launchApiForm(
|
||||
APIFormWidgetState? formHandler,
|
||||
IconData icon = TablerIcons.device_floppy,
|
||||
}) async {
|
||||
showLoadingOverlay();
|
||||
|
||||
// List of fields defined by the server
|
||||
Map<String, dynamic> serverFields = {};
|
||||
|
||||
if (url.isNotEmpty) {
|
||||
showLoadingOverlay();
|
||||
var options = await InvenTreeAPI().options(url);
|
||||
hideLoadingOverlay();
|
||||
|
||||
// Invalid response from server
|
||||
if (!options.isValid()) {
|
||||
hideLoadingOverlay();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1030,8 +1029,6 @@ Future<void> launchApiForm(
|
||||
if (serverFields.isEmpty) {
|
||||
// User does not have permission to perform this action
|
||||
showSnackIcon(L10().response403, icon: TablerIcons.user_x);
|
||||
|
||||
hideLoadingOverlay();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1075,6 +1072,8 @@ Future<void> launchApiForm(
|
||||
formFields.add(field);
|
||||
}
|
||||
|
||||
showLoadingOverlay();
|
||||
|
||||
// Grab existing data for each form field
|
||||
for (var field in formFields) {
|
||||
await field.loadInitialData();
|
||||
@@ -1430,7 +1429,7 @@ class APIFormWidgetState extends State<APIFormWidget> {
|
||||
// Perhaps we just want to process the data?
|
||||
if (widget.url.isEmpty) {
|
||||
// Hide the form
|
||||
handleSuccess(data, {});
|
||||
handleSuccess(data, data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1298,6 +1298,18 @@
|
||||
"searchLocation": "Search for location",
|
||||
"@searchLocation": {},
|
||||
|
||||
"searchOrderingField": "Ordering Field",
|
||||
"@searchOrderingField": {},
|
||||
|
||||
"searchOrderingDirection": "Ordering Direction",
|
||||
"@searchOrderingDirection": {},
|
||||
|
||||
"searchOrderingAscending": "Ascending",
|
||||
"@searchOrderingAscending": {},
|
||||
|
||||
"searchOrderingDescending": "Descending",
|
||||
"@searchOrderingDescending": {},
|
||||
|
||||
"searchParts": "Search Parts",
|
||||
"@searchParts": {},
|
||||
|
||||
|
||||
@@ -152,19 +152,19 @@ abstract class PaginatedSearchState<T extends PaginatedSearchWidget>
|
||||
Map<String, dynamic> fields = {
|
||||
"ordering_field": {
|
||||
"type": "choice",
|
||||
"label": "Ordering Field",
|
||||
"label": L10().searchOrderingField,
|
||||
"required": true,
|
||||
"choices": _opts,
|
||||
"value": _field,
|
||||
},
|
||||
"ordering_order": {
|
||||
"type": "choice",
|
||||
"label": "Ordering Direction",
|
||||
"label": L10().searchOrderingDirection,
|
||||
"required": true,
|
||||
"value": _order,
|
||||
"choices": [
|
||||
{"value": "+", "display_name": "Ascending"},
|
||||
{"value": "-", "display_name": "Descending"},
|
||||
{"value": "+", "display_name": L10().searchOrderingAscending},
|
||||
{"value": "-", "display_name": L10().searchOrderingDescending},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user