FEATURE: displays average for 2 columns tables which support average

This commit is contained in:
Joffrey JAFFEUX
2019-06-04 11:08:26 +02:00
committed by GitHub
parent c9a34aa10c
commit b79d02ff48
3 changed files with 23 additions and 0 deletions

View File

@ -31,6 +31,16 @@ export default Ember.Component.extend({
return reportTotal && total && twoColumns;
},
@computed("model.average", "totalsForSample.1.value", "twoColumns")
showAverage(reportAverage, totalValue, twoColumns) {
return reportAverage && totalValue && twoColumns;
},
@computed("totalsForSample.1.value", "model.data.length")
averageForSample(totals, count) {
return (totals / count).toFixed(0);
},
@computed("model.data.length")
showSortingUI(dataLength) {
return dataLength >= 5;