Skip to content

Commit

Permalink
Merge branch 'maintenance-3.1.x' into 2023-snapshot-gnerate
Browse files Browse the repository at this point in the history
  • Loading branch information
alokhyland authored Dec 12, 2024
2 parents 3cee50a + 02309ee commit 807e0e0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 11 additions & 3 deletions elements/nuxeo-results/nuxeo-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,17 @@ Polymer({
},

_computeCountLabel() {
return this.resultsCount < 0
? this.i18n('results.heading.count.unknown')
: this.i18n('results.heading.count', this.resultsCount);
// Fetch the property value from web-ui-properties.xml
const isNumberFormattingEnabled =
(Nuxeo && Nuxeo.UI && Nuxeo.UI.config && Nuxeo.UI.config.numberFormattingEnabled) || false;
if (this.resultsCount < 0) {
return this.i18n('results.heading.count.unknown');
}
if (isNumberFormattingEnabled) {
const formattedCount = new Intl.NumberFormat().format(this.resultsCount);
return this.i18n('results.heading.count', formattedCount);
}
return this.i18n('results.heading.count', this.resultsCount);
},

_sortOptions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@
<!-- allowed url to redirect -->
<property name="org.nuxeo.web.ui.trustedDomains">${org.nuxeo.web.ui.trustedDomains:=}</property>

<!-- Search result numberFormatting -->
<property name="org.nuxeo.web.ui.numberFormatting.enabled">${org.nuxeo.web.ui.numberFormatting.enabled:=}</property>

</extension>
</component>

0 comments on commit 807e0e0

Please sign in to comment.