feat: add audit log viewing for vendor and tenant personas
All checks were successful
CI / build (push) Successful in 52s
CI / docker (push) Successful in 40s

Vendor sees all audit events with tenant filter at /vendor/audit.
Tenant admin sees only their own events at /tenant/audit.
Both support pagination, action/result filters, and text search.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-10 13:07:18 +02:00
parent 1750fe64a2
commit 8b94937d38
13 changed files with 557 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
import { useState } from 'react';
import { useTenantAuditLog } from '../../api/tenant-hooks';
import { AuditLogTable } from '../../components/AuditLogTable';
import type { AuditLogFilters } from '../../types/api';
export function TenantAuditPage() {
const [filters, setFilters] = useState<AuditLogFilters>({ page: 0, size: 25 });
const { data, isLoading } = useTenantAuditLog(filters);
return (
<div style={{ padding: 24, display: 'flex', flexDirection: 'column', gap: 20 }}>
<h1 style={{ margin: 0, fontSize: '1.25rem', fontWeight: 600 }}>Audit Log</h1>
<AuditLogTable
data={data}
isLoading={isLoading}
filters={filters}
onFiltersChange={setFilters}
showTenantColumn={false}
showTenantFilter={false}
/>
</div>
);
}

25
ui/src/pages/vendor/VendorAuditPage.tsx vendored Normal file
View File

@@ -0,0 +1,25 @@
import { useState } from 'react';
import { useVendorAuditLog, useVendorTenants } from '../../api/vendor-hooks';
import { AuditLogTable } from '../../components/AuditLogTable';
import type { AuditLogFilters } from '../../types/api';
export function VendorAuditPage() {
const [filters, setFilters] = useState<AuditLogFilters>({ page: 0, size: 25 });
const { data, isLoading } = useVendorAuditLog(filters);
const { data: tenants } = useVendorTenants();
return (
<div style={{ padding: 24, display: 'flex', flexDirection: 'column', gap: 20 }}>
<h1 style={{ margin: 0, fontSize: '1.25rem', fontWeight: 600 }}>Audit Log</h1>
<AuditLogTable
data={data}
isLoading={isLoading}
filters={filters}
onFiltersChange={setFilters}
showTenantColumn
showTenantFilter
tenants={tenants}
/>
</div>
);
}