feat(surveys): member-facing survey discovery (Issue 1463) - #1474
Open
leahpeker wants to merge 4 commits into
Open
feat(surveys): member-facing survey discovery (Issue 1463)#1474leahpeker wants to merge 4 commits into
leahpeker wants to merge 4 commits into
Conversation
…on events Add GET /api/community/surveys/ (optional JWT): active public surveys for anonymous callers, public + members-only for authenticated members. Replace the event detail survey_slugs field with linked_surveys so the UI can render survey titles.
…vey links New /surveys screen lists active surveys the viewer can see and links each to /surveys/:slug. Adds a lowercase surveys entry to the menu, and the event detail links section now names each linked survey instead of a generic label.
…nder the file-size limit
…open
The new GET /api/community/surveys/ listed every active survey whose own
visibility allowed it, including ones linked to members-only, invite-only,
draft, or deleted events. A survey's title and description normally name its
event, and linked_event_id exposed the event UUID, so an anonymous caller
could enumerate events that GET /events/{id}/ would 404 or 403 for.
Gate the list on the linked event as well: anon sees only surveys with no
linked event or a public, non-draft one; members additionally see members-only
events. Unlinked surveys are unaffected.
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
GET /api/community/surveys/(optional JWT) lists active surveys: public only for anonymous callers, public + members-only for authenticated members. It lives on the same ninja router asPOST /surveys/— a GET registered on the public router never resolves past the POST./surveysscreen lists those surveys (title + description, lowercase) and links each to/surveys/:slug; added asurveysentry to the menu sheet and a row to.claude/docs/routes.md.linked_surveys(id/title/slug, active only) in place ofsurvey_slugs, so the links card names each linked survey instead of showing a generic "give feedback".Closes #1463
Test plan
tests/test_surveys_public.py::TestSurveyListPubliccovers anon vs member visibility, inactive exclusion, andlinked_event_idsrc/screens/surveys/SurveysScreen.test.tsxcovers loading, error, empty, link targets, and the anon prompt/surveys(public only), log in and reload (members-only appear), open an event with a linked survey and check the links cardCI note
Locally
make agent-*runs against per-worktree SQLite, so 7 pre-existing tests fail for environmental reasons and are unrelated to this change:tests/test_sse.py(needspg_notify),tests/test_rsvp_capacity_race.pyandtests/test_poll_finalize_race.py(need realselect_for_updaterow locking). Everything else in the ladder passes: lint, check, typecheck, complexity, check-codes, and the full frontend suite (1287 passed).