QA: Admin, Vendor & Mail Improvements — Paginated Data Tables, Vendor Upload Retry, and Cleaner Error Handling
Executive summary
A batch of ~20 frontend changes was promoted to the QA environment, spanning the Admin, Vendor, and Mail apps plus shared UI. Highlights include floating paginated/searchable data tables across the Admin portal, server-side pagination and search for Vendor upload tasks, a new failed-uploads retry/re-upload workflow, and a smarter error-toast system that no longer alarms users when a request quietly succeeds on retry.
Why this was needed
Several Admin and Vendor screens loaded entire datasets at once and exposed non-functional UI (placeholder checkboxes, disabled menu items), which scaled poorly and confused users. Failed vendor uploads had no recovery path, some bulk operations gave no feedback, and transient API errors triggered scary toasts even when an automatic retry succeeded. This batch addresses those usability, scalability, and reliability gaps.
Client / user impact
- Admin data tables (Users, Entities, Permissions, etc.) now paginate and search server-side with a floating pagination bar (page jump, rows-per-page), staying responsive on large datasets.
- Vendors can retry or re-upload failed files directly from the View Files modal instead of being stuck.
- Bulk folder activate/deactivate and bulk user/entity actions now show clear success, partial-success, and skipped-item toasts and refresh the grid automatically.
- Fewer false-alarm error messages: users only see an error toast after automatic retries are exhausted.
- Cleaner UI: non-functional checkboxes removed and Edit/Delete hidden (not just greyed out) for protected system folders and document types.
Technical scope
Grounded in the diff (51 files, +2441/-728). Notable changes:
- Admin data-table (
components/common/data-table.tsx, +458): floating pagination bar, page-number buttons with ellipsis, 'Go to' input, rows-per-page selector, 300ms debounced search (hooks/useDebounce.ts); enabled across the Admin portal pages. - Permissions page: rewritten to use the paginated
DataTablewith newgetPermissionsList/usePermissionsList;PermissionMatrixnow usesuseInfinitePermissions'Load more' paging. - Role form: removed unused
role_code, switched from auto-save to explicit submit, chains create-role then assign-permissions;assignUserRolesandbulk assignmoved PUT→POST; removed unsupported userfirst_name/last_namefields. - Error handling: Mail/Vendor/Admin
query-client.provider.tsxadd globalQueryCache/MutationCacheonErrorhandlers (sonner toasts for 403/5xx/network/unexpected); error toasts removed from HTTP interceptors (401 kept for auth redirect). - Vendor:
TaskListgains server-side pagination + search (limit→size, newsearchparam); newFailedUploadsSectionwith retry and a newmailReuploadroute/service; case-insensitive status mapping; visible horizontal scrollbar inViewFilesModal; removed duplicate close button and a non-functional Refresh button. - Mail:
bulkDeleteMailsmoved from a query-stringDELETEto aPOSTwith a JSON body (mail_ids,user_id,permanent); 'Add Document' button added to documents page. - Cleanup: removed non-functional checkboxes from Rules Engine and several tables; hide Edit/Delete for system folders/document types.
- Shared/infra:
AppSwitcherreworked for theme-aware (light/dark) colors and dropdown width;NEXT_PUBLIC_SOCKET_URLbuild arg added toDockerfileand the ECR workflow.
Risk & mitigation
Moderate, breadth-driven: this touches many high-traffic Admin/Vendor screens and shared providers, so a regression in the data-table or query-client could affect multiple pages at once. Several API contract changes (bulk-delete DELETE→POST, role assignment PUT→POST, vendor limit→size param) depend on matching backend behavior. Mitigation: changes are isolated to the QA environment for verification before any production promotion, and error-handling moved to a single centralized location reducing duplication.
QA validation focus
- Admin tables: verify pagination (page buttons, 'Go to', rows-per-page), debounced search, and that grids auto-refresh after create/edit/bulk actions.
- Mail: confirm bulk delete works via the new POST endpoint for both soft delete and permanent delete.
- Vendor: test upload-tasks pagination/search, the failed-uploads retry and re-upload flows, status display, and the visible horizontal scrollbar in View Files.
- Roles/Permissions: create a role, assign permissions, and load the permission matrix incrementally; confirm role assignment succeeds via POST.
- Error toasts: trigger a transient/retryable failure and confirm no premature toast, plus correct toasts for 403, 5xx, and network errors; confirm 401 still redirects.
- Bulk folder activate/deactivate: verify success, partial-success, and skipped messaging.
- AppSwitcher: check dropdown rendering and colors in both light and dark themes.