mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03: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
@ -17,6 +17,7 @@ const DAYS_OPTIONS = [{
|
||||
|
||||
export default class DashboardController extends Controller {
|
||||
@service dashboardStats;
|
||||
@service membersUtils;
|
||||
|
||||
daysOptions = DAYS_OPTIONS;
|
||||
|
||||
@ -26,7 +27,7 @@ export default class DashboardController extends Controller {
|
||||
return {};
|
||||
}
|
||||
|
||||
@action
|
||||
@action
|
||||
onDaysChange(selected) {
|
||||
this.days = selected.value;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ export default class AnalyticsController extends Controller {
|
||||
}
|
||||
|
||||
get showSources() {
|
||||
return this.feature.get('sourceAttribution') && !this.post.emailOnly;
|
||||
return this.feature.get('sourceAttribution') && !this.membersUtils.isMembersInviteOnly && !this.post.emailOnly;
|
||||
}
|
||||
|
||||
get isLoaded() {
|
||||
|
@ -73,6 +73,7 @@ export default Model.extend(ValidationEngine, {
|
||||
|
||||
membersEnabled: attr('boolean'),
|
||||
paidMembersEnabled: attr('boolean'),
|
||||
membersInviteOnly: attr('boolean'),
|
||||
|
||||
commentsEnabled: attr(), // "off", "free", "paid"
|
||||
|
||||
|
@ -14,6 +14,10 @@ export default class MembersUtilsService extends Service {
|
||||
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.
|
||||
*/
|
||||
|
@ -30,7 +30,9 @@
|
||||
<Dashboard::Charts::PaidMix />
|
||||
</article>
|
||||
</section>
|
||||
<Dashboard::Charts::Attribution />
|
||||
{{#unless this.membersUtils.isMembersInviteOnly}}
|
||||
<Dashboard::Charts::Attribution />
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if this.areNewslettersEnabled}}
|
||||
|
Loading…
Reference in New Issue
Block a user