cal.com
cal.com copied to clipboard
feat: atoms team booking
Use dynamic bookings logic to simulate a team event using atoms booker.
For PlatformBookerWrapper to act as a team booking we need:
- username array containing usernames to book the booking with
- entity containing orgSlug
- duration of the event
<Booker
eventSlug={eventTypeSlug}
username={[
"npwruvxgpl-clujvibu30001khltnifvcca8-example",
"dpgobfhtli-Clujvibu30001khltnifvcca8-example",
]}
onCreateBookingSuccess={(data) => {
setBookingTitle(data.data.title);
router.push(`/${data.data.uid}`);
}}
duration={eventTypeDuration}
entity={{
orgSlug: "ecorp",
considerUnpublished: false,
}}
/>
❗ Forced slug - important to enable feature
When booking atom makes a booking, it calls v2 bookings.controller.ts which calls handleNewBooking.ts which calls loadUsers, which calls orgDomainConfig which returns orgSlug and if it's valid. The orgSlug is based on organization subdomain e.g. acme.cal.com, and is created so that someone booking acme organization does not book another organization.
Platform teams do not have subdomains, so we can enforce orgSlug that is necessary for handleNewBooking.ts to work by:
- Providing
x-cal-client-id
request header to note that request is coming from platform. - Providing
x-cal-force-slug
request header as a way to pass the enforced orgSlug, which is passed to Booker atom via "entity.orgSlug prop".
Implemented in fix: force platform orgSlug in handleNewBooking.ts and confirmed with Hariom that approach of client ID + enforced slug as headers is fine.
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
platform-starter-kit | ❌ Failed (Inspect) | May 7, 2024 0:07am |
5 Ignored Deployments
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
ai | ⬜️ Ignored (Inspect) | Visit Preview | May 7, 2024 0:07am | |
cal | ⬜️ Ignored (Inspect) | Visit Preview | May 7, 2024 0:07am | |
calcom-web-canary | ⬜️ Ignored (Inspect) | Visit Preview | May 7, 2024 0:07am | |
qa | ⬜️ Ignored (Inspect) | Visit Preview | May 7, 2024 0:07am | |
qa-not-in-use | ⬜️ Ignored (Inspect) | Visit Preview | May 7, 2024 0:07am |
📦 Next.js Bundle Analysis for @calcom/web
This analysis was generated by the Next.js Bundle Analysis action. 🤖
This PR introduced no changes to the JavaScript bundle! 🙌
Current Playwright Test Results Summary
✅ 37 Passing - ⚠️ 2 Flaky
Run may still be in progress, this comment will be updated as current testing workflow or job completes...
(Last updated on 05/07/2024 12:49:40pm UTC)
Run Details
Running Workflow PR Update on Github Actions
Commit: 334811fb861d52f19ad8335a807ea572f15bfe88
Started: 05/07/2024 12:47:47pm UTC
⚠️ Flakes
📄 apps/web/playwright/profile.e2e.ts • 2 Flakes
Top 1 Common Error Messages
|
2 Test Cases Affected |
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Update Profile Can update a users email (verification enabled)
Retry 2 • Retry 1 • Initial Attempt |
19.81% (63)63 / 318 runsfailed over last 7 days |
32.39% (103)103 / 318 runsflaked over last 7 days |
Update Profile Newly added secondary email should show as Unverified
Retry 1 • Initial Attempt |
0.94% (3)3 / 319 runsfailed over last 7 days |
11.29% (36)36 / 319 runsflaked over last 7 days |
Graphite Automations
"Add consumer team as reviewer" took an action on this PR • (04/11/24)
1 reviewer was added to this PR based on Keith Williams's automation.
"Add platform team as reviewer" took an action on this PR • (04/11/24)
1 reviewer was added to this PR based on Keith Williams's automation.