From a4200186e22388fa8d79e7e0a2142edfd578ff71 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Wed, 27 May 2026 22:06:39 -0300 Subject: [PATCH 1/4] feat(audit): add actor filter to ComplianceTab (B/F5) Adds state, fetch param, reset and input+datalist for filtering audit entries by actor. The actor field is inserted between eventType and severity in the filter grid. Filter value is sent as ?actor= to the compliance audit-log API on every change. --- .../dashboard/audit/ComplianceTab.tsx | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/app/(dashboard)/dashboard/audit/ComplianceTab.tsx b/src/app/(dashboard)/dashboard/audit/ComplianceTab.tsx index 178195daf4..f2a0dc4329 100644 --- a/src/app/(dashboard)/dashboard/audit/ComplianceTab.tsx +++ b/src/app/(dashboard)/dashboard/audit/ComplianceTab.tsx @@ -72,6 +72,7 @@ export default function ComplianceTab() { const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [eventType, setEventType] = useState(""); + const [actor, setActor] = useState(""); const [severity, setSeverity] = useState<"all" | Severity>("all"); const [from, setFrom] = useState(""); const [to, setTo] = useState(""); @@ -85,6 +86,7 @@ export default function ComplianceTab() { try { const params = new URLSearchParams(); + if (actor) params.set("actor", actor); params.set("limit", String(PAGE_SIZE)); params.set("offset", String(offset)); if (eventType) params.set("action", eventType); @@ -105,7 +107,7 @@ export default function ComplianceTab() { } finally { setLoading(false); } - }, [eventType, from, offset, t, to]); + }, [actor, eventType, from, offset, t, to]); useEffect(() => { void fetchEntries(); @@ -120,10 +122,15 @@ export default function ComplianceTab() { return Array.from(new Set(entries.map((entry) => entry.action).filter(Boolean))).sort(); }, [entries]); + const actors = useMemo(() => { + return Array.from(new Set(entries.map((entry) => entry.actor).filter(Boolean))).sort(); + }, [entries]); + const canGoNext = offset + PAGE_SIZE < totalCount; const resetFilters = () => { setEventType(""); + setActor(""); setSeverity("all"); setFrom(""); setTo(""); @@ -186,7 +193,7 @@ export default function ComplianceTab() { -
+
+