Skip to content

feat: direct join-us button to a new page. Install react hook form.#49

Merged
rebeccafitzpatr merged 26 commits into
mainfrom
join-us-front-end
May 10, 2026
Merged

feat: direct join-us button to a new page. Install react hook form.#49
rebeccafitzpatr merged 26 commits into
mainfrom
join-us-front-end

Conversation

@TheSKBroook
Copy link
Copy Markdown

@TheSKBroook TheSKBroook commented Apr 29, 2026

Pull Request Summary

Title

Create a Join-us Page and a registration-form components, while adding validation and test.

Overview

This branch focuses on the registration form used for the "Join Us" flow. It improves how the form reacts to university selection changes, tightens validation, connects the form to Supabase correctly, and adds test coverage for the major behaviors.

What Changed

Form behavior

  • Made the university-dependent fields react properly when the university changes ( see below )
image
- Clear hidden fields back to `null` when the user switches university type.

Validation

  • Add form schema and Enums ( Degree, Year, University )
  • Added user-friendly validation messages for required fields.
  • Ensured UOA, AUT, and Other university paths require the correct fields.
    • example: Selecting Other in University field cannot have University_Other to be null.

Supabase integration

  • Connected the email-exists check to the is_email_registered RPC function.
    • I made a Remote Procedure Call in supabase so that the check is done my database side, preventing public user accessed the entire email list.
  • Create a server folder and kept registration submission routed through the RegistrationService.

Tests

  • Added and updated Vitest / Testing Library coverage for:
    • initial render
    • university-specific conditional fields
    • numeric-only Student ID input
    • clearing fields when changing university
    • validation on missing inputs
    • email taken / email available submission flows

Testing

  • bun vitest run src/components/test/registration-form.test.tsx

Improvement for later

  • Increase Scalability by using tanstack query
  • Create a successful submission page or customize the alert

Relevant Files

  • src/app/pages/join-us/page.tsx
  • src/components/registration-form.tsx
  • src/components/test/registration-form.test.tsx
  • src/lib/schemas/registration.ts
  • src/services/registrations/registrations-service.tsx

Some Images

image image image image

@TheSKBroook TheSKBroook linked an issue Apr 29, 2026 that may be closed by this pull request
6 tasks
@rebeccafitzpatr
Copy link
Copy Markdown
Collaborator

rebeccafitzpatr commented May 6, 2026

I like the dynamic change when selecting different uni !!
However, the Id field is an integer and has increment arrows -- not suitable . Potential fix: switch this out for plain string entry field and limit input to just characters ( 0-9 )

Also add text input field for 'Other' Faculty

image

@TheSKBroook TheSKBroook marked this pull request as ready for review May 8, 2026 01:56
@rebeccafitzpatr rebeccafitzpatr merged commit b28fa0b into main May 10, 2026
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.

WEB3-021: Join Us — Frontend Page

2 participants