Loading indicator, filter modified events, stronger typing
This commit is contained in:
parent
e15b3ae9de
commit
2adf32c2d6
@ -1,4 +1,16 @@
|
||||
<ul class="list-group list-group-">
|
||||
@if (loading) {
|
||||
<div class="d-flex">
|
||||
<div class="spinner-border spinner-border-sm fw-normal" role="status"></div>
|
||||
</div>
|
||||
} @else {
|
||||
<ul class="list-group">
|
||||
@if (entries.length === 0) {
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-center">
|
||||
<span class="fst-italic" i18n>No entries found.</span>
|
||||
</div>
|
||||
</li>
|
||||
} @else {
|
||||
@for (entry of entries; track entry.id) {
|
||||
<li class="list-group-item">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
@ -35,7 +47,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@else if (change.key !== 'modified') {
|
||||
@else {
|
||||
<tr>
|
||||
<td>{{ change.key | titlecase }}:</td>
|
||||
<td>{{ change.value[1] }}</td>
|
||||
@ -47,4 +59,6 @@
|
||||
</div>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
|
@ -28,6 +28,11 @@ export class AuditLogComponent implements OnInit {
|
||||
.getAuditLog(this._documentId)
|
||||
.subscribe((auditLogEntries) => {
|
||||
this.entries = auditLogEntries
|
||||
.map((entry) => {
|
||||
delete entry.changes['modified']
|
||||
return entry
|
||||
})
|
||||
.filter((entry) => Object.keys(entry.changes).length > 0)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
@ -10,7 +10,9 @@ export interface AuditLogEntry {
|
||||
id: number
|
||||
timestamp: string
|
||||
action: AuditLogAction
|
||||
changes: any
|
||||
changes: {
|
||||
[key: string]: string[]
|
||||
}
|
||||
remote_addr: string
|
||||
actor?: User
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user