Skip to content

Commit d18e233

Browse files
authored
feat: toggle round robin org and team info in booker (#22956)
* feat: toggle round robin booker org and team * chore: add changeset * dont hide in dev
1 parent 736f1f5 commit d18e233

File tree

9 files changed

+23
-1
lines changed

9 files changed

+23
-1
lines changed

.changeset/shaggy-goats-flash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@calcom/atoms": minor
3+
---
4+
5+
booker atom: allow toggling org and team info when booking round robin

docs/platform/atoms/booker.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Below is a list of props that can be passed to the booker atom.
126126
| confirmButtonDisabled | No | Boolean indicating if the submit button should be disabled, defaults to false. |
127127
| timeZones | No | Array of valid IANA timezones to be used in the booker. Eg. ["Asia/Kolkata", "Europe/London"] |
128128
| onTimeslotsLoaded | No | Callback function triggered once the available timeslots have been fetched. |
129+
| roundRobinHideOrgAndTeam | No | Boolean indicating if the organization and team should be hidden in the booker atom sidebar for round robin scheduling type, defaults to false. |
129130

130131
## Styling
131132

packages/features/bookings/Booker/Booker.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ const BookerComponent = ({
8080
confirmButtonDisabled,
8181
timeZones,
8282
eventMetaChildren,
83+
roundRobinHideOrgAndTeam,
8384
}: BookerProps & WrappedBookerProps) => {
8485
const searchParams = useCompatSearchParams();
8586
const isPlatformBookerEmbed = useIsPlatformBookerEmbed();
@@ -403,7 +404,8 @@ const BookerComponent = ({
403404
isPlatform={isPlatform}
404405
isPrivateLink={!!hashedLink}
405406
locale={userLocale}
406-
timeZones={timeZones}>
407+
timeZones={timeZones}
408+
roundRobinHideOrgAndTeam={roundRobinHideOrgAndTeam}>
407409
{eventMetaChildren}
408410
</EventMeta>
409411
{layout !== BookerLayouts.MONTH_VIEW &&

packages/features/bookings/Booker/components/EventMeta.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const EventMeta = ({
5454
locale,
5555
timeZones,
5656
children,
57+
roundRobinHideOrgAndTeam,
5758
}: {
5859
event?: Pick<
5960
BookerEvent,
@@ -90,6 +91,7 @@ export const EventMeta = ({
9091
locale?: string | null;
9192
timeZones?: Timezone[];
9293
children?: React.ReactNode;
94+
roundRobinHideOrgAndTeam?: boolean;
9395
}) => {
9496
const { timeFormat, timezone } = useBookerTime();
9597
const [setTimezone] = useTimePreferences((state) => [state.setTimezone]);
@@ -167,6 +169,7 @@ export const EventMeta = ({
167169
profile={event.profile}
168170
entity={event.entity}
169171
isPrivateLink={isPrivateLink}
172+
roundRobinHideOrgAndTeam={roundRobinHideOrgAndTeam}
170173
/>
171174
<EventTitle className={`${classNames?.eventMetaTitle} my-2`}>
172175
{translatedTitle ?? event?.title}

packages/features/bookings/Booker/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,13 @@ export type WrappedBookerPropsForPlatform = WrappedBookerPropsMain & {
140140
verifyCode: undefined;
141141
customClassNames?: CustomClassNames;
142142
timeZones?: Timezone[];
143+
roundRobinHideOrgAndTeam?: boolean;
143144
};
144145
export type WrappedBookerPropsForWeb = WrappedBookerPropsMain & {
145146
isPlatform: false;
146147
verifyCode: UseVerifyCodeReturnType;
147148
timeZones?: Timezone[];
149+
roundRobinHideOrgAndTeam?: boolean;
148150
};
149151

150152
export type WrappedBookerProps = WrappedBookerPropsForPlatform | WrappedBookerPropsForWeb;

packages/features/bookings/components/event-meta/Members.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface EventMembersProps {
1818
profile: BookerEvent["profile"];
1919
entity: BookerEvent["entity"];
2020
isPrivateLink: boolean;
21+
roundRobinHideOrgAndTeam?: boolean;
2122
}
2223

2324
export const EventMembers = ({
@@ -26,6 +27,7 @@ export const EventMembers = ({
2627
profile,
2728
entity,
2829
isPrivateLink,
30+
roundRobinHideOrgAndTeam,
2931
}: EventMembersProps) => {
3032
const username = useBookerStore((state) => state.username);
3133
const isDynamic = !!(username && username.indexOf("+") > -1);
@@ -40,6 +42,10 @@ export const EventMembers = ({
4042
!users.length ||
4143
(profile.name !== users[0].name && schedulingType === SchedulingType.COLLECTIVE);
4244

45+
if (schedulingType === SchedulingType.ROUND_ROBIN && roundRobinHideOrgAndTeam) {
46+
return <div className="h-6" />;
47+
}
48+
4349
const orgOrTeamAvatarItem =
4450
isDynamic || (!profile.image && !entity.logoUrl) || !entity.teamSlug
4551
? []

packages/platform/atoms/booker/BookerPlatformWrapper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ export const BookerPlatformWrapper = (
549549
hasValidLicense={true}
550550
isBookingDryRun={isBookingDryRun ?? routingParams?.isBookingDryRun}
551551
eventMetaChildren={props.eventMetaChildren}
552+
roundRobinHideOrgAndTeam={props.roundRobinHideOrgAndTeam}
552553
/>
553554
</AtomsWrapper>
554555
);

packages/platform/atoms/booker/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export type BookerPlatformWrapperAtomProps = Omit<
8484
eventMetaChildren?: React.ReactNode;
8585
onTimeslotsLoaded?: (slots: Record<string, Slot[]>) => void;
8686
startTime?: string | Date;
87+
roundRobinHideOrgAndTeam?: boolean;
8788
};
8889

8990
type VIEW_TYPE = keyof typeof BookerLayouts;

packages/platform/examples/base/src/pages/booking.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export default function Bookings(props: { calUsername: string; calEmail: string
9393
<Booker
9494
// timeZones={["Europe/London", "Asia/Kolkata"]}
9595
// isBookingDryRun={true}
96+
// roundRobinHideOrgAndTeam={true}
9697
bannerUrl="https://i0.wp.com/mahala.co.uk/wp-content/uploads/2014/12/img_banner-thin_mountains.jpg?fit=800%2C258&ssl=1"
9798
eventSlug={eventTypeSlug}
9899
onCreateBookingSuccess={(data) => {

0 commit comments

Comments
 (0)