Ghost/ghost/admin/app/components/members-activity/table-row.hbs
Simon Backx f124d142c9 Added member attributions to activity feed (#15283)
refs https://github.com/TryGhost/Team/issues/1833
refs https://github.com/TryGhost/Team/issues/1834

We've added the attribution property to subscription and signup events when the
flag is enabled. The attributions resource is fetched by creating multiple relations
on the model, rather than polymorphic as we ran into issues with that as they can't
be nullable/optional.

The parse-member-event structure has been updated to make it easier to work with,
specifically `getObject` is only used when the event is clickable, and there is now a 
join property which makes it easier to join the action and the object.
2022-08-24 11:17:28 -04:00

52 lines
2.7 KiB
Handlebars

{{#let (parse-member-event @event @hasMultipleNewsletters) as |event|}}
<tr>
{{#unless @hideMemberColumn}}
<div class="gh-list-data">
<LinkTo @route="members-activity" @query={{hash member=event.member.id}}>
<div class="flex items-center">
<GhMemberAvatar @member={{event.member}} @containerClass="w9 h9 mr3 flex-shrink-0" />
<div class="w-80">
<h3 class="ma0 pa0 gh-members-list-name {{unless event.member.name "gh-members-name-noname"}}">{{event.subject}}</h3>
{{#if event.member.name}}
<p class="ma0 pa0 middarkgrey f8 gh-members-list-email">{{event.member.email}}</p>
{{/if}}
</div>
</div>
</LinkTo>
</div>
{{/unless}}
<div class="gh-list-data">
<div class="gh-members-activity-container">
<div class="gh-members-activity-icon">{{svg-jar event.icon}}</div>
<div class="gh-members-activity-event">
<span class="gh-members-activity-description">
{{capitalize-first-letter event.action}}
{{#if (and event.url (not (feature "memberAttribution")))}}
{{event.join}}
<a class="ghost-members-activity-object-link" href="{{event.url}}" target="_blank" rel="noopener noreferrer">{{event.object}}</a>
{{/if}}
{{#if event.email}}
<span class="{{if (feature "memberAttribution") 'hidden'}}"><GhEmailPreviewLink @data={{event.email}} /></span>
{{/if}}
{{#if event.info}}
<span class="highlight">{{event.info}}</span>
{{/if}}
</span>
</div>
</div>
</div>
{{#if (feature "memberAttribution")}}
<div class="gh-list-data gh-list-data-attribution">
{{#if event.url}}
<a class="ghost-members-activity-object-link" href="{{event.url}}" target="_blank" rel="noopener noreferrer">{{event.object}}</a>
{{else if event.email}}
<GhEmailPreviewLink @data={{event.email}} />
{{else}}
<span class="gh-list-nodata">&mdash;</span>
{{/if}}
</div>
{{/if}}
<div class="gh-list-data gh-list-data-date">{{moment-format event.timestamp "DD MMM YYYY HH:mm"}}</div>
</tr>
{{/let}}