Removed "members" from mocked stats API payload property names

no issue

- removes duplication from property names as the "members" part is implicit from the resource name
This commit is contained in:
Kevin Ansfield 2020-05-25 10:35:39 +01:00
parent 8c19ea9cf9
commit fb1c048f24
3 changed files with 10 additions and 11 deletions

View File

@ -46,7 +46,7 @@
<div class="flex flex-column justify-between gh-members-chart-summary bg-white br3 shadow-1 bg-grouped-table"> <div class="flex flex-column justify-between gh-members-chart-summary bg-white br3 shadow-1 bg-grouped-table">
<div class="flex-auto flex flex-column justify-center items-start pa4 bb b--whitegrey"> <div class="flex-auto flex flex-column justify-center items-start pa4 bb b--whitegrey">
<h3 class="f-small ttu midgrey fw5">Total Members</h3> <h3 class="f-small ttu midgrey fw5">Total Members</h3>
<div class="gh-members-chart-summary-data">{{if this.fetchStatsTask.isRunning "-" this.stats.totalMembers}}</div> <div class="gh-members-chart-summary-data">{{if this.fetchStatsTask.isRunning "-" this.stats.total}}</div>
</div> </div>
<div class="flex-auto flex flex-column justify-center items-start pa4 bb b--whitegrey"> <div class="flex-auto flex flex-column justify-center items-start pa4 bb b--whitegrey">
{{#if (eq this.range "all-time")}} {{#if (eq this.range "all-time")}}
@ -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.totalMembersInRange}}</div> <div class="gh-members-chart-summary-data">{{if this.fetchStatsTask.isRunning "-" this.stats.totalInRange}}</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.newMembersToday}}</div> <div class="gh-members-chart-summary-data">{{if this.fetchStatsTask.isRunning "-" this.stats.newToday}}</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,6 +1,5 @@
/* global Chart */ /* global Chart */
import Component from '@ember/component'; import Component from '@ember/component';
import moment from 'moment';
import {action} from '@ember/object'; import {action} from '@ember/object';
import {computed, get} from '@ember/object'; import {computed, get} from '@ember/object';
import {inject as service} from '@ember/service'; import {inject as service} from '@ember/service';
@ -70,12 +69,12 @@ export default Component.extend({
this.set('stats', stats); this.set('stats', stats);
this.setChartOptions({ this.setChartOptions({
rangeInDays: Object.keys(stats.totalMembersOnDate).length rangeInDays: Object.keys(stats.totalOnDate).length
}); });
this.setChartData({ this.setChartData({
dateLabels: Object.keys(stats.totalMembersOnDate), dateLabels: Object.keys(stats.totalOnDate),
dateValues: Object.values(stats.totalMembersOnDate) dateValues: Object.values(stats.totalOnDate)
}); });
}), }),

View File

@ -46,10 +46,10 @@ export function mockMembersStats(server) {
} }
return { return {
totalMembers: total, total,
totalMembersInRange: rangeTotal, totalInRange: rangeTotal,
totalMembersOnDate: totalOnDate, totalOnDate,
newMembersToday: dateCounts[moment().format('YYYY-MM-DD')] newToday: dateCounts[moment().format('YYYY-MM-DD')]
}; };
}); });
} }