Skip to content

Yearly forms engine + VIS: editor, fill page, answers, checklist (#844) - #894

Merged
mbhewitt merged 3 commits into
mainfrom
feat/forms
Nov 29, 2026
Merged

mbhewitt merged 3 commits into
mainfrom
feat/forms

Conversation

@mbhewitt

@mbhewitt mbhewitt commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Roadmap item 10, first slice. Refs #844. Builds the shared form engine plus the VIS. Camping (#845), Ticketing (#846) and the Driver application reuse it next, with invite lists and decision screens.

Built to Mew's answers (2026-11-27 and 2026-11-29): forms are authored in the app; each year is independent; draft → leadership review → publish; everyone gets the VIS; ranking questions; answers can be changed until the form closes; a FormEditor role (Mew, Rescue, Chipper, Random), and that same group, not all admins, sees the answers; roles are assigned from the answers by a person, never automatically; no import of earlier years.

Migration 032

Pages

  • /forms (FormEditor): every form, with Preview, Answers and (for SuperAdmin / FormEditor) Edit, plus "New form". A new year's draft copies the questions from the latest earlier year with the same short name.
  • /forms/N/edit: title, intro (the rich-text editor), open/close dates, and the questions. Questions can be added, reordered and removed. Then Save, Preview, and Publish / Back to draft.
    • Question types: short answer, long answer, pick one, pick any, yes/no, 1–5, rank in order, and a text-only block. Pick one and pick any can also offer "Other: ___".
  • /forms/N: the fill page. There are no identity questions, since the volunteer is signed in. Form editors can preview a draft here, and that preview is the review step.
  • /forms/N/answers (FormEditor):
    • totals per question (for ranking, how many put each option first);
    • filter people by an answer;
    • CSV download;
    • tick people, then Add role (uses the existing role endpoint).
  • Checklist: every open form is a checklist item, done once it's submitted.

Not in this PR

  • The VIS email (Mew: discuss later). The form can go out without it.
  • Invite lists and the Camping / Ticketing / Driver decision screens.
  • Locking questions after publish. Questions stay editable for now; answers are keyed by question id, so a removed question's answers stay in the CSV.
  • The Forms menu link is in the admin menu. A FormEditor who isn't an admin can still use /forms directly.

Tests

New e2e/tests/39-forms.spec.ts has two tests:

  • API: permissions; drafts hidden from volunteers; publish; validation (required answers, choices, Other, ranking, blank choices dropped); the admin answers view; a closed form refuses changes; next year's form copies the questions.
  • UI: a volunteer opens the form from the checklist, fills it in (Other, pick any, ranking) and submits.

Locally, 39 plus 32 (row history / changed_by guard) and 38 pass.

🤖 Generated with Claude Code

mbhewitt and others added 3 commits November 29, 2026 01:20
Mew 2026-11-27/29: forms are authored in the app, each year independent,
draft -> leadership review (preview) -> publish.
- migration 032: op_forms (questions as JSON, one row per slug+year) and
  op_form_responses, both system-versioned with changed_by; FormEditor role
- /forms list (admins), editor (SuperAdmin / FormEditor), fill page,
  answers page: per-question totals, filter by answer, CSV, tick people
  then Add role (never automatic)
- question types: short/long answer, pick one, pick any, yes/no, 1-5,
  ranking, text-only block; "Other: ___" on pick one / pick any
- every open form is a checklist item; answers editable until it closes;
  a new year's draft copies the latest earlier year's questions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mew: the people who edit forms are the ones who see the answers, for now.
Pages are open to signed-in users and the API enforces FormEditor, so a
FormEditor doesn't also need Admin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mbhewitt
mbhewitt merged commit f8b4fc1 into main Nov 29, 2026
1 check 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