FEATURE: differentiate total and total for period on admin table report
This commit is contained in:
parent
c2ddad696f
commit
fed86225c8
|
@ -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);
|
||||
}
|
||||
});
|
|
@ -14,10 +14,19 @@
|
|||
</tr>
|
||||
{{/each}}
|
||||
|
||||
<tr class="total-for-period">
|
||||
<td class="x-value">
|
||||
{{i18n 'admin.dashboard.reports.total_for_period'}}
|
||||
</td>
|
||||
<td>
|
||||
{{totalForPeriod}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{{#if model.total}}
|
||||
<tr class="total-for-period">
|
||||
<tr class="total">
|
||||
<td class="x-value">
|
||||
{{i18n 'admin.dashboard.reports.total_for_period'}}
|
||||
{{i18n 'admin.dashboard.reports.total'}}
|
||||
</td>
|
||||
<td>
|
||||
{{model.total}}
|
||||
|
|
|
@ -178,7 +178,8 @@ $mobile-breakpoint: 700px;
|
|||
}
|
||||
}
|
||||
|
||||
tr.total-for-period {
|
||||
tr.total-for-period,
|
||||
tr.total {
|
||||
td {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
|
|
@ -2775,6 +2775,7 @@ en:
|
|||
groups: "All groups"
|
||||
disabled: "This report is disabled"
|
||||
total_for_period: "Total for period"
|
||||
total: "Total"
|
||||
trending_search:
|
||||
more: '<a href="/admin/logs/search_logs">Search logs</a>'
|
||||
disabled: 'Trending search report is disabled. Enable <a href="/admin/site_settings/category/all_results?filter=log%20search%20queries">log search queries</a> to collect data.'
|
||||
|
|
Loading…
Reference in New Issue