Skip to content

Commit

Permalink
ELEMENTS-1771:Allow option to configure Integer display Formatting nu…
Browse files Browse the repository at this point in the history
…xeo-checkbox-aggregation.js
  • Loading branch information
yashgupta-hyland committed Dec 3, 2024
1 parent 30d24f8 commit 1747dc9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ui/nuxeo-aggregation/nuxeo-checkbox-aggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,11 @@ import { AggregationBehavior } from './nuxeo-aggregation-behavior.js';

_formatDocCount(docCount) {
// Fetch the property value from web-ui-properties.xml
const isNumberFormattingEnabled =
Nuxeo && Nuxeo.UI && Nuxeo.UI.config && Nuxeo.UI.config.numberFormattingEnabled !== undefined
? Nuxeo.UI.config.numberFormattingEnabled
: false; // Default to false if the property is not set

const isNumberFormattingEnabled = Nuxeo?.UI?.config?.numberFormattingEnabled || false;
if (isNumberFormattingEnabled) {
return new Intl.NumberFormat().format(docCount); // Apply formatting if enabled
}
return docCount.toString(); // Return if formatting is disabled
return docCount; // Return if formatting is disabled
}

_computeVisibleBuckets(buckets, visibleItems, _showAll) {
Expand Down

0 comments on commit 1747dc9

Please sign in to comment.