mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Bug fixes:
- prevent addition of empty filter tags
This commit is contained in:
parent
57d7d729c1
commit
d606df16f7
@ -16,6 +16,7 @@ function defaultFilters() {
|
|||||||
return {
|
return {
|
||||||
stock: "cascade=1",
|
stock: "cascade=1",
|
||||||
build: "",
|
build: "",
|
||||||
|
parts: "cascade=1",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,12 +309,15 @@ function setupFilterList(tableKey, table, target) {
|
|||||||
var tag = element.find(`#filter-tag-${tableKey}`).val();
|
var tag = element.find(`#filter-tag-${tableKey}`).val();
|
||||||
var val = element.find(`#filter-value-${tableKey}`).val();
|
var val = element.find(`#filter-value-${tableKey}`).val();
|
||||||
|
|
||||||
|
// Only add the new filter if it is not empty!
|
||||||
|
if (tag && tag.length > 0) {
|
||||||
var filters = addTableFilter(tableKey, tag, val);
|
var filters = addTableFilter(tableKey, tag, val);
|
||||||
|
|
||||||
reloadTable(table, filters);
|
reloadTable(table, filters);
|
||||||
|
|
||||||
// Run this function again
|
// Run this function again
|
||||||
setupFilterList(tableKey, table, target);
|
setupFilterList(tableKey, table, target);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addClicked = false;
|
addClicked = false;
|
||||||
|
@ -106,7 +106,7 @@ function loadPurchaseOrderTable(table, options) {
|
|||||||
|
|
||||||
var params = options.params || {};
|
var params = options.params || {};
|
||||||
|
|
||||||
var filters = loadTableFilters("build");
|
var filters = loadTableFilters("order");
|
||||||
|
|
||||||
for (var key in params) {
|
for (var key in params) {
|
||||||
filters[key] = params[key];
|
filters[key] = params[key];
|
||||||
|
@ -19,8 +19,8 @@ function getAvailableTableFilters(tableKey) {
|
|||||||
return {
|
return {
|
||||||
cascade: {
|
cascade: {
|
||||||
type: 'bool',
|
type: 'bool',
|
||||||
description: '{% trans "Include stock in sublocations" %}',
|
|
||||||
title: '{% trans "Include sublocations" %}',
|
title: '{% trans "Include sublocations" %}',
|
||||||
|
description: '{% trans "Include stock in sublocations" %}',
|
||||||
},
|
},
|
||||||
active: {
|
active: {
|
||||||
type: 'bool',
|
type: 'bool',
|
||||||
|
Loading…
Reference in New Issue
Block a user