0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-15 03:01:37 -05:00

Added mock UI table for member source data

refs https://github.com/TryGhost/Team/issues/1891

- uses mock stats data to show UI for which sources are driving member signups/conversions
This commit is contained in:
Rishabh 2022-09-13 14:08:14 +05:30 committed by Rishabh Garg
parent e151791fe2
commit 890279a95b
3 changed files with 70 additions and 1 deletions

View file

@ -0,0 +1,42 @@
<section class="gh-dashboard-section gh-dashboard-recents">
<article class="gh-dashboard-box" {{did-insert this.loadData}}>
<div class="gh-dashboard-recents-posts gh-dashboard-list">
<div class="gh-dashboard-list-header">
<div class="gh-dashboard-list-title">Sources</div>
<div class="gh-dashboard-list-title">Free Signups</div>
<div class="gh-dashboard-list-title">Paid Conversions</div>
</div>
<div class="gh-dashboard-list-body">
{{#each this.sources as |sourceData|}}
<div class="gh-dashboard-list-item">
<div class="gh-dashboard-list-item-sub">
<span class="gh-dashboard-list-text">{{sourceData.source}}</span>
</div>
<div class="gh-dashboard-list-item-sub">
<span class="gh-dashboard-metric-minivalue">
{{#if sourceData.freeSignups}}
{{format-number sourceData.freeSignups}}
{{else}}
&mdash;
{{/if}}
</span>
</div>
<div class="gh-dashboard-list-item-sub">
<span class="gh-dashboard-metric-minivalue">
{{#if sourceData.paidConversions}}
{{format-number sourceData.paidConversions}}
{{else}}
&mdash;
{{/if}}
</span>
</div>
</div>
{{else}}
<div class="gh-dashboard-list-empty">
<p>No sources.</p>
</div>
{{/each}}
</div>
</div>
</article>
</section>

View file

@ -0,0 +1,25 @@
import Component from '@glimmer/component';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
// import {tracked} from '@glimmer/tracking';
export default class Recents extends Component {
@service dashboardStats;
@action
loadData() {
this.dashboardStats.loadMemberAttributionStats();
}
get sources() {
return this.dashboardStats?.membersAttributionSources90d || [];
}
get areMembersEnabled() {
return this.dashboardStats.siteStatus?.membersEnabled;
}
get areNewslettersEnabled() {
return this.dashboardStats.siteStatus?.newslettersEnabled;
}
}

View file

@ -18,7 +18,9 @@
<div class="gh-dashboard-group {{if this.isTotalMembersZero 'is-zero'}}">
<Dashboard::Charts::Anchor />
{{#if (feature 'sourceAttribution')}}
<Dashboard::Charts::Attribution />
{{/if}}
{{#if this.areNewslettersEnabled}}
<Dashboard::Charts::Engagement />
{{/if}}