Skip to content

feat(admin): Add submission type filter dropdown#26

Merged
olearycrew merged 1 commit intomainfrom
feat/submissions-official-filter
Mar 19, 2026
Merged

feat(admin): Add submission type filter dropdown#26
olearycrew merged 1 commit intomainfrom
feat/submissions-official-filter

Conversation

@ScuttleBot
Copy link

Summary

Replace the 'Official only' checkbox with a dropdown filter that allows filtering submissions by type:

  • All submissions (default)
  • Official only
  • Unofficial only

Changes

  • Updated /admin/api/submissions endpoint to accept official=false in addition to official=true
  • Changed the submissions toolbar from a checkbox to a dropdown selector
  • Reuses the existing page-size-selector styling for consistency with other dropdowns

Screenshots

The new filter matches the pattern already used in the Graphs section (submissions per day filter).

Testing

  • Filter defaults to 'All submissions'
  • Selecting 'Official only' shows only submissions where official=1
  • Selecting 'Unofficial only' shows only submissions where official=0
  • Pagination works correctly with all filter states
  • Empty state messages reflect current filter selection

Replace the 'Official only' checkbox with a dropdown filter that
allows filtering by:
- All submissions
- Official only
- Unofficial only

This matches the existing pattern used in the Graphs section and
provides admins with more granular control over which submissions
they're viewing.
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
api 29e6f86 Commit Preview URL

Branch Preview URL
Mar 19 2026, 12:19 PM

@olearycrew olearycrew merged commit 9c31ae0 into main Mar 19, 2026
1 check passed
@kilo-code-bot
Copy link

kilo-code-bot bot commented Mar 19, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The changes are clean and consistent with existing patterns in the codebase. The new submission type filter dropdown mirrors the exact same approach already used for the submissions-per-day graph filter (both backend and frontend). Key observations:

  • No SQL injection risk: officialWhere is built from hardcoded strings based on strict equality checks — user input is never interpolated into SQL.
  • Proper URL encoding: encodeURIComponent is correctly applied to the filter value in the frontend.
  • Consistent UX: The dropdown reuses page-size-selector styling and follows the same filter pattern used elsewhere in the admin UI.
  • Correct empty state handling: The empty state message logic properly accounts for the new filter.
Files Reviewed (2 files)
  • src/routes/admin.ts - 0 issues
  • src/templates/adminHtml.ts - 0 issues

Reviewed by claude-4.6-opus-20260205 · 252,735 tokens

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.

2 participants