diff --git a/app/assets/javascripts/admin/components/admin-table-report.js.es6 b/app/assets/javascripts/admin/components/admin-table-report.js.es6 new file mode 100644 index 00000000000..aa7efce66af --- /dev/null +++ b/app/assets/javascripts/admin/components/admin-table-report.js.es6 @@ -0,0 +1,9 @@ +import computed from "ember-addons/ember-computed-decorators"; + +export default Ember.Component.extend({ + @computed("model.sortedData") + totalForPeriod(data) { + const values = data.map(d => d.y); + return values.reduce((sum, v) => sum + v); + } +}); diff --git a/app/assets/javascripts/admin/templates/components/admin-table-report.hbs b/app/assets/javascripts/admin/templates/components/admin-table-report.hbs index 442140780a8..50dfc7526da 100644 --- a/app/assets/javascripts/admin/templates/components/admin-table-report.hbs +++ b/app/assets/javascripts/admin/templates/components/admin-table-report.hbs @@ -14,10 +14,19 @@ {{/each}} + + + {{i18n 'admin.dashboard.reports.total_for_period'}} + + + {{totalForPeriod}} + + + {{#if model.total}} - + - {{i18n 'admin.dashboard.reports.total_for_period'}} + {{i18n 'admin.dashboard.reports.total'}} {{model.total}} diff --git a/app/assets/stylesheets/common/admin/admin_base.scss b/app/assets/stylesheets/common/admin/admin_base.scss index aab60db5043..1b8233ce8bd 100644 --- a/app/assets/stylesheets/common/admin/admin_base.scss +++ b/app/assets/stylesheets/common/admin/admin_base.scss @@ -178,7 +178,8 @@ $mobile-breakpoint: 700px; } } - tr.total-for-period { + tr.total-for-period, + tr.total { td { font-weight: 700; } diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 30e3badd2ac..427f3937b63 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2775,6 +2775,7 @@ en: groups: "All groups" disabled: "This report is disabled" total_for_period: "Total for period" + total: "Total" trending_search: more: 'Search logs' disabled: 'Trending search report is disabled. Enable log search queries to collect data.'