diff --git a/src-ui/src/app/components/audit-log/audit-log.component.html b/src-ui/src/app/components/audit-log/audit-log.component.html index d52787f36..c1e50d136 100644 --- a/src-ui/src/app/components/audit-log/audit-log.component.html +++ b/src-ui/src/app/components/audit-log/audit-log.component.html @@ -1,50 +1,64 @@ - + + @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 }