mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
92ece7b373
refs https://github.com/TryGhost/Team/issues/1277 - renamed `<GhActivityTimeline>` to `<GhMemberActivityEventParser>` and modified so that it yields parsed events rather than directly renders them - makes the component re-usable as it can be used to decorate raw events ready for use in context-specific templates - switches to using a getter to yield the parsed events so that they will update automatically when the `@events` argument changes - updated `<Dashboard::LatestMemberActivity>` to use `<GhMemberActivityEventParser>` and keep the member activity box output local to itself - added integration tests for `<Dashboard::LatestMemberActivity>` - added Mirage setup for member activity event models/serializers/route
49 lines
2.5 KiB
Handlebars
49 lines
2.5 KiB
Handlebars
{{#if this.shouldDisplay}}
|
|
<div class="gh-dashboard-box grey activity-feed" data-test-dashboard-member-activity>
|
|
<h4 class="gh-dashboard-header">Activity feed</h4>
|
|
<div class="content">
|
|
{{#if this.eventsLoading}}
|
|
Loading...
|
|
{{else}}
|
|
{{#if this.eventsError}}
|
|
<p class="error">
|
|
There was an error loading events
|
|
<code>{{this.eventsError.message}}</code>
|
|
</p>
|
|
{{else}}
|
|
<GhMemberActivityEventParser @events={{this.eventsData}} as |parsedEvents|>
|
|
<div class="gh-event-timeline">
|
|
{{#if parsedEvents}}
|
|
<ul class="gh-dashboard-activity-feed">
|
|
{{#each parsedEvents as |event|}}
|
|
<li data-test-dashboard-member-activity-item>
|
|
<LinkTo class="member-details" @route="member" @model="{{event.member_id}}">
|
|
<div class="activity">
|
|
<div>
|
|
<span class="member">{{event.subject}}</span> {{event.action}} {{event.object}} <span class="highlight">{{event.info}}</span>
|
|
</div>
|
|
</div>
|
|
</LinkTo>
|
|
<span class="time">{{event.timestamp}}</span>
|
|
</li>
|
|
{{/each}}
|
|
</ul>
|
|
{{else}}
|
|
<div class="gh-no-data-list" data-test-no-member-activities>
|
|
{{svg-jar "no-data-list"}}
|
|
<span>No member activity available.</span>
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
</GhMemberActivityEventParser>
|
|
|
|
{{#if (feature "membersActivityFeed")}}
|
|
<div class="gh-dashboard-top-members-footer">
|
|
<LinkTo @route="members-activity">See all activity {{svg-jar "arrow-right"}}</LinkTo>
|
|
</div>
|
|
{{/if}}
|
|
{{/if}}
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
{{/if}} |