diff --git a/ui/nuxeo-aggregation/nuxeo-checkbox-aggregation.js b/ui/nuxeo-aggregation/nuxeo-checkbox-aggregation.js index 180fc4d01..413ec35cf 100644 --- a/ui/nuxeo-aggregation/nuxeo-checkbox-aggregation.js +++ b/ui/nuxeo-aggregation/nuxeo-checkbox-aggregation.js @@ -146,9 +146,9 @@ import { AggregationBehavior } from './nuxeo-aggregation-behavior.js'; noink checked="{{item.checked}}" on-change="_computeValues" - aria-label$="[[item.label]] ([[item.docCount]])" + aria-label$="[[item.label]] ([[_formatDocCount(item.docCount)]])" > - [[item.label]] ([[item.docCount]]) + [[item.label]] ([[_formatDocCount(item.docCount)]]) @@ -179,17 +179,15 @@ import { AggregationBehavior } from './nuxeo-aggregation-behavior.js'; noink checked="{{item.checked}}" on-change="_computeValues" - aria-label$="[[item.label]] ([[item.docCount]])" + aria-label$="[[item.label]] ([[_formatDocCount(item.docCount)]])" > - [[item.label]] ([[item.docCount]]) + [[item.label]] ([[_formatDocCount(item.docCount)]]) - - [[_computeShowMoreLabel(_showAll, i18n)]] - + [[_computeShowMoreLabel(_showAll, i18n)]] @@ -257,6 +255,16 @@ import { AggregationBehavior } from './nuxeo-aggregation-behavior.js'; this.setAttribute('tabindex', 0); } + _formatDocCount(docCount) { + // Fetch the property value from web-ui-properties.xml + const isNumberFormattingEnabled = + (Nuxeo && Nuxeo.UI && Nuxeo.UI.config && Nuxeo.UI.config.numberFormattingEnabled) || false; + if (isNumberFormattingEnabled) { + return new Intl.NumberFormat().format(docCount); // Apply formatting if enabled + } + return docCount; // Return if formatting is disabled + } + _computeVisibleBuckets(buckets, visibleItems, _showAll) { if (!buckets || buckets.length === 0) { return [];