From 03e105dd954bbac6c63af97c8f887550953886c3 Mon Sep 17 00:00:00 2001 From: simonkuehling Date: Tue, 28 Feb 2023 21:25:12 +0100 Subject: [PATCH] Fix some regressions in new "Responsible" filter for build orders (#4430) * fix responsible user/group icons with translations * fix display of active filters after recent changes --- InvenTree/templates/js/translated/build.js | 2 +- InvenTree/templates/js/translated/filters.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index 175781c67c..c476301605 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -2702,7 +2702,7 @@ function loadBuildTable(table, options) { var html = row.responsible_detail.name; - if (row.responsible_detail.label == 'group') { + if (row.responsible_detail.label == '{% trans "group" %}') { html += ``; } else { html += ``; diff --git a/InvenTree/templates/js/translated/filters.js b/InvenTree/templates/js/translated/filters.js index 7a2d8687a2..5038391ffe 100644 --- a/InvenTree/templates/js/translated/filters.js +++ b/InvenTree/templates/js/translated/filters.js @@ -455,6 +455,12 @@ function getFilterOptionValue(tableKey, filterKey, valueKey) { // Iterate through a list of options if ('options' in filter) { + // options can be an object or a function, in which case we need to run + // this callback first + if (filter.options instanceof Function) { + filter.options = filter.options(); + } + for (var key in filter.options) { if (key == valueKey) {