mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 16:14:25 +03:00
e93f6071cd
refs https://github.com/TryGhost/Team/issues/1932 - removes null sources from attribution chart - moves null sources count to bottom of attribution table
31 lines
827 B
JavaScript
31 lines
827 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class Recents extends Component {
|
|
@service dashboardStats;
|
|
|
|
@action
|
|
loadData() {
|
|
this.dashboardStats.loadMemberAttributionStats();
|
|
}
|
|
|
|
get sources() {
|
|
return this.dashboardStats?.memberSourceAttributionCounts || [];
|
|
}
|
|
|
|
get chartSources() {
|
|
const counts = this.dashboardStats?.memberSourceAttributionCounts || [];
|
|
// filter null source from the list
|
|
return counts.filter(source => source.source);
|
|
}
|
|
|
|
get areMembersEnabled() {
|
|
return this.dashboardStats.siteStatus?.membersEnabled;
|
|
}
|
|
|
|
get areNewslettersEnabled() {
|
|
return this.dashboardStats.siteStatus?.newslettersEnabled;
|
|
}
|
|
}
|