From 8a1ea82f1cc9d72a053e01d1a800155399f95f73 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 23 May 2019 10:32:44 -0400 Subject: [PATCH] LP#1642337: more tweaks to the patch series This patch makes the following changes: - ensures that the Boolean values get saved as 't' or 'f', as the reporter builder doesn't recognize JSON true or false in this context. - pretty-prints the current filter value in the dialog - removes a logging line To test ------- [1] Apply the patch. [2] Create or clone one or more report templates and add Boolean column filters. Change the filter value and verify that it displays the current value and lets you change it. [3] Run reports from the template(s) created in step 2 and verify that the reports produce the expected results. Signed-off-by: Galen Charlton Signed-off-by: Dawn Dale --- .../web/js/ui/default/staff/reporter/template/app.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 25ee4ccfc2..0fa3d29a99 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 @@ -497,14 +497,17 @@ function($scope , $q , $routeParams , $location , $timeout , $window, egCore , $scope.changeFilterValue = function (items) { items.forEach(function(item) { var l = null; - console.log(item); if (item.datatype == "bool") { - egConfirmDialog.open(egCore.strings.TEMPLATE_CONF_DEFAULT, (typeof item.value === "undefined" ? egCore.strings.TEMPLATE_CONF_UNSET : item.value.toString()), + var displayVal = typeof item.value === "undefined" ? egCore.strings.TEMPLATE_CONF_UNSET : + item.value === 't' ? egCore.strings.TEMPLATE_CONF_TRUE : + item.value === 'f' ? egCore.strings.TEMPLATE_CONF_FALSE : + item.value.toString(); + egConfirmDialog.open(egCore.strings.TEMPLATE_CONF_DEFAULT, displayVal, {ok : function() { - egReportTemplateSvc.filter_fields[item.index].value = true; + egReportTemplateSvc.filter_fields[item.index].value = 't'; }, cancel : function() { - egReportTemplateSvc.filter_fields[item.index].value = false; + egReportTemplateSvc.filter_fields[item.index].value = 'f'; }}, egCore.strings.TEMPLATE_CONF_TRUE, egCore.strings.TEMPLATE_CONF_FALSE ); } else { -- 2.43.2