Admin Dashboard & User Management Fixes Reach QA
Executive summary
Promotes a batch of admin-portal bug fixes (from PR #930) into the QA environment. The release repairs the dashboard's broken stats cards, corrects user-management quirks (role filter, role visibility, and an accidental save during user edits), and removes a non-working bulk-deactivate control so the admin experience matches the legacy portal.
Why this was needed
After migrating the admin portal to the new single-page app, several screens behaved incorrectly. The dashboard called a stats endpoint the backend never built (returning a 404, so cards stayed empty), showed a "Documents Today" card instead of system health, and linked to the wrong quick action. On the Users screen, the role filter's clear button reopened its menu instead of clearing, long role descriptions overflowed, the User Details dialog hid roles behind a "+N" badge, a bulk-deactivate button was permanently disabled, and editing a user could silently auto-save when moving between steps.
Client / user impact
Admins now see populated dashboard cards (tenant, user, document counts) and a live system Status card (Online / Degraded / Offline) instead of broken or misleading data. The Users grid is cleaner: the role filter clears correctly, long descriptions wrap, the details dialog shows every assigned role, and the dead bulk-action UI is gone. Editing a user no longer risks saving prematurely when advancing to the Assign Roles step.
Technical scope
Frontend-only changes to the admin app, bundling fixes from PR #930:
- Dashboard stats (BUG-001): Replaced the single 404-ing
dashboard/statscall with parallel fan-out (Promise.allSettled) to existing list endpoints usingpage=1&limit=1for counts, plus page-stats summary calls withstart_date/end_dateranges; failures degrade to 0. Added a local-timezonetoDateStrhelper to avoid UTC date drift. - Status card (BUG-002): "Documents Today" card replaced by a live Status card backed by
useSystemHealth, mapping healthy/degraded/unhealthy to Online/Degraded/Offline. - Quick action (BUG-003): "Upload Centers" quick action swapped for "Policies" pointing at
/notification-policies. - Role filter (BUG-008):
RoleSelectclear-all and per-badge X moved outside the RadixPopoverTrigger(which intercepted descendant clicks); descriptions switched fromtruncatetoline-clamp-2 break-words. - Bulk actions (BUG-009): Removed the select column,
enableRowSelection,selectionActions, anduseBulkDeactivateUsersfrom the Users grid. - Role visibility (BUG-012): User Details dialog now renders all roles as badges instead of
RoleBadges"+N" truncation. - Edit auto-submit: Added a
stepTransitionGuardRefpluse.repeatcheck and 100ms timeout to block stray Enter keyups during the Next→Submit button swap; addedtype="button"to RoleSelect/TenantSelect buttons inside the form.
Risk & mitigation
Moderate. The dashboard now issues ~15 parallel requests instead of one; this raises load and any per-endpoint param mismatch (e.g. the start_date/end_date casing already corrected here) silently yields 0 rather than an error. The RoleSelect markup was restructured from a single button into a flex wrapper, so popover open/close and keyboard focus should be re-verified. Risk is contained to the admin portal and this is a QA-stage promotion, not Production.
QA validation focus
- Dashboard: confirm count cards (tenants, users, documents today/week/month) show real non-zero values and the Status card reflects health (Online/Degraded/Offline).
- Verify the Policies quick action navigates to notification policies.
- Users grid: role filter X clears the selection without reopening the menu; long role descriptions wrap to two lines; no checkbox column or Deactivate button remains.
- User Details dialog: all assigned roles are visible (no "+N").
- Edit User: advance Step 1 → Assign Roles via click and via held Enter; confirm it does NOT auto-save, then save deliberately and confirm the update succeeds.
- Late-evening (e.g. IST) check that "today" document counts use the local date, not UTC.