-
- {{ entry.timestamp | customDate:'longDate' }}
- {{ entry.timestamp | date:'shortTime' }}
- @if (entry.actor) {
-
{{ entry.actor.username }}
- } @else {
-
System
- }
-
{{ entry.action | titlecase }}
+@if (loading) {
+
+} @else {
+
+ @if (entries.length === 0) {
+ -
+
+ No entries found.
-
-
-
-
-
-
- Field |
- Change |
-
-
- @for (change of entry.changes | keyvalue; track change.key) {
- @if (change.value["type"] === 'm2m') {
-
- {{ change.key | titlecase }}: |
-
- {{ change.value["operation"] | titlecase }}
- {{ change.value["objects"].join(', ') }}
- |
-
+
+ } @else {
+ @for (entry of entries; track entry.id) {
+
+
+
+ {{ entry.timestamp | customDate:'longDate' }}
+ {{ entry.timestamp | date:'shortTime' }}
+ @if (entry.actor) {
+ {{ entry.actor.username }}
+ } @else {
+ System
}
- @else if (change.key !== 'modified') {
+ {{ entry.action | titlecase }}
+
+
+
+
+
+
- {{ change.key | titlecase }}: |
- {{ change.value[1] }} |
+ Field |
+ Change |
- }
- }
-
-
-
-
- }
-
+
+ @for (change of entry.changes | keyvalue; track change.key) {
+ @if (change.value["type"] === 'm2m') {
+
+ {{ change.key | titlecase }}: |
+
+ {{ change.value["operation"] | titlecase }}
+ {{ change.value["objects"].join(', ') }}
+ |
+
+ }
+ @else {
+
+ {{ change.key | titlecase }}: |
+ {{ change.value[1] }} |
+
+ }
+ }
+
+
+
+
+ }
+ }
+
+}
diff --git a/src-ui/src/app/components/audit-log/audit-log.component.ts b/src-ui/src/app/components/audit-log/audit-log.component.ts
index 21e264ea8..ebe7a4db5 100644
--- a/src-ui/src/app/components/audit-log/audit-log.component.ts
+++ b/src-ui/src/app/components/audit-log/audit-log.component.ts
@@ -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
})
}
diff --git a/src-ui/src/app/data/auditlog-entry.ts b/src-ui/src/app/data/auditlog-entry.ts
index 5181b9fd1..dc45a6500 100644
--- a/src-ui/src/app/data/auditlog-entry.ts
+++ b/src-ui/src/app/data/auditlog-entry.ts
@@ -10,7 +10,9 @@ export interface AuditLogEntry {
id: number
timestamp: string
action: AuditLogAction
- changes: any
+ changes: {
+ [key: string]: string[]
+ }
remote_addr: string
actor?: User
}