Ghost/ghost/admin/app/templates/members-activity.hbs
Kevin Ansfield d3447315ee Excluded all email related events from feeds when newsletter is disabled
refs https://github.com/TryGhost/Team/issues/1290

- added `{{members-event-filter}}` helper that can be used to build an event filter string that will always exclude email events when the newsletter is disabled
  - useful when used in conjunction with `{{members-event-fetcher}}` because the filter is automatically adjusted for you without needing additional logic or JS backing files for components
- updated dashboard and member screen activity widgets to use `{{members-event-filter}}`
- updated members-activity screen
  - updated to use `{{members-activity-filter}}` helper in the template which allowed for removal of filter generation in the controller
  - changed `@hideMemberOnlyEvents` to `@hiddenEvents` on `<MembersActivity::EventTypeFilter>` so that we can control which events are available in the filter based on newsletter enable/disable and presence of a filtered member
2022-01-27 19:19:15 +00:00

51 lines
2.3 KiB
Handlebars

<section class="gh-canvas gh-members-activity {{if this.memberRecord "gh-members-activity-single"}}">
<GhCanvasHeader class="gh-canvas-header break tablet members-header">
<h2 class="gh-canvas-title" data-test-screen-title>
<LinkTo @route="members-activity" @query={{reset-query-params "members-activity"}} data-test-link="members-activity-back">Activity</LinkTo>
{{#if this.memberRecord}}
<span>{{svg-jar "arrow-right"}}</span>
<span class="truncate">{{this.memberRecord.name}}</span>
{{/if}}
</h2>
<div class="view-actions">
<div class="view-actions-top-row">
<MembersActivity::EventTypeFilter
@excludedEvents={{this.excludedEvents}}
@hiddenEvents={{this.hiddenEvents}}
@onChange={{this.changeExcludedEvents}} />
<MembersActivity::MemberFilter
@selected={{this.memberRecord}}
@onChange={{this.changeMember}} />
</div>
</div>
</GhCanvasHeader>
<div class="view-container">
<div class="gh-list-scrolling">
{{#if this.memberRecord}}
<LinkTo @route="member" @model={{this.memberRecord}}>
<GhMemberDetails @member={{this.memberRecord}} />
</LinkTo>
{{/if}}
{{#let (members-event-fetcher filter=(members-event-filter excludedEvents=this.fullExcludedEvents member=this.member) pageSize=50) as |eventsFetcher|}}
{{#if eventsFetcher.data}}
<MembersActivity::Table @hideMemberColumn={{if this.member true}} @events={{eventsFetcher.data}} />
{{#unless (or eventsFetcher.isLoading eventsFetcher.hasReachedEnd)}}
<GhScrollTrigger @enter={{eventsFetcher.loadNextPage}} @triggerOffset={{250}} />
{{/unless}}
{{else unless eventsFetcher.isLoading}}
<MembersActivity::NoEvents @filter={{this.filter}} />
{{/if}}
{{#if eventsFetcher.isLoading}}
<div class="relative h30"><GhLoadingSpinner /></div>
{{/if}}
{{/let}}
</div>
</div>
</section>
{{outlet}}