feat(frontend,backend): skeleton table loaders and admin 2FA enforcement#962
Merged
Wilfred007 merged 1 commit intoJun 25, 2026
Merged
Conversation
Frontend (Gildado#647, Gildado#680): - Replace plain-text loading states with the shared SkeletonLoader table-row variant in AdminPanel freeze logs, BulkPaymentStatusTracker, and the CustomReportBuilder preview table. - Add sr-only aria-live status announcements so screen-reader users are notified while data tables load (WCAG 2.1). - Extend SkeletonLoader tests for the data-table layouts. Backend (Gildado#692, Gildado#713): - Add require2FAForAdmin middleware enforcing verified TOTP / recovery-code 2FA on sensitive organization-management endpoints (name, issuer) and document the x-2fa-token header in the OpenAPI specs. - Add migration 052 with composite/partial indexes for org-scoped, status-filtered payroll run listings and the failed-item retry path, plus its rollback. - Add middleware unit tests and keep the org controller tests focused.
|
@Akanimoh12 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves four Stellar Wave issues with focused, pattern-following changes across the frontend and backend.
Closes #647
Closes #680
Closes #692
Closes #713
What Changed
Frontend — Skeleton loading for data tables (#647, #680)
SkeletonLoader(table-rowvariant) to replace plain-text/spinner loading states in the remaining data tables that lacked a proper skeleton:Loading…text cell.Loading bulk payroll runs...paragraph.sr-onlyaria-live="polite"status announcements andaria-busyon the loadingtbodyso screen-reader users are informed while tables load (WCAG 2.1).SkeletonLoader.test.tsxwith cases covering the multi-row/multi-column data-table layouts and verifying placeholder rows stay hidden from assistive tech.Backend — Admin 2FA enforcement (#692)
require2FAForAdminmiddleware that enforces verified TOTP / recovery-code two-factor authentication on sensitive organization-management endpoints (PATCH /api/v1/organizations/me/nameand/me/issuer). Unlike the existing softrequire2FAgate, this hard-gates the request: 2FA must be enabled (403otherwise) and a valid token/recovery code must be supplied via thex-2fa-tokenheader ortwoFactorTokenbody field (401otherwise). Recovery codes are single-use and consumed on match.x-2fa-tokenheader and the new401/403responses.otplibdependency andapiErrorresponse helpers; proper logging and error handling included.Backend — API & Database scaling (#713)
052_api_database_scaling_part23.sql(with matching rollback) introducing read-path index optimizations following the established0xx_api_database_scaling_partNpattern:payroll_runs (organization_id, status, created_at DESC)for org-scoped, status-filtered, newest-first run listings.payroll_itemsfor the payment-retry flow.IF NOT EXISTS) and contain no schema/data changes.Checklist
Testing
cd frontend && npm run lint && npx prettier . --check && npm run build && npm test— the extendedSkeletonLoadersuite covers the new data-table layouts.cd backend && npm test— newrequire2faForAdmin.test.tscovers the no-user (401), 2FA-not-enabled (403), missing-token (401), valid-TOTP (next()), invalid-token (401), single-use recovery-code, and DB-failure (500) paths; the existing org controller suite stays green.npm run db:migrate:dry-runand runningnpm run db:migratetwice yieldsApplied: 0on the second run; rollback file provided.Documentation
COMMENT ON INDEXnotes, per the contributing guide.Accessibility / Responsiveness
role="presentation"/aria-hiddenand contain no text, so screen readers skip them; visible loading state is announced viasr-onlyaria-liveregions andaria-busy. The skeleton rows inherit each table's existing responsiveoverflow-x-autocontainers, so mobile/tablet/desktop behavior is unchanged.Notes
052), no existing migration was modified, and a matching rollback is included.