feat(fixed-hosts): pick first host as organizer for collective events or round robbin with fixed hosts#28718
feat(fixed-hosts): pick first host as organizer for collective events or round robbin with fixed hosts#28718bandhan-majumder wants to merge 3 commits intocalcom:mainfrom
Conversation
… or round robbin with fixed hosts
| )}> | ||
| {option.label} | ||
| {option.isOrganizer && ( | ||
| <span className="text-subtle ml-1 text-xs">({t("default_organizer")})</span> |
There was a problem hiding this comment.
calling this default organizer instead of organizer because of this line
this tells that if the request has a teamMemberEmail field, then the exact member will be the organizer. and if not, then we can pick the organizer of the event among the hosts as organizer if exists.
|
One improvement that can be done is immediately showing the |
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
📝 WalkthroughWalkthroughThis pull request introduces an 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/features/users/lib/getRoutedUsers.ts (1)
174-183:⚠️ Potential issue | 🟡 MinorMissing
groupIdproperty in fallback hosts.The fallback hosts in
getNormalizedHostsWithDelegationCredentialsdon't includegroupId, while the equivalent code ingetNormalizedHosts(line 131) includesgroupId: null. This inconsistency could cause issues if downstream code expectsgroupIdto be present.🔧 Suggested fix
const hostsWithoutDelegationCredential = eventType.users.map((user, index) => { return { isFixed: !eventType.schedulingType || eventType.schedulingType === SchedulingType.COLLECTIVE, isOrganizer: index === 0, email: user.email, user: user, createdAt: null, + groupId: null, }; });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/features/users/lib/getRoutedUsers.ts` around lines 174 - 183, The fallback host objects created in getRoutedUsers.ts (in the else branch that builds hostsWithoutDelegationCredential) are missing the groupId property; update the object returned in hostsWithoutDelegationCredential to include groupId: null so it matches the shape produced by getNormalizedHosts (and by getNormalizedHostsWithDelegationCredentials), ensuring downstream code expecting groupId will not break.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/features/users/lib/getRoutedUsers.ts`:
- Around line 174-183: The fallback host objects created in getRoutedUsers.ts
(in the else branch that builds hostsWithoutDelegationCredential) are missing
the groupId property; update the object returned in
hostsWithoutDelegationCredential to include groupId: null so it matches the
shape produced by getNormalizedHosts (and by
getNormalizedHostsWithDelegationCredentials), ensuring downstream code expecting
groupId will not break.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6f1d3839-b3a0-4c1b-8259-a1b63a4cf407
📒 Files selected for processing (14)
apps/web/modules/event-types/components/AddMembersWithSwitch.tsxapps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTab.tsxpackages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.tspackages/features/bookings/lib/handleNewBooking/loadUsers.tspackages/features/bookings/lib/service/RegularBookingService.tspackages/features/eventtypes/components/CheckedTeamSelect.tsxpackages/features/eventtypes/lib/types.tspackages/features/eventtypes/repositories/eventTypeRepository.tspackages/features/users/lib/getRoutedUsers.tspackages/i18n/locales/en/common.jsonpackages/prisma/migrations/20260403021738_add_is_organizer_to_host/migration.sqlpackages/prisma/schema.prismapackages/trpc/server/routers/viewer/eventTypes/heavy/update.handler.tspackages/trpc/server/routers/viewer/eventTypes/types.ts
What does this PR do?
For collective events or round robin with fixed hosts, it sets first host is the default organizer. This adds a new attribute
isOrganizerfor thehostentity to which isfalseby defaultVisual Demo (For contributors especially)
Video Demo (if applicable):
organizer.mp4
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist