Updated members screen to work with final stats API naming
refs 071ab9774b
- stats API uses snake_case rather than camelCase to be consistent with the rest of Ghost's APIs
This commit is contained in:
parent
c0f3d83585
commit
2e3c72891e
|
@ -54,11 +54,11 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
<h3 class="f-small ttu midgrey fw5">Signed up in the last {{this.range}} days</h3>
|
<h3 class="f-small ttu midgrey fw5">Signed up in the last {{this.range}} days</h3>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="gh-members-chart-summary-data">{{if this.fetchStatsTask.isRunning "-" this.stats.totalInRange}}</div>
|
<div class="gh-members-chart-summary-data">{{if this.fetchStatsTask.isRunning "-" this.stats.total_in_range}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-auto flex flex-column justify-center items-start pa4">
|
<div class="flex-auto flex flex-column justify-center items-start pa4">
|
||||||
<h3 class="f-small ttu midgrey fw5">Signed up today</h3>
|
<h3 class="f-small ttu midgrey fw5">Signed up today</h3>
|
||||||
<div class="gh-members-chart-summary-data">{{if this.fetchStatsTask.isRunning "-" this.stats.newToday}}</div>
|
<div class="gh-members-chart-summary-data">{{if this.fetchStatsTask.isRunning "-" this.stats.new_today}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -69,12 +69,12 @@ export default Component.extend({
|
||||||
this.set('stats', stats);
|
this.set('stats', stats);
|
||||||
|
|
||||||
this.setChartOptions({
|
this.setChartOptions({
|
||||||
rangeInDays: Object.keys(stats.totalOnDate).length
|
rangeInDays: Object.keys(stats.total_on_date).length
|
||||||
});
|
});
|
||||||
|
|
||||||
this.setChartData({
|
this.setChartData({
|
||||||
dateLabels: Object.keys(stats.totalOnDate),
|
dateLabels: Object.keys(stats.total_on_date),
|
||||||
dateValues: Object.values(stats.totalOnDate)
|
dateValues: Object.values(stats.total_on_date)
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
|
@ -47,9 +47,9 @@ export function mockMembersStats(server) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
total,
|
total,
|
||||||
totalInRange: rangeTotal,
|
total_in_range: rangeTotal,
|
||||||
totalOnDate,
|
total_on_date: totalOnDate,
|
||||||
newToday: dateCounts[moment().format('YYYY-MM-DD')]
|
new_today: dateCounts[moment().format('YYYY-MM-DD')]
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue