2022-09-13 11:38:14 +03:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import {action} from '@ember/object';
|
|
|
|
import {inject as service} from '@ember/service';
|
2022-09-26 20:59:30 +03:00
|
|
|
import {tracked} from '@glimmer/tracking';
|
2022-09-13 11:38:14 +03:00
|
|
|
|
|
|
|
export default class Recents extends Component {
|
|
|
|
@service dashboardStats;
|
2022-09-26 20:59:30 +03:00
|
|
|
@tracked sortColumn = 'signups';
|
|
|
|
|
|
|
|
@action
|
|
|
|
setSortColumn(column) {
|
|
|
|
this.sortColumn = column;
|
|
|
|
}
|
2022-09-13 11:38:14 +03:00
|
|
|
|
|
|
|
@action
|
|
|
|
loadData() {
|
|
|
|
this.dashboardStats.loadMemberAttributionStats();
|
|
|
|
}
|
|
|
|
|
|
|
|
get sources() {
|
2022-09-19 11:48:24 +03:00
|
|
|
return this.dashboardStats?.memberSourceAttributionCounts || [];
|
2022-09-13 11:38:14 +03:00
|
|
|
}
|
|
|
|
|
2022-09-22 18:34:46 +03:00
|
|
|
get chartSources() {
|
|
|
|
const counts = this.dashboardStats?.memberSourceAttributionCounts || [];
|
|
|
|
// filter null source from the list
|
|
|
|
return counts.filter(source => source.source);
|
|
|
|
}
|
|
|
|
|
2022-09-13 11:38:14 +03:00
|
|
|
get areMembersEnabled() {
|
|
|
|
return this.dashboardStats.siteStatus?.membersEnabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
get areNewslettersEnabled() {
|
|
|
|
return this.dashboardStats.siteStatus?.newslettersEnabled;
|
|
|
|
}
|
|
|
|
}
|