mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Added resource
to data available to audit log
- this allows us to hydrate the post title into the UI - needs work to support non-post and missing resources
This commit is contained in:
parent
2d1d810198
commit
83702c7e86
@ -8,11 +8,15 @@ export default class ParseAuditLogEvent extends Helper {
|
||||
const action = getAction(ev);
|
||||
const actionIcon = getActionIcon(ev);
|
||||
const getActor = () => this.store.findRecord('user', ev.actor_id, {reload: false});
|
||||
const getResource = () => this.store.findRecord(ev.resource_type, ev.resource_id, {reload: false});
|
||||
|
||||
return {
|
||||
get actor() {
|
||||
return getActor();
|
||||
},
|
||||
get resource() {
|
||||
return getResource();
|
||||
},
|
||||
actionIcon,
|
||||
action,
|
||||
original: ev
|
||||
|
@ -23,18 +23,19 @@
|
||||
{{#let (parse-audit-log-event event) as |ev|}}
|
||||
<tr>
|
||||
<div class="gh-list-data">
|
||||
<div class="flex items-center">
|
||||
<div class="w-80">
|
||||
<div class="flex">
|
||||
<span class="user-list-item-figure" style={{background-image-style ev.actor.profileImageUrl}}>
|
||||
<span class="hidden">Photo of {{ev.actor.name}}</span>
|
||||
</span>
|
||||
<h3 class="ma0 pa0 gh-members-list-name">{{ev.actor.name}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="gh-list-data">
|
||||
<div class="gh-members-activity-container">
|
||||
<div class="gh-members-activity-icon">{{svg-jar ev.actionIcon}}</div>
|
||||
<div class="gh-members-activity-event">
|
||||
<span class="gh-members-activity-description">
|
||||
{{capitalize-first-letter ev.action}} <strong>{{ev.original.resource_id}}</strong>
|
||||
{{capitalize-first-letter ev.action}} <strong>{{ev.resource.title}}</strong>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user