mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Removed attribution sources from UI if site is invite-only
refs https://github.com/TryGhost/Team/issues/1986 - removes attribution section from dashboard and post analytics if site is invite only
This commit is contained in:
parent
8c225ee9d0
commit
d63f4548c0
5 changed files with 11 additions and 3 deletions
|
@ -17,6 +17,7 @@ const DAYS_OPTIONS = [{
|
||||||
|
|
||||||
export default class DashboardController extends Controller {
|
export default class DashboardController extends Controller {
|
||||||
@service dashboardStats;
|
@service dashboardStats;
|
||||||
|
@service membersUtils;
|
||||||
|
|
||||||
daysOptions = DAYS_OPTIONS;
|
daysOptions = DAYS_OPTIONS;
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@ export default class DashboardController extends Controller {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
onDaysChange(selected) {
|
onDaysChange(selected) {
|
||||||
this.days = selected.value;
|
this.days = selected.value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ export default class AnalyticsController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
get showSources() {
|
get showSources() {
|
||||||
return this.feature.get('sourceAttribution') && !this.post.emailOnly;
|
return this.feature.get('sourceAttribution') && !this.membersUtils.isMembersInviteOnly && !this.post.emailOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
get isLoaded() {
|
get isLoaded() {
|
||||||
|
|
|
@ -73,6 +73,7 @@ export default Model.extend(ValidationEngine, {
|
||||||
|
|
||||||
membersEnabled: attr('boolean'),
|
membersEnabled: attr('boolean'),
|
||||||
paidMembersEnabled: attr('boolean'),
|
paidMembersEnabled: attr('boolean'),
|
||||||
|
membersInviteOnly: attr('boolean'),
|
||||||
|
|
||||||
commentsEnabled: attr(), // "off", "free", "paid"
|
commentsEnabled: attr(), // "off", "free", "paid"
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,10 @@ export default class MembersUtilsService extends Service {
|
||||||
return this.settings.get('paidMembersEnabled');
|
return this.settings.get('paidMembersEnabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isMembersInviteOnly() {
|
||||||
|
return this.settings.get('membersInviteOnly');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note: always use paidMembersEnabled! Only use this getter for the Stripe Connection UI.
|
* Note: always use paidMembersEnabled! Only use this getter for the Stripe Connection UI.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
<Dashboard::Charts::PaidMix />
|
<Dashboard::Charts::PaidMix />
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
<Dashboard::Charts::Attribution />
|
{{#unless this.membersUtils.isMembersInviteOnly}}
|
||||||
|
<Dashboard::Charts::Attribution />
|
||||||
|
{{/unless}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if this.areNewslettersEnabled}}
|
{{#if this.areNewslettersEnabled}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue