Skip to content

Conversation

@MitaliShah
Copy link
Contributor

Description

Implements the frontend UI and Zod validation for the new Mentor Registration flow (Steps 1-5).

Changes

  • Tech Stack: Built a 5-step form using react-hook-form, zod, and MUI.
  • Validation: Added conditional logic for "Long-Term" vs "Ad-Hoc" tracks.
  • Styling: Used theme.ts for consistent branding.
  • Structure: Modularized each step into separate components for maintainability.

Notes

  • Submission: Logs JSON to console. API integration & Success screen will follow in a separate PR.

How to Test

  1. Go to /mentorship/mentor-registration.
  2. Complete the form, toggling between mentorship types to test validation.
  3. Click "Submit" on Step 5 and verify the JSON output in the console.

Type

  • Bug Fix
  • New Feature
  • Code Refactor
  • Documentation
  • Other

Related Issue

Closes #84

Screenshots

image image image image image

Testing

Pull request checklist

Please check if your PR fulfills the following requirements:

  • I checked and followed the contributor guide
  • I have tested my changes locally.
  • I have added a screenshot from the website after I tested it locally

<Grid container spacing={2}>
<Grid item xs={12} sm={6}>
<TextField select fullWidth label="Country" defaultValue="" {...register("country")} error={!!errors.country} helperText={errors.country?.message as string}>
<MenuItem value="United Kingdom">United Kingdom</MenuItem>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extracted country list to mentorshipConstants.ts

<RadioGroup {...field}>
<FormControlLabel value="linkedin" control={<Radio sx={{ '&.Mui-checked': { color: 'black' } }} />} label="Linked In" />
<FormControlLabel value="slack" control={<Radio sx={{ '&.Mui-checked': { color: 'black' } }} />} label="Slack" />
<FormControlLabel value="other" control={<Radio sx={{ '&.Mui-checked': { color: 'black' } }} />} label="Image link from a public profile" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

This are is duplicated in the form, from the screenshot. I think you can keep the second option when you add the link you want us to use. As the first step, but I need to adjust the backend, because now we are asking to upload the file, would that be too much problem for you do do? @stepsen89

Please check the mentor registration for to confirm the current attributes


<Box component="ul" sx={{ pl: 2, mb: 2, typography: 'body2', color: 'text.primary' }}>
<li style={{ marginBottom: '8px' }}>
Have read and agree to the <Link href="https://www.womencodingcommunity.com/code-of-conduct" target="_blank" rel="noopener noreferrer" underline="always" sx={{ color: 'custom.linkBlue' }}>code of conduct</Link>{' '} and the {' '}<Link href="https://www.womencodingcommunity.com/mentorship-code-of-conduct" target="_blank" rel="noopener noreferrer" underline="always" sx={{ color: 'custom.linkBlue' }}>mentorship code of conduct</Link>.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This URL needs to be dynamic or in the context of the website from code of conduct page of mentorship.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed from hardcoded external URLs to relative paths
Links now point to /code-of-conduct and /mentorship/code-of-conduct


else if (activeStep === 5) {
isStepValid = await formMethods.trigger([
'linkedin', 'github', 'instagram', 'medium', 'website', 'otherSocial',
Copy link
Collaborator

Choose a reason for hiding this comment

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

LinkedIn is the only mandatory attribute for social media.

isLongTermMentor: z.boolean().optional(),
isAdHocMentor: z.boolean().optional(),

maxMentees: z.string().optional(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please review the mentor registration to align with the requested and mandatory attributes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Image

- Update 'home.page.spec.ts' to assert the correct page title ('WCC: Registration Form for Mentors') following the UI from figma design.
- Fix a Next.js serialization error in timeline pages (e.g., 'long-term-timeline.tsx').
- Ensure 'getServerSideProps' returns 'null' instead of 'undefined' when API data is missing, preventing Status 500 crashes during the test run.
@sonarqubecloud
Copy link

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.

/mentorship/mentor-registration

2 participants