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:
Rishabh 2022-09-28 17:26:38 +05:30
parent 8c225ee9d0
commit d63f4548c0
5 changed files with 11 additions and 3 deletions

View File

@ -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;
}

View File

@ -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() {

View File

@ -73,6 +73,7 @@ export default Model.extend(ValidationEngine, {
membersEnabled: attr('boolean'),
paidMembersEnabled: attr('boolean'),
membersInviteOnly: attr('boolean'),
commentsEnabled: attr(), // "off", "free", "paid"

View File

@ -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.
*/

View File

@ -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}}