Skip to content

Adds conditional rendering of adhoc registration - #289

Merged
Sowmiya07 merged 13 commits into
mainfrom
feat/adhoc-registration
Jul 1, 2026
Merged

Adds conditional rendering of adhoc registration#289
Sowmiya07 merged 13 commits into
mainfrom
feat/adhoc-registration

Conversation

@Sowmiya07

@Sowmiya07 Sowmiya07 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Description

Summary

  • Single registration page now supports both long-term and ad-hoc cycles via IS_ADHOC_CYCLE constant — no new routes
  • Mentor fetch filtered by cycle type using ?mentorshipTypes=Ad-Hoc or ?mentorshipTypes=Long-Term

Changes

  • IS_ADHOC_CYCLE constant added to mentorshipConstants.ts to toggle cycle type
  • Schema: superRefine enforces mentorshipFocus ≥ 1 for all types; availableHsMonth ≥ 2 for long-term only and availableHsMonth > 1 for adhoc; adhocMenteeFormDefaultValues exported with Mentorship Type
  • Step 1: hides available hours field for ad-hoc; removes mentorship type radio (driven by constant)
  • Step 2: shows ad-hoc description variant; fixed duplicate error messages from child components
  • Registration page: conditional step validation, breadcrumb, success message, and mentor fetch param per cycle type
  • Tests: new menteeSchema.test.ts for conditional validation; adhoc suite added to page tests
  • Adds isWomen dropdown to Form

Type

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

Related Issue

Screenshots

Registration Open and Its Long Term
image

Correct Available Hours validation
Mentorship Type is not shown
image

Dual Validation message not shown
image

Show only cycle relevant mentors
image
image
image

Adhoc

image image image image

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

@nora-weisser

Copy link
Copy Markdown
Contributor

@Sowmiya07 , would it be possible to exclude mentor from the dropdown if he/she has been chosen as another priority?
Screenshot 2026-06-25 at 22 01 05

@nora-weisser

Copy link
Copy Markdown
Contributor

@Sowmiya07 , while testing I hit this problem of providing memberType: "memberTypes: At least one member type must be provided (e.g., Member, Volunteer, etc.)¨
Screenshot 2026-06-25 at 22 03 09
It is a blocker for submitting the application.

@Sowmiya07

Copy link
Copy Markdown
Contributor Author

@nora-weisser Exclusion of mentor, we can pickup later. I am afraid we don't have enough time now.

I tried submitting mentee registration and its working fine for me. I am testing with current main version. Can you please check if the backend code is up-to-date?

image

@nora-weisser

Copy link
Copy Markdown
Contributor

I think that "Available hours per month" can be confusing for ad-hoc, as they will commit only 1 hour per month per 1 mentor. They have one-off session. Would be good to give it a thought and see if we can send 3 hrs in the payload, if the mentee applied for 3 mentors in the cycle. What do you think? @Sowmiya07

@IrynaLypnyk IrynaLypnyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved from my side. I reviewed the main ad-hoc registration changes and they look aligned with what was discussed in the call. The NOSONAR/cognitive complexity refactor and backend-driven available mentors logic can be tracked as follow-up improvements.

I checked the failing CI. The failure seems to be in MenteeRegistrationPage.test.tsx because window.scrollTo is not implemented in jsdom. This looks related to the test environment rather than the production flow, but it would be good to mock/fix it before merging.

@dricazenck dricazenck 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.

Please have a look in failing test, once is fixed I think all good to be merged.


<Grid item xs={12}>
<FormControl>
{!isAdhoc && (

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.

this change break the test, so please update the tests, because it is based on the ad-hoc and it won't be showing this attribute anymore, please also update the screenshot with the latest changes.

Here it is the details of the test that is failing
Image

@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@Sowmiya07
Sowmiya07 merged commit 84f0a68 into main Jul 1, 2026
4 of 5 checks passed
@Sowmiya07
Sowmiya07 deleted the feat/adhoc-registration branch July 1, 2026 10:16
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.

5 participants