0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00

🐛 Fixed dashboard member activity feed always showing current time for timestamp

no issue

- `event.timestamp` was used instead of `parsedEvent.timestamp` meaning it was undefined and `{{moment-format}}` created a new date object instead of using the real event date
This commit is contained in:
Kevin Ansfield 2022-07-06 09:21:57 +02:00
parent a7c34b7a7e
commit b98b6aa805

View file

@ -3,18 +3,18 @@
<div class="gh-dashboard-tabs">
<button type="button" class="gh-dashboard-tab {{if this.postsTabSelected 'is-selected'}}" {{on "click" this.changeTabToPosts}}>
<Dashboard::Parts::Metric
@label="Recent posts" />
@label="Recent posts" />
</button>
{{#if this.areMembersEnabled}}
<button type="button" class="gh-dashboard-tab {{if this.activityTabSelected 'is-selected'}}" {{on "click" this.changeTabToActivity}}>
<Dashboard::Parts::Metric
@label="Member activity" />
</button>
@label="Member activity" />
</button>
{{/if}}
</div>
{{#if this.postsTabSelected}}
<div class="gh-dashboard-recents-posts gh-dashboard-list {{unless this.areNewslettersEnabled 'is-single'}}">
<div class="gh-dashboard-list-header">
<div class="gh-dashboard-list-header">
<div class="gh-dashboard-list-title">Title</div>
{{#if this.areNewslettersEnabled}}
<div class="gh-dashboard-list-title">Sends</div>
@ -40,8 +40,8 @@
</span>
</div>
<div class="gh-dashboard-list-item-sub">
<span class="gh-dashboard-rate-bar">
{{#if post.email}}
<span class="gh-dashboard-rate-bar">
{{#if post.email}}
<span class="gh-dashboard-metric-minivalue">{{post.email.openRate}}%</span>
<span class="gh-dashboard-rate-amount"><span style={{html-safe (concat "width: " post.email.openRate "%;")}}/></span>
{{else}}
@ -67,13 +67,13 @@
</div>
{{else}}
<div class="gh-dashboard-recents-activity gh-dashboard-list" data-test-dashboard-member-activity>
<div class="gh-dashboard-list-header">
<div class="gh-dashboard-list-header">
<div class="gh-dashboard-list-title">Member</div>
<div class="gh-dashboard-list-title">Event</div>
<div class="gh-dashboard-list-title">Time</div>
</div>
<div class="gh-dashboard-list-body">
{{#let (members-event-fetcher filter=(members-event-filter excludeEmailEvents=true) pageSize=5) as |eventsFetcher|}}
{{#let (members-event-fetcher filter=(members-event-filter excludeEmailEvents=true) pageSize=5) as |eventsFetcher|}}
{{#if eventsFetcher.isError}}
<div class="gh-dashboard-list-error">
<p>There was an error loading events</p>
@ -82,7 +82,7 @@
{{/if}}
</div>
{{/if}}
{{#if eventsFetcher.isLoading}}
<div class="gh-dashboard-list-loading">
<div class="gh-loading-spinner"></div>
@ -91,7 +91,7 @@
{{#if eventsFetcher.data}}
{{#each eventsFetcher.data as |event|}}
{{#let (parse-member-event event eventsFetcher.hasMultipleNewsletters) as |parsedEvent|}}
<LinkTo class="gh-dashboard-list-item member-details" @route="member" @model="{{parsedEvent.memberId}}" data-test-dashboard-member-activity-item>
<LinkTo class="gh-dashboard-list-item member-details" @route="member" @model="{{parsedEvent.memberId}}" data-test-dashboard-member-activity-item>
<div class="gh-dashboard-list-item-sub">
<GhMemberAvatar @member={{parsedEvent.member}} @containerClass="w8 h8 mr3 flex-shrink-0" />
<span class="gh-dashboard-list-text">{{parsedEvent.subject}}</span>
@ -105,7 +105,7 @@
</span>
</div>
<div class="gh-dashboard-list-item-sub">
<span class="gh-dashboard-list-subtext">{{moment-format event.timestamp "D MMM YYYY HH:mm"}}</span>
<span class="gh-dashboard-list-subtext">{{moment-format parsedEvent.timestamp "D MMM YYYY HH:mm"}}</span>
</div>
</LinkTo>
{{/let}}