From 8a6aab69e6782ce44fbc90b0d85b052994504119 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 13 Aug 2020 13:05:19 -0400 Subject: [PATCH] LP#1858114: Present proper input widget for aggregate parameters There's currently logic to override the filter widget for all columns that have a selector defined, such as the ID column of many tables. When we transform the column with an aggregate transform, though, we don't want to pick a particular selector-labeled value. While I can imagine using a min or max aggregate to get a representative value for a group, when other dependent filters would make the value stable or where the value in particular doesn't matter but isn't needed in a count (say), all the other aggregate transforms that are currently supported are specifically numeric (sum, average, count, and count_distinct). Because of that, and the most likely use case of matching a count to "0" or "1", we should only present the "remote object widget" for non-aggregates, and just use the baseline text string input here. Signed-off-by: Mike Rylander Signed-off-by: Angela Kilsdonk Signed-off-by: Jason Boyer --- Open-ILS/web/reports/oils_rpt_param_editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/reports/oils_rpt_param_editor.js b/Open-ILS/web/reports/oils_rpt_param_editor.js index e44a02de6c..003db230db 100644 --- a/Open-ILS/web/reports/oils_rpt_param_editor.js +++ b/Open-ILS/web/reports/oils_rpt_param_editor.js @@ -174,7 +174,8 @@ oilsRptParamEditor.prototype.buildWidget = function(param, node, fromTemplate) { break; } - if( field.selector ) { + // aggregates like count (etc) on a pkey should not use the remote widget + if( !param.column.aggregate && field.selector ) { atomicWidget = oilsRptRemoteWidget; widgetArgs.class = cls; widgetArgs.field = field; -- 2.11.0