LP1642337: Reporter Boolean Filters
authorJason Boyer <jboyer@library.in.gov>
Tue, 29 Jan 2019 17:15:25 +0000 (12:15 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 24 May 2019 18:42:16 +0000 (14:42 -0400)
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 <Unset> 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 <jboyer@library.in.gov>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Dawn Dale <ddale@georgialibraries.org>

Open-ILS/src/templates/staff/reporter/share/report_strings.tt2
Open-ILS/web/js/ui/default/staff/reporter/template/app.js

index a6d50cb..cc49019 100644 (file)
@@ -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.") %]';
index 4aeef63..25ee4cc 100644 (file)
@@ -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;
                     },