Client SaaS
TypeScript
Pull Request Opened
PR #201 opened: refactor: admin cleanup — shared UI helpers + slim dashboard + Action items page
Two-part tidy-up of the admin area, which had fragmented as we added to it.
Part 1 — consolidate duplicated UI helpers (no functional change)
Each admin page had reinvented the same primitives inline (formatDate in 11 files, plus formatCurrency / formatDateTime / RoleBadge / StatCard / SectionCard), with formatting and colours drifting page to page.
- Shared modules:
@/lib/money(formatCurrency),@/lib/datesnull-safeformatDate,@/components/admin/{role-badge,stat-card,section-card}. - Replaced inline copies across admin pages with those + the existing
@/components/ui/status-badge. - Standardised
RoleBadge— the dashboard had a divergent palette (admin=gray/client=purple); now admin=purple/client=blue everywhere, with an optionalsize.
Part 2 — slim the dashboard + dedicated Action items page
The dashboard had become a ~3000px everything-page; its deep action-lists (unverified emails, stuck onboarding, pending verifications, no/incomplete Stripe, no bio, no services) — each expanding to dozens of rows with Send-reminder buttons — dominated it.
- Extracted the queries to
App\Services\Admin\AdminActionItems(all()+ cheapcounts()). - New
/admin/action-itemspage hosts the lists with the same per-user + bulk nudge actions (same routes — behaviour unchanged); added a nav item. - Dashboard now shows a compact Action items summary (7 counts, amber when >0) linking to the page; stats/pipelines/marketplace-health/trend/recent-registrations unchanged.
Verified
npm run buildgreen- 152 admin tests pass (incl. new
ActionItemPageTest) - pint / prettier / eslint clean
- Browser-checked: slimmed dashboard + new Action items page render correctly, nudge buttons intact.
+837
additions
-601
deletions
20
files changed