From 60fcedcebd815661fbb7868a5d11e964c971c5b6 Mon Sep 17 00:00:00 2001 From: Chad Baldwin Date: Wed, 23 Oct 2019 15:31:47 -0500 Subject: [PATCH] fix(grouping): adds aggregationLabel to aggregateColumn call to match public API --- packages/grouping/src/js/grouping.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/grouping/src/js/grouping.js b/packages/grouping/src/js/grouping.js index a0ff12a233..28dc300dfe 100644 --- a/packages/grouping/src/js/grouping.js +++ b/packages/grouping/src/js/grouping.js @@ -747,8 +747,9 @@ * @param {Grid} grid grid object * @param {GridColumn} column the column we want to aggregate * @param {string} aggregationType of the recognised types from uiGridGroupingConstants or one of the custom aggregations from gridOptions + * @param {string} aggregationLabel to be used instead of the default label. If empty string is passed, label is omitted */ - aggregateColumn: function( grid, column, aggregationType) { + aggregateColumn: function( grid, column, aggregationType, aggregationLabel ) { if (typeof(column.grouping) !== 'undefined' && typeof(column.grouping.groupPriority) !== 'undefined' && column.grouping.groupPriority >= 0) { service.ungroupColumn( grid, column ); } @@ -761,7 +762,12 @@ aggregationDef = uiGridTreeBaseService.nativeAggregations()[aggregationType]; } - column.treeAggregation = { type: aggregationType, label: i18nService.get().aggregation[aggregationDef.label] || aggregationDef.label }; + column.treeAggregation = { + type: aggregationType, + label: ( typeof aggregationLabel === 'string') ? + aggregationLabel : + i18nService.get().aggregation[aggregationDef.label] || aggregationDef.label + }; column.treeAggregationFn = aggregationDef.aggregationFn; column.treeAggregationFinalizerFn = aggregationDef.finalizerFn;