Skip to content

feature: rsvp form customisation - #207

Open
GladwynChua wants to merge 3 commits into
mainfrom
feature/events-form-customisation
Open

GladwynChua wants to merge 3 commits into
mainfrom
feature/events-form-customisation

Conversation

@GladwynChua

Copy link
Copy Markdown
Contributor

What does this PR do?

create feature where rsvp form can be edited or add additional questions for specific event

Type of change

  • Feature
  • [] Bug fix
  • [] Chore / config
  • Hotfix

Checklist

  • My branch follows the naming convention (feature/, fix/, chore/, hotfix/)
  • My commit messages follow the conventional commits format
  • CI checks pass

Linked Issues

Closes #200
Addresses #

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ssa Ready Ready Preview Oct 19, 2026 3:39am UTC

@joengy joengy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for these massive changes Gladwyn, I left some comments for you to take a look at they shouldn't be anything too complex.

Comment thread cms/src/collections/Events.ts Outdated
Comment thread cms/src/collections/Events.ts
Comment thread cms/next.config.mjs Outdated
Comment thread cms/src/lib/eventRegistrationQuestions.ts
Comment thread cms/src/app/event-registration/route.ts Outdated
Comment thread cms/src/app/event-registration/route.ts Outdated

@joengy joengy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in review I was really busy last week wrapping up uni, only small comments left and it should be finished. TY for your work Gladwyn

({ doc }) => ({
...doc,
rsvpQuestions:
doc.rsvpQuestions ??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing events will show an empty RSVP form after this is deployed.

Suggested fix (pick one):

  • In the migration, add the default question rows for every existing event, or
  • Treat an empty list the same as "not set", e.g. doc.rsvpQuestions?.length ? doc.rsvpQuestions : DEFAULT.... (Admins can still hide questions with enabled, so nothing is lost by not allowing a truly empty list.)

}

const eventQuestions = event.rsvpQuestions
const questions = eventQuestions ?? [...DEFAULT_RSVP_QUESTIONS]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem as the afterRead comment in Events.ts: event.rsvpQuestions will be [] for events created before this deploy, not undefined, so ?? [...DEFAULT_RSVP_QUESTIONS] never kicks in. validateRsvpAnswers([], ...) then passes with no answers at all, so this route is the safety net that lets a registration through with no emergency contact.

If you go with the "empty means use defaults" fix, it should be applied here too (or better, only in one place, so the route and the hook can't disagree).

options?: Array<{ label: string; value: string } | null> | null
}

export const DEFAULT_RSVP_QUESTIONS: RsvpQuestion[] = [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestion, this is a second copy of the types and default questions in cms/src/lib/eventRegistrationQuestions.ts. If someone edits the defaults in the CMS (e.g. adds a university year option), this copy won't change with it.

Once the afterRead fix is in, the CMS always sends the questions with the event, so the web side only needs the type. Could we drop DEFAULT_RSVP_QUESTIONS here and the ?? DEFAULT_RSVP_QUESTIONS fallback in RsvpContent.tsx? Then there's only one list to maintain.

This branch was successfully deployed

1 active deployment
Preview — 8df41610 Deployed Oct 19, 2026 by vercel[bot]
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.

Event form customisation

2 participants