fix(frontend): make the participants View link reach a real page - #172
Merged
Conversation
Every "View" button on the participants card view was dead. The card
defaults profileDetailsHref to '#', and the participants page passed
"#participant-{id}" — a same-page anchor to an element that exists
nowhere on the page, so every click went nowhere.
"View" is meant to open that participant's registration answers
(affiliation, diet, skills) — what an organizer needs for catering and
check-in. GetRegistrationResponse already serves this: it takes an
optional user_id and requires hackathon Write to read someone else's,
so the backend already gates it. The self-service /register/[id] route
already renders exactly this data (the caller's own, editable), so the
fix extends it rather than adding a route:
- /register/[id] takes an optional ?userId=. When present it fetches
that person's answers, renders them read-only (no submit, disabled
consent boxes), and titles the page with their name (read off the
members already in hackathon.get). A not-yet-submitted target shows
"No response yet." rather than a blank form. Permission is left to
the backend: PERMISSION_DENIED -> 403, NOT_FOUND -> 404, per the
usual error-translation convention.
- The participants page points "View" at /register/{id} for your own
row (editable, no userId) and /register/{id}?userId={id} for others,
and — matching how every organizer-only action here is hidden rather
than left to fail — offers the cross-participant link only to
managers, since a plain member would deterministically 403.
- ParticipantCard omits the link entirely when no href is given.
No backend or proto change: the RPC and its permission check already
existed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The View button on every card in the hackathon participants page was dead.
ParticipantCarddefaultsprofileDetailsHrefto'#', and the participants page passed#participant-{id}— a same-page anchor to an element that exists nowhere on the page — so every click went nowhere.View is meant to open that participant's registration answers (affiliation, diet, skills) — the data an organizer needs for catering and check-in. The backend already fully supports this:
HackathonService.GetRegistrationResponsetakes an optionaluser_id, returns the caller's own answers when absent, and requires hackathonWrite(organizer) to read anyone else's — elsePermissionDenied. The self-service/register/[id]route already renders exactly this data for the caller (editable, pre-filled), so this extends that route rather than adding a new one or a new RPC.Changes
/register/[id]now accepts an optional?userId=. When present it fetches that person's answers viagetRegistrationResponse({ hackathonId, userId }), renders them read-only (values as text, consent boxes shown but disabled, no submit button), and titles the page with the target's name (read off the members already returned byhackathon.get— no new RPC). A not-yet-submitted target shows "No response yet." rather than a blank editable form. Permission is left entirely to the backend:PERMISSION_DENIED → 403,NOT_FOUND → 404, following the repo's error-translation convention./register/{id}for your own row (editable, no query param) and/register/{id}?userId={id}for others. It offers the cross-participant link only to managers (data.mayManage) — matching how every other organizer-only affordance on this page is hidden rather than left to fail, since a plain member clicking it would deterministically 403.ParticipantCardomits the View link entirely when noprofileDetailsHrefis given (the default is nowundefined, not'#').No backend or proto changes — the RPC and its permission check already existed.
Test plan
pnpm run check(svelte-check): 0 errors (5 pre-existing warnings in untouched files).no-navigation-without-resolveon the/dashboardlinks already inregister/+page.svelte).bobwho has a submitted form):hackagon-admin(organizer via global Admin): the participant card's View link resolves to/register/{id}?userId={bob}, navigates, and renders bob's real answer read-only with no Save/Submit button./register/{id}?userId={bob}renders bob's answers read-only./register/{id}, nouserId) still shows the Save/Submit button.user_idgetsPermissionDenied(→ 403 in the UI).