1
0
Fork 0
Commit graph

728 commits

Author SHA1 Message Date
fb74e6b0c2 chore(seed): update seed scripts for RBAC roles
Assign the developer role document to the sysadmin user on seed. Add
seedRoles script to create default RBAC roles.
2026-08-19 19:48:31 -04:00
d3890cc191 feat(discord): integrate RBAC into Discord bot
Replace legacy role-name checks in isStaff with hasPermission(discord:staff).
Auto-assign the 'user' role document on signup. Import hasPermission in
announce command for future permission gating.
2026-08-19 19:48:28 -04:00
1f9f919443 feat(auth): add return-URL flow for login redirects
Add LoginLink client component that captures current path via usePathname()
and passes it as returnTo query param. Update login page to read and
sanitize returnTo (open-redirect guard: must start with /, reject //).
Update LoginForm to redirect to returnTo after successful login. Wire
LandingPage CTA through LoginLink. Add returnTo redirect for already-
authed users hitting /login. Add return-URL to flappy page redirect.
Remove trailing blank line from (frontend) layout.
2026-08-19 19:48:24 -04:00
eef1b11bb1 feat(rbac): migrate server actions and service layers to RBAC
Replace hasRoles calls with hasPermission in all server actions and page
components. Update qualification checks (logistics, intelligence) to use
permission-based checks instead of role name matching. Update staff lookup
in tickets/staff.ts to query roles collection. Use enlistmentDate field
on profile page instead of createdAt.
2026-08-19 19:47:57 -04:00
653caa8064 feat(rbac): migrate collection access controls to RBAC permissions
Replace legacy isDeveloper/isAdmin/hasRoles checks with
hasPermission/requirePermission across all collections. Add roleDocs
relationship to Users, enlistmentDate to Profiles, and field-level
intel_excerpt permission gate on Profiles. Auto-generated payload-types
updated to reflect the new Roles collection and roleDocs field.
2026-08-19 19:47:51 -04:00
80f28ed939 feat(rbac): add dynamic roles collection and permissions system
Introduce a dynamic RBAC system with a new 'roles' collection that grants
granular permissions. Add hasPermission/requirePermission/loadUserPermissions
utilities and a central permissions registry. Register the Roles collection in
payload.config and add roleDocs relationship to Users.
2026-08-19 19:47:36 -04:00
adaedaefde chore: verify forgejo remote 2026-08-18 10:51:55 -04:00
4c3c3373d3 feat(roster): implement leadOrActual display preference
- Fetch current user's leadOrActual preference in roster page via payload.auth()
- Add RosterDisplayContext to avoid prop drilling through org chart components
- MemberCard shows 'Lead' or 'Actual' based on user preference
- Add preference radio buttons to PreferencesForm under Display section
- Update updatePreferences server action to save leadOrActual
- Add TODO for restyling radio buttons later
2026-08-18 02:20:58 -04:00
feccbc0ced chore(migrations): archive superseded migrations and add consolidated migration
Move old migrations (20260109 through 20260817) to _archived/ and add a
single consolidated migration (20260818_024510). Update the migrations
index to reference only the new migration.
2026-08-18 02:05:56 -04:00
72262d53b6 feat(users): add leadOrActual roster display preference
Adds a 'leadOrActual' select preference to the display group so users
can choose between 'Lead' or 'Actual' when reviewing the unit roster.
2026-08-18 02:05:41 -04:00
cb2029ea97 feat(command-palette): register page-specific commands across UI
Wire CommandPalette/Provider into the frontend layout and add Cmd+K
hint in the SiteHeader. Register context-aware commands for banking,
helpdesk, mission RSVP, locker, shipments, and market pages.

Also removes the locker search's duplicate Cmd+K listener (now handled
globally), renames its button to 'Search Locker', and cleans up a
flappy page parenthetical.
2026-08-18 02:05:36 -04:00
4906fc8008 refactor(ui): make dialogs controlled via open/onOpenChange props
Support external open state management so parent components and the
command palette can trigger these dialogs programmatically.
2026-08-18 02:05:20 -04:00
0fc61ebb47 feat(command-palette): add command palette with Cmd+K keyboard shortcuts 2026-08-18 02:05:00 -04:00
2f536a814b chore(flappy): remove parenthetical from flight simulator message 2026-08-17 22:22:06 -04:00
cc45ba0b61 docs: update version references and typecheck notes
- Bump Payload CMS version from 3.79.1 to 3.88.0 in AGENTS.md and README.md
- Note that pre-existing typecheck errors are resolved by the upgrade
2026-08-17 22:18:35 -04:00
452aa392bd feat(ui): enhance shadcn dialog, tabs, tooltip, and command components
- Add showCloseButton prop to DialogContent for modal workflows
- Add line variant to TabsList via class-variance-authority
- Add arrowClassName prop to TooltipContent for arrow styling
- Add optional title prop to CommandDialog for accessibility
2026-08-17 22:18:31 -04:00
ae732496ed chore: regenerate Payload types and import map 2026-08-17 22:18:27 -04:00
e57f38cd8f feat(config): switch AI provider from Ollama to Unsloth with streaming support
- Add Unsloth OpenAI-compatible provider with @ai-sdk/openai
- Rewrite AI generation handlers with Vercel AI SDK streaming
- Add plainTextToLexicalJson helper for richText field generation
- Configure HeadingFeature and PayloadAiPluginLexicalEditorFeature
- Stub @payloadcms/richtext-lexical server entry in client bundle
- Extract meta constants for site title and description
- Add UNSLOTH_API_KEY to .env.development
2026-08-17 22:18:23 -04:00
79d3c0a0b3 chore(deps): upgrade Payload CMS from 3.79.1 to 3.88.0 2026-08-17 22:18:13 -04:00
50bc0e3441 style(migrations): rename migration files, add new migration for shims, add favicon for front-end 2026-08-17 02:02:16 -04:00
cdeebd05f8 style(static): format payload admin static components 2026-08-16 23:27:51 -04:00
9f4faa948b style(config): format generated payload schema 2026-08-16 23:27:51 -04:00
c27b12c76c style(bot): format Discord bot modules 2026-08-16 23:27:51 -04:00
50f964cdf9 style(scripts): format tick scripts, seed tools, and migrations 2026-08-16 23:27:51 -04:00
2acf52788f style(collections): format Payload collection configs 2026-08-16 23:27:51 -04:00
6685fe68cd style(lib): format shared libraries and remove unused imports 2026-08-16 23:27:51 -04:00
5058d9ce6c style(admin): format admin narrative-flow and award components 2026-08-16 23:27:51 -04:00
a21564a78d style(frontend): format frontend feature components 2026-08-16 23:27:51 -04:00
7db1f648bf style(app): format app routes, pages, and server actions 2026-08-16 23:27:51 -04:00
05c7c83799 style(ui): format shadcn/ui primitives and utility hooks 2026-08-16 23:27:51 -04:00
afb61f6227 feat(globals): add Shims global for admin CSS/JS shims 2026-08-16 23:27:51 -04:00
088b6cefb6 fix(ui): correct sidebar inset layout and Tailwind v4 custom-property widths
The shadcn component update pulled sidebar.tsx using Tailwind v3-style
bare-bracket custom property syntax (w-[--sidebar-width]). Under Tailwind
v4 this compiles to invalid CSS (width: --sidebar-width) which the browser
ignores, so width fell back to auto and the fixed sidebar blew out to its
content's intrinsic width (the 1372px logo header ~ half the page). The
empty spacer div was equally broken, reserving zero space and leaving the
inset m-2 margin as a stray left gap.

Three fixes:
- sidebar.tsx: wrap all 7 bare-bracket custom properties in var() so they
  compile to width: var(--sidebar-width) / var(--sidebar-width-icon) /
  max-width: var(--skeleton-width). The calc(var(...)) rules were already
  valid; only the bare forms were broken.
- layout.tsx: replace the raw <main className="min-h-full bg-background
  w-full"> with <SidebarInset>. AppSidebar uses variant="inset", whose
  peer styling (md:peer-data-[variant=inset]:m-2 / :rounded-xl / :shadow)
  only applies to a SidebarInset sibling, so the inset gap/rounding/shadow
  were silently dropped.
- SiteHeader.tsx: replace the raw <div> + border-gray-800 + p-4 with the
  standard shadcn <header className="flex h-16 shrink-0 items-center gap-2
  border-b px-4"> using semantic border-b, plus -ml-1 on SidebarTrigger
  and an ml-auto wrapper for NotificationsBell (which takes no className).

Verified via the running dev server: SSR HTML carries
data-variant="inset", a single <main> with the peer-data-[variant=inset]
classes, <header ... border-b>, and zero border-gray-800 occurrences.
tsc --noEmit clean for the changed files.
2026-08-16 23:27:51 -04:00
fa70ed0956 feat(config): add meta information for Polaris Task Force website 2026-08-16 19:41:21 -04:00
4905022dd5 feat(config): wire prodMigrations for auto-migrate on prod boot
Import the migrations array from src/migrations/index.ts and pass it as prodMigrations to the postgres adapter. Per @payloadcms/db-postgres connect.js, when NODE_ENV=production the adapter now auto-runs payload migrate against this array on every boot, so pending migrations apply on deploy without a manual docker exec step. Idempotent on next prod boot since payload_migrations already tracks batches 1-2. DEPLOYMENT.md §7's manual 'docker exec ... payload/bin.js migrate' still works as a fallback via filesystem discovery.
2026-08-16 19:39:19 -04:00
0ed8721889 refactor(migrations): split tickets DDL out of migration 7 into migration 8
Migration 7 originally bundled tickets DDL with pending schema drift, which made it fail against prod (no tickets objects existed there). Split into a stripped migration 7 (no tickets statements) and a new tickets-only migration 8 that creates enum_tickets_* types, ALTER TYPE ADD VALUE for 'tickets' + 'ticket:*' muted-type values, tickets and tickets_activity tables, and the payload_locked_documents_rels.tickets_id column + FK + index. Migration 8's .json snapshot is the new forward baseline for migrate:create (verified via zero-diff probe). Applied to prod: m1-7 baselined as batch 1, m8 applied as batch 2.
2026-08-16 19:38:56 -04:00
10560c1446 fix(version): resolve git metadata from env/SOURCE_COMMIT for Coolify builds
Coolify strips .git from the build context, so git CLI calls in
generate:version-info fail during Docker builds. The script now
resolves metadata in priority order: GIT_* env overrides, then
SOURCE_COMMIT (Coolify's injected build arg, shortened to 7 chars),
then git CLI fallback for local builds. Dockerfile passes the ARGs
through as ENV before the build; DEPLOYMENT.md documents the required
'Include Source Commit in Build' setting.
2026-08-16 18:46:21 -04:00
8fe7276ba3 refactor(ui): update shad/cn components 2026-08-16 18:34:23 -04:00
dad652b1d4 feat(helpdesk): enhance create ticket dialog with critical alert for priority tickets 2026-08-16 18:26:01 -04:00
56b79e142e fix(migrations): backfill grid columns before NOT NULL on data-bearing table
The generated migration added grid_x/grid_y as numeric NOT NULL without a
default, which fails on prod where game_structures_stored_resources already
has rows ('column contains null values'). Add the columns with DEFAULT 0 to
backfill existing rows, then drop the default to match the target schema.
2026-08-16 18:23:33 -04:00
931c60e234 refactor(helpdesk): replace inline hint with Alert in create ticket dialog
Use the shadcn Alert component for the file-sharing hint instead of a bare Message element.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:13:22 -04:00
9ec4555200 feat(migrations): add production migration for tickets and pending schema drift
Add migration 20260816_213455 covering the Tickets collection plus all schema drift accumulated since 20260109 (banking, market, game vehicles/NPCs, attendance, enum extensions).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:59 -04:00
6480b47273 test(helpdesk): add tickets integration tests
Add integration coverage for ticket creation, replies, status changes, and assignment against a live Postgres.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:54 -04:00
5064890452 feat(helpdesk): add helpdesk sidebar entry
Add the Helpdesk nav item with LifeBuoy icon under the core nav group.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:49 -04:00
c80ecf9141 feat(helpdesk): add helpdesk UI components
Add TicketsView, TicketCard, TicketDetail, TicketTimeline, CreateTicketDialog, and TicketBadges components.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:44 -04:00
14d92bf277 feat(helpdesk): add helpdesk pages
Add the helpdesk list page and ticket detail page routes.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:40 -04:00
40f23e8774 feat(helpdesk): add ticket server actions
Add createTicket, replyToTicket, updateTicketStatus, and assignTicket server actions with notification and event-log emission.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:36 -04:00
ff986bf4ec feat(helpdesk): add ticket domain libs
Add shared ticket metadata (labels, styles), staff resolution, and plaintext-to-lexical conversion helpers.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:33 -04:00
e7eff028b7 feat(tickets): add Tickets collection
Add the helpdesk Tickets collection with status/priority/category enums, reporter/assignee relationships, activity timeline, and closedAt lifecycle. Register in payload.config and refresh generated types.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:27 -04:00
94cd7c5626 feat(helpdesk): add ticket notification types
Add ticket:created/assigned/reply/status labels and muteable notification types.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:22 -04:00
6419c9676f feat(helpdesk): add ticket event log wiring
Add ticket:create/reply/status-change/assign event types, extend the emit targetCollection union, and register tickets in GameEventLogs target collections.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-16 18:12:19 -04:00