Skip to content

feat(nav): Admin section — move platform setup out of Office (#1439) - #1443

Merged
thinkclay merged 1 commit into
mainfrom
claude/admin-section-1439-aff254
Nov 25, 2026
Merged

thinkclay merged 1 commit into
mainfrom
claude/admin-section-1439-aff254

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Fixes #1439. Part of epic #1442.

What changed

A new top-level Admin section at /admin sits right after Office in the nav. It holds the platform setup that staff rarely touch.

Admin tab Pages Moved from
General /admin/general/geographic /office/settings/geographic
Billing /admin/billing/payments, /transactions, /stripe /office/payments, /office/transactions, /office/settings/stripe
Integrations /admin/integrations/background-checks, /hris /office/integrations/*
Developer platform /admin/oauth-apps, /admin/oauth-apps/:id /office/oauth-apps/*
System /admin/system/notifications, /storage /office/notifications, /office/storage
  • Routes: ROUTES.ADMIN is in routes.ts, placed before OFFICE. Inside OFFICE the moved entries only gained hidden: true and a comment. API keys and webhooks are untouched (fix(developers): API keys and webhooks are per-organization but sit behind Office's staff-only gate — move them to the employer side #1440).
  • Gate: (admin)/admin/_layout.tsx uses Office's gate, useRoleProtectedRoute(['office']) plus useOfficeRouteProtection. The navigator always renders, with the loading overlay on top, so a deep link survives the role check (fix(auth): OAuth callback + hydration fixes, versioned legal acceptance, web PKCE #519). Narrowing the gate to platform is left to the epic.
  • Nav: generateAdminDrawerItem() has its own icon (SlidersHorizontal), and getNavItems puts it right after Office. Each Admin tab claims its group by matchPrefix, so a tab lights on its detail pages too, e.g. /admin/oauth-apps/:id. Office's strip no longer has Integrations, Payments or Transactions.
  • Sub-pages: Billing, Integrations and System each have more than one page, so a small AdminGroupTabs row moves between them. I couldn't reuse OfficeLayout's secondary tabs: their onValueChange is a no-op, so they only display.
  • Old links: each moved /office/... route file is now just MovedToAdminRedirect. It keeps child segments and the query string (features/admin/moved-paths.ts). These redirects stay behind the Office gate, as the issue allows.
  • Links: Office Overview's Notifications and Storage cards, the OAuth list and detail screens, and OfficeDeveloperLinks' OAuth entry now point at /admin. I also added i18n keys routes.admin.* in en, es and fr.

Verification

Checked in the browser on the local stack at 1280×800, signed in as the seed office user:

  • The sidebar shows Office, Admin, Home, … Admin's folder tabs read General · Billing · Integrations · Developer platform · System.
  • Each page lit its own Admin tab:
    • /admin redirects to /admin/general/geographic and lights General.
    • /admin/billing/stripe lights Billing, with the sub-row Payments · Transactions · Stripe settings.
    • /admin/integrations/hris lights Integrations, with the sub-row Background check providers · HRIS & Payroll.
    • /admin/oauth-apps/95c6ffef-… (the detail page) lights Developer platform.
    • /admin/system/storage lights System, with the sub-row Notifications · Storage.
  • Clicking the Transactions sub-tab from /admin/billing (which lands on payments) opens /admin/billing/transactions.
  • Old URLs redirect:
    • /office/settings/stripe → /admin/billing/stripe
    • /office/settings/geographic → /admin/general/geographic
    • /office/payments → /admin/billing/payments
    • /office/transactions → /admin/billing/transactions
    • /office/integrations/hris → /admin/integrations/hris
    • /office/integrations/background-checks → /admin/integrations/background-checks
    • /office/oauth-apps → /admin/oauth-apps
    • /office/oauth-apps/<id> → /admin/oauth-apps/<id>
    • /office/storage → /admin/system/storage
    • /office/notifications?status=failed → /admin/system/notifications?status=failed, with the console opening on the Failed filter
  • Office's strip now reads Overview · Screening · Content Management · Compliance · Violation Reports.
  • A seed worker without the office role who opens /admin/billing/stripe is sent to /dashboard. Their sidebar has neither Office nor Admin.

Checks:

  • pnpm check: passes.
  • Unit tests: vitest for drawer, admin and layouts gives 133/133. New tests cover getNavItems order, every Admin tab lighting by path (including /admin/oauth-apps/:id), activeNavKey claiming /admin/*, Office's remaining tabs, and the redirect map.
  • nx run scf-core:test: 1785 pass and 13 fail. All 13 are in clearAuthStorage.test.ts and MapStateProvider.test.tsx, where localStorage is undefined under this machine's Node 26. Neither touches this change.
  • pnpm radium:check: reports 3 violations, all in files this PR does not touch: comments in packages/ui and the @hookform/resolvers pin.
  • pnpm prepush: passes, with all 277 gated api tests. The first run failed 10 gated tests because the shared local edge runtime is serving functions from another worktree (sweep5). Pointed at this branch's own api on a spare port, every one passed. This PR has no backend changes.

Not updated: scripts/audit/screen-capture.mjs still lists the old /office/... paths. They redirect, so the sweep still works.

🤖 Generated with Claude Code

Office mixed daily staff work with setup pages staff rarely touch, and
several of those pages had no way in. They now live under a new
top-level Admin section at /admin, right after Office in the nav:

  General       /admin/general/geographic
  Billing       /admin/billing/{payments,transactions,stripe}
  Integrations  /admin/integrations/{background-checks,hris}
  Developer     /admin/oauth-apps, /admin/oauth-apps/:id
  System        /admin/system/{notifications,storage}

Admin uses Office's gate (office role, tablet+), and its layout keeps
the navigator mounted under the loading overlay so deep links survive
the role check (#519). Each tab owns its group by prefix, so it lights
on detail pages; multi-page groups get a row of their pages.

Office loses its Integrations, Payments and Transactions tabs. Every
moved /office path is now a hidden route that redirects to its new
home, keeping child segments and query (?status=failed). The Office
Overview cards, OAuth screens and developer links point at /admin.
API keys and webhooks are untouched (#1440).

Fixes #1439

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thinkclay
thinkclay merged commit 5a19fb7 into main Nov 25, 2026
10 checks passed
@thinkclay
thinkclay deleted the claude/admin-section-1439-aff254 branch November 25, 2026 22:10
thinkclay added a commit that referenced this pull request Nov 25, 2026
thinkclay added a commit that referenced this pull request Nov 26, 2026
Office/Admin/Developers split (epic #1442: #1443, #1444, #1445, #1446)
and worker invites with reminders (#1430, #1438; migrations 400, 401).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(nav): Admin section — move platform setup (settings, billing, integrations, OAuth approvals, system) out of Office

1 participant