From 3ec417c4fe0f95694b1c4e4158128b7a452d0158 Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Tue, 29 Jan 2019 12:15:25 -0500 Subject: [PATCH] LP1642337: Reporter Boolean Filters The dialog controller doesn't appreciate getting a bare boolean as a message, so if the current item is a boolean call toString() on it before calling the egConfirmDialog. An string is also added to the reporter strings for further use, but if there are no strong feelings re: using it, it can be dumped and a '' used in its place. Signed-off-by: Jason Boyer Signed-off-by: Galen Charlton Signed-off-by: Dawn Dale --- Open-ILS/src/templates/staff/reporter/share/report_strings.tt2 | 1 + Open-ILS/web/js/ui/default/staff/reporter/template/app.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/reporter/share/report_strings.tt2 b/Open-ILS/src/templates/staff/reporter/share/report_strings.tt2 index a6d50cb16f..cc49019002 100644 --- a/Open-ILS/src/templates/staff/reporter/share/report_strings.tt2 +++ b/Open-ILS/src/templates/staff/reporter/share/report_strings.tt2 @@ -139,6 +139,7 @@ s.TEMPLATE_CONF_BETWEEN = '[% l( "Field value is between (comma separated):") %] s.TEMPLATE_CONF_NOT_IN = '[% l( "Field does not match one of list (comma separated):") %]'; s.TEMPLATE_CONF_IN = '[% l( "Field matches one of list (comma separated):") %]'; s.TEMPLATE_CONF_DEFAULT = '[% l( "Value:") %]'; +s.TEMPLATE_CONF_UNSET = '<[% l( "Unset") %]>'; s.TEMPLATE_CONF_CONFIRM_SAVE = '[% l( "Save Template?") %]'; s.TEMPLATE_CONF_SUCCESS_SAVE = '[% l( "Template was successfully saved.") %]'; s.TEMPLATE_CONF_FAIL_SAVE = '[% l( "Template save failed.") %]'; diff --git a/Open-ILS/web/js/ui/default/staff/reporter/template/app.js b/Open-ILS/web/js/ui/default/staff/reporter/template/app.js index 4aeef637f8..25ee4ccfc2 100644 --- a/Open-ILS/web/js/ui/default/staff/reporter/template/app.js +++ b/Open-ILS/web/js/ui/default/staff/reporter/template/app.js @@ -499,7 +499,7 @@ function($scope , $q , $routeParams , $location , $timeout , $window, egCore , var l = null; console.log(item); if (item.datatype == "bool") { - egConfirmDialog.open(egCore.strings.TEMPLATE_CONF_DEFAULT, item.value || '', + egConfirmDialog.open(egCore.strings.TEMPLATE_CONF_DEFAULT, (typeof item.value === "undefined" ? egCore.strings.TEMPLATE_CONF_UNSET : item.value.toString()), {ok : function() { egReportTemplateSvc.filter_fields[item.index].value = true; }, -- 2.43.2