Skip to content

Commit

Permalink
WEBUI-1590:Allow option to configure integer display formatting 3.1.x (
Browse files Browse the repository at this point in the history
…#2384)

* WEBUI-1590:Allow option to configure integer display formatting

* WEBUI-1590:Allow option to configure integer display formatting

* WEBUI-1590:Allow option to configure integer display formatting
  • Loading branch information
yashgupta-hyland authored Dec 4, 2024
1 parent cfca205 commit 02309ee
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 02309ee

Please sign in to comment.