fix: address multiple PR review issues

- Fixed accessibility in audit logs with keyboard navigation and ARIA attributes
- Refactored ThreatAnalysisResults interface to module level for reusability
- Added BatchOperation enum validation and proper CSV escaping in batch monitoring
- Removed unused company state causing skeleton view in dashboard overview
- Enhanced error handling with user-facing messages for metrics loading
- Replaced hardcoded timeouts with condition-based waits in E2E tests
- Removed duplicate state management in security monitoring hooks
- Fixed CSRF documentation to show proper secret fallback pattern
- Updated CSP metrics docs with GDPR Article 6(1)(f) legal basis clarification
- Fixed React hooks order to prevent conditional execution after early returns
- Added explicit button type to prevent form submission behavior
This commit is contained in:
2025-07-14 00:24:10 +02:00
parent bba79d509b
commit ef1f0769c2
9 changed files with 221 additions and 77 deletions

View File

@ -184,7 +184,10 @@ export default function AuditLogsPage() {
}, [session?.user?.role, hasFetched, fetchAuditLogs]);
// Function to refresh audit logs (for filter changes)
const refreshAuditLogs = useCallback(() => {
const refreshAuditLogs = useCallback((newPage?: number) => {
if (newPage !== undefined) {
setPagination((prev) => ({ ...prev, page: newPage }));
}
setHasFetched(false);
}, []);
@ -445,8 +448,8 @@ export default function AuditLogsPage() {
size="sm"
disabled={!pagination.hasPrev}
onClick={() => {
setPagination((prev) => ({ ...prev, page: prev.page - 1 }));
refreshAuditLogs();
const newPage = pagination.page - 1;
refreshAuditLogs(newPage);
}}
>
Previous
@ -456,8 +459,8 @@ export default function AuditLogsPage() {
size="sm"
disabled={!pagination.hasNext}
onClick={() => {
setPagination((prev) => ({ ...prev, page: prev.page + 1 }));
refreshAuditLogs();
const newPage = pagination.page + 1;
refreshAuditLogs(newPage);
}}
>
Next