Skip to content

Admin Dashboard – Partner Management #59

@benmli

Description

@benmli

Admin Dashboard – Partner Management

Branch: 06/admin-dashboard

Overview

Build the Admin Dashboard Partner Management experience following the approved Figma designs. This sprint uses live Clerk data in the development environment (organizations, memberships, invitations). No mock data is required.

Admins should be able to create partner organizations, invite users to existing or new organizations, and manage users and invitations from a centralized dashboard.


Goals

  • Match Admin Dashboard UI to Figma design
  • Display partner organizations and associated user counts
  • Support inviting users to:
    • Existing organizations
    • Newly created organizations
  • Provide per-user action menus
  • Validate all flows using Clerk dev environment

Frontend Scope

  • Modify src/app/admin/page.tsx to replace the current tab-based Admin Console
  • Implement Admin Dashboard layout:
    • Partner organization table:
      • Organization Name
      • Number of Users
      • Details / chevron action
    • “Add Partner Organization” Button + appropriate popup (similar design to add new user popup, with relevant fields based on Clerk documentation)
    • Use DeliverySummaryRow.tsx for rows
  • Clicking a partner row opens an Organization Detail modal
  • Organization Detail modal:
    • Organization name header
    • User table with columns:
      • Name
      • Email
      • Status (Active, Invited)
      • Actions (...)
    • Primary actions:
      • Add User
      • View Organization Dashboard
  • Per-user actions menu (...):
    • Edit user (no-op acceptable for now)
    • Delete user (remove membership or revoke invite)
    • Resend invitation (pending invitations only)
Image Image Image Image Image Image

Backend Scope

  • Refactor /api/admin/invitations to support inviting users into existing organizations
  • Update request payload:
    {
      email: string,
      organizationId?: string,
      organizationName?: string
    }

Behavior:

  • If organizationId is provided → invite user to that organization
  • If organizationName is provided → create organization, then invite user
  • Reject requests where neither value is provided
  • Prevent accidental creation of duplicate organizations
  • Continue enforcing admin-only access via requireAdmin

Testing Notes

  • Use Clerk development environment
  • Test emails do NOT need to accept invitations
  • Pending invitations are sufficient for validating UI and logic (invite acceptance can be tested with a real inbox, but is not required for all users)

Acceptance Criteria

  • Admin Dashboard visually matches Figma
  • Partner organizations load from Clerk
  • Organization Detail modal shows users and invitations correctly
  • Users can be invited to existing organizations
  • Resend and delete invitation actions work

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions