From 9d3d46bf332d0b6180a316472992ee579e18d83e Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 27 Dec 2024 17:49:29 -0500 Subject: [PATCH] feat(frontend): show "query sensitive data" in audit log --- Foxnouns.Frontend/src/lib/api/models/moderation.ts | 1 + .../src/lib/components/admin/AuditLogEntryCard.svelte | 6 ++---- Foxnouns.Frontend/src/routes/admin/+page.svelte | 4 ++++ .../src/routes/admin/audit-log/+page.svelte | 10 ++++++++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Foxnouns.Frontend/src/lib/api/models/moderation.ts b/Foxnouns.Frontend/src/lib/api/models/moderation.ts index 5fbf9fa..47aa3c8 100644 --- a/Foxnouns.Frontend/src/lib/api/models/moderation.ts +++ b/Foxnouns.Frontend/src/lib/api/models/moderation.ts @@ -58,6 +58,7 @@ export enum AuditLogEntryType { WarnUser = "WARN_USER", WarnUserAndClearProfile = "WARN_USER_AND_CLEAR_PROFILE", SuspendUser = "SUSPEND_USER", + QuerySensitiveUserData = "QUERY_SENSITIVE_USER_DATA", } export type PartialReport = { diff --git a/Foxnouns.Frontend/src/lib/components/admin/AuditLogEntryCard.svelte b/Foxnouns.Frontend/src/lib/components/admin/AuditLogEntryCard.svelte index 45d1ada..02872d4 100644 --- a/Foxnouns.Frontend/src/lib/components/admin/AuditLogEntryCard.svelte +++ b/Foxnouns.Frontend/src/lib/components/admin/AuditLogEntryCard.svelte @@ -12,10 +12,6 @@ let date = $derived(idTimestamp(entry.id).toLocaleString(DateTime.DATETIME_MED)); - - Audit log - -
@@ -26,6 +22,8 @@ warned {:else if entry.type === "SUSPEND_USER"} suspended + {:else if entry.type === "QUERY_SENSITIVE_USER_DATA"} + looked up sensitive data of {:else} (unknown action {entry.type}) {/if} diff --git a/Foxnouns.Frontend/src/routes/admin/+page.svelte b/Foxnouns.Frontend/src/routes/admin/+page.svelte index 79df014..bf0c8f7 100644 --- a/Foxnouns.Frontend/src/routes/admin/+page.svelte +++ b/Foxnouns.Frontend/src/routes/admin/+page.svelte @@ -6,6 +6,10 @@ let { data }: Props = $props(); + + Admin dashboard • pronouns.cc + +

Dashboard

diff --git a/Foxnouns.Frontend/src/routes/admin/audit-log/+page.svelte b/Foxnouns.Frontend/src/routes/admin/audit-log/+page.svelte index a0e182d..0c1cf72 100644 --- a/Foxnouns.Frontend/src/routes/admin/audit-log/+page.svelte +++ b/Foxnouns.Frontend/src/routes/admin/audit-log/+page.svelte @@ -45,6 +45,10 @@ }; + + Audit log • pronouns.cc + +

Audit log

@@ -68,6 +72,12 @@ Suspend user + + Query sensitive user data + {#if data.type} Remove filter {/if}