From a680c6e385137344c606a19aae7a6d602f6fac5c Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 9 Apr 2024 23:03:42 -0700 Subject: [PATCH] That's better, make it a simple list --- .../audit-log/audit-log.component.html | 75 ++++++++----------- .../audit-log/audit-log.component.ts | 6 +- 2 files changed, 34 insertions(+), 47 deletions(-) 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 e6789efc5..497049aa4 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 @@ -14,53 +14,38 @@ @for (entry of entries; track entry.id) {
  • -
    - -
    - {{ entry.timestamp | customDate:'longDate' }} {{ entry.timestamp | date:'shortTime' }} -
    -
    - {{ entry.timestamp | customDate:'relative' }} - @if (entry.actor) { - {{ entry.actor.username }} - } @else { - System - } - {{ entry.action | titlecase }} -
    - + +
    + {{ entry.timestamp | customDate:'longDate' }} {{ entry.timestamp | date:'shortTime' }} +
    +
    + {{ entry.timestamp | customDate:'relative' }} + @if (entry.actor) { + {{ entry.actor.username }} + } @else { + System + } + {{ entry.action | titlecase }}
    -
    - - - - - - - - @for (change of entry.changes | keyvalue; track change.key) { - @if (change.value["type"] === 'm2m') { - - - - - } - @else { - - - - - } + @if (entry.action === AuditLogAction.Update) { + -
    FieldChange
    {{ change.key | titlecase }}: - {{ change.value["operation"] | titlecase }} - {{ change.value["objects"].join(', ') }} -
    {{ change.key | titlecase }}:{{ change.value[1] }}
    -
    + @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 ebe7a4db5..023b17322 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 @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core' -import { AuditLogEntry } from 'src/app/data/auditlog-entry' +import { AuditLogAction, AuditLogEntry } from 'src/app/data/auditlog-entry' import { DocumentService } from 'src/app/services/rest/document.service' @Component({ @@ -8,7 +8,9 @@ import { DocumentService } from 'src/app/services/rest/document.service' styleUrl: './audit-log.component.scss', }) export class AuditLogComponent implements OnInit { - _documentId: number + public AuditLogAction = AuditLogAction + + private _documentId: number @Input() set documentId(id: number) { this._documentId = id