Skip to content

feat: add application statistics dashboard and fix sponsor permissions#68

Merged
MatejMa2ur merged 7 commits intomainfrom
claude/infallible-sammet
Apr 16, 2026
Merged

feat: add application statistics dashboard and fix sponsor permissions#68
MatejMa2ur merged 7 commits intomainfrom
claude/infallible-sammet

Conversation

@MatejMa2ur
Copy link
Copy Markdown
Member

  • Add Statistics page with dropdown field response breakdowns, filterable by status
  • Add GET API route for statistics data
  • Add getApplicationStatistics getter querying option counts per form field
  • Add Statistics tab to dashboard (admin-only)
  • Fix sponsors getter to scope applications by hackathonId (permissions bug)

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

MatejMa2ur and others added 7 commits April 17, 2026 00:11
- Add Statistics page with dropdown field response breakdowns, filterable by status
- Add GET API route for statistics data
- Add getApplicationStatistics getter querying option counts per form field
- Add Statistics tab to dashboard (admin-only)
- Fix sponsors getter to scope applications by hackathonId (permissions bug)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…AUDE.md

- Add file field handling to createFormValuesObject (option > file.name > value)
- Add file.name to formValues select in applicationList and getApplicationsForSponsors
- Add email/team name search and rows per page selector to SponsorsApplicationsTable
- Rewrite getApplicationStatistics to use FormFieldType value for select fields
- Add requireAdmin() guard to statistics page
- Fix statistics API route error handling
- Add CLAUDE.md project documentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use FormFieldTypesWithOptions (radio/select/combobox) instead of non-existent "multi_select"
- Separate auth errors (401) from server errors (500) in statistics API route
- Validate hackathonId is a number and status is a known value before processing
- Remove file.id over-fetch in getApplicationsForSponsors
- Remove unused ApplicationStatusEnum and FieldStatistic imports

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rtal

Critical:
- Statistics.tsx: only commit statusFilter on successful fetch to prevent desync;
  show loading indicator and error message on failure
- SponsorsApplicationsTable.tsx: wrap JSON.parse(localStorage) in try/catch to
  prevent crash on corrupted data; remove `table` from useEffect deps to prevent
  re-initialization on every render
- getApplicationsForSponsors + applicationList: move createFormValuesObject spread
  before named properties so id/email/status can never be overwritten by a form
  field with a colliding label

Major:
- getApplicationStatistics: replace separate status DB lookup with Prisma relation
  filter (eliminates extra round-trip and silent filter-drop on missing status row)
- statistics/page.tsx: add NaN guard on hackathonId before calling getter
- getApplicationsForSponsors: add sponsor hackathon ownership check so a sponsor
  cannot access another hackathon's applications; fix misleading error messages
  to identify which status is missing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- route.ts: format validStatuses array with trailing comma
- statistics/page.tsx: inline Statistics JSX to match prettier line length
- DashboardTabs.tsx: break statistics path check to new line
- Statistics.tsx: format onChange handler across multiple lines
- SponsorsApplicationsTable.tsx: break long label text to new line
- getApplicationStatistics.ts: format Map generic type, replace non-null
  assertion with safe stepEntry guard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s to v4

- statistics/page.tsx: remove wrapping parens from single-element return (prettier)
- e2e.yml: upload-artifact@v3 -> v4, setup-node@v3 -> v4
- unit.yml: setup-node@v3 -> v4
- static-checks.yml: setup-node@v3 -> v4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ubuntu 24.04 (Noble) no longer provides libasound2, libffi7, and libx264-163
which the current Playwright version requires for browser installation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MatejMa2ur MatejMa2ur merged commit 31c89fd into main Apr 16, 2026
4 checks passed
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.

1 participant