fix: exclude 0-hour ad-hoc availability from mentor cycle list (#726, #762) - #763
Open
yingliu-data wants to merge 1 commit into
Open
fix: exclude 0-hour ad-hoc availability from mentor cycle list (#726, #762)#763yingliu-data wants to merge 1 commit into
yingliu-data wants to merge 1 commit into
Conversation
Backend: MenteeSection.toDtoForCycle now drops ad-hoc entries with zero (or null) hours in addition to the existing month filter, so a mentor who declared a month with 0 hours no longer surfaces in that cycle's mentor list. Admin edit-mentor form: keep the month checkbox in sync with its hours (> 0 ticks it, 0 unticks it; unticking clears the hours) and submit only months with positive hours, so a 0-hour month is never saved as available in the first place. Closes #726 Closes #762
yingliu-data
requested review from
Sowmiya07,
Tooonia,
dricazenck,
goelsonali,
lauracabtay,
nora-weisser and
nverbic
July 4, 2026 12:30
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
A mentor who declared a month with 0 hours of ad-hoc availability was still surfaced in that cycle's public mentor list, because a ticked-but-zero-hour month was treated as real availability. This fixes it on both the backend (display) and the admin form (data entry).
Backend — exclude 0-hour availability from the cycle list
MenteeSection.toDtoForCyclenow drops ad-hoc entries with zero (or null) hours in addition to the existing current-month filter. A mentor whose only availability for the cycle month is 0 hours no longer derives theAD_HOCtype, so they are excluded from the ad-hoc mentor list. This also cleans up any existing 0-hour data.Admin (edit-mentor form) — keep the checkbox in sync with hours
In
admin-wcc-app'sMentorshipAvailabilitySection:transformFormDatasubmits only months withhours > 0, so a 0-hour month is never saved as available in the first place.Testing
GET /api/cms/v1/mentorship/mentors?mentorshipTypes=AD_HOC, while a mentor with July/3h remains.tsc,eslint, andprettierpass on the changed files.Closes
Related (not fixed here)
Part of the broader mentor availability / admin-form and mentors-display cluster: