-
Notifications
You must be signed in to change notification settings - Fork 11.6k
fix: filter segment members to only show those with host entries #26816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: filter segment members to only show those with host entries #26816
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…members-host-entries-1768366489
…bersWithSegmentPlatform` and remove the `assignAllTeamMembers` prop from `EditWeightsForAllTeamMembers`.
…ponent and pass a dynamic list of member IDs from AddMembersWithSwitch
…f github.com:calcom/cal.com into devin/filter-segment-members-host-entries-1768366489
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 4 files
joeauyeung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'm not a huge fan of how hosts are loaded into the event type settings pages so I think we should reconsider how this works later.
Merge activity
|
What does this PR do?
Fixes a bug where the UI shows team members who match segment criteria even when they don't have host entries in the database. When
assignAllTeamMembersistrueand segment filtering is enabled, members would appear in the Assignment tab but wouldn't actually be assigned during booking because they lack host entries.The Problem:
EditWeightsForAllTeamMembersshort-circuited whenassignAllTeamMemberswas true, showing all segment-matching members regardless of whether they had host entrieshandleSavefunction only updates hosts that already exist in thevaluearray, filtering out members without host entriesThe Fix:
assignAllTeamMembersprop fromEditWeightsForAllTeamMemberscomponent entirely since the filtering should always check for existing host entriesEditWeightsForAllTeamMembers.tsxto always check for existing host entries in thevaluearrayfilterMemberIdsprop toSegmentcomponent to filter matching team members to only show those who are hosts of the event-typeAddMembersWithSwitchnow passes the list of non-fixed host user IDs to the Segment component viafilterMemberIdsMandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist
Human Review Checklist
EditWeightsForAllTeamMembersandSegmentcomponentsfilterMemberIdsprop is correctly passed throughAddMembersWithSwitch→MembersSegmentWithToggle→Segment→MatchingTeamMembersvalue.filter((host) => !host.isFixed).map((host) => host.userId)correctly extracts non-fixed host IDsLink to Devin run: https://app.devin.ai/sessions/3333b41226d0452e98ef7ac358511f5b
Requested by: @hariombalhara