FIX: ensures we have data to compute average (#7685)
This commit is contained in:
parent
b79d02ff48
commit
4283281397
|
@ -31,9 +31,14 @@ export default Ember.Component.extend({
|
||||||
return reportTotal && total && twoColumns;
|
return reportTotal && total && twoColumns;
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("model.average", "totalsForSample.1.value", "twoColumns")
|
@computed("model.{average,data}", "totalsForSample.1.value", "twoColumns")
|
||||||
showAverage(reportAverage, totalValue, twoColumns) {
|
showAverage(model, sampleTotalValue, hasTwoColumns) {
|
||||||
return reportAverage && totalValue && twoColumns;
|
return (
|
||||||
|
model.average &&
|
||||||
|
model.data.length > 0 &&
|
||||||
|
sampleTotalValue &&
|
||||||
|
hasTwoColumns
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("totalsForSample.1.value", "model.data.length")
|
@computed("totalsForSample.1.value", "model.data.length")
|
||||||
|
|
Loading…
Reference in New Issue