feat(auth,admin): enhance auth UI and integrate audit log archive cleanup
Description
This pull request brings several user experience enhancements to authentication screens, streamlines the Admin User Detail view, and integrates the audit log retention & archive cleanup capability into the Admin Audit Logs dashboard.
Key Changes
1. Authentication UI Enhancements
-
Register Page (
src/pages/auth/register.tsx):- Added interactive show/hide password toggles (
eye/eye-officons) for both the password and confirm password fields to avoid typo errors during account creation.
- Added interactive show/hide password toggles (
-
Forgot Password Page (
src/pages/auth/forgot-password.tsx):- Improved layout structure by centering the form vertically (
min-h-[calc(100vh-64px)] justify-center), ensuring consistent and aesthetic visual alignment across mobile and desktop viewports.
- Improved layout structure by centering the form vertically (
2. Admin User Management
-
User Detail Page (
src/pages/admin/users/detail.tsx):- Removed the embedded audit log history section and associated query hook to keep user details clean, focused, and performant. Complete audit trails are accessible via the dedicated Audit Logs page.
3. Admin Audit Logs & Retention Integration
-
Audit Logs Page (
src/pages/admin/audit-logs/index.tsx):- Added an informational banner explaining the 30-day retention and archiving policy.
- Added a manual "Lưu trữ & Dọn dẹp" (Archive & Cleanup) action button with confirmation dialog, allowing authorized administrators (
AUDIT_LOG_READ) to trigger archiving on demand. - Displayed real-time status and feedback upon cleanup completion.
-
Services & Hooks (
src/services/rbac.service.ts,src/hooks/use-admin.ts):- Added
archiveAndCleanupAuditLogsAPI caller pointing toPOST /api/v1/audit-logs/archive-cleanup. - Added
useArchiveCleanupAuditLogsmutation hook with automatic query invalidation.
- Added
-
Localization (
src/i18n/locales/vi.json,src/i18n/locales/en.json):- Added full translation strings for both Vietnamese and English for the audit log archive feature.