Skip to content

Scheduling infrastructure for absolutely everyone.

feat: toggle round robin org and team info in booker (#22956)

Lauris Skraucisd18e23378b69
diff --git a/.changeset/shaggy-goats-flash.md b/.changeset/shaggy-goats-flash.md
new file mode 100644
index 00000000000..329a06e23f0
--- /dev/null
+++ b/.changeset/shaggy-goats-flash.md
@@ -0,0 +1,5 @@
+---
+"@calcom/atoms": minor
+---
+
+booker atom: allow toggling org and team info when booking round robin
diff --git a/docs/platform/atoms/booker.mdx b/docs/platform/atoms/booker.mdx
index 0a980ec1bf8..e6a2e52bd91 100644
--- a/docs/platform/atoms/booker.mdx
+++ b/docs/platform/atoms/booker.mdx
@@ -126,6 +126,7 @@ Below is a list of props that can be passed to the booker atom.
| confirmButtonDisabled | No | Boolean indicating if the submit button should be disabled, defaults to false. |
| timeZones | No | Array of valid IANA timezones to be used in the booker. Eg. ["Asia/Kolkata", "Europe/London"] |
| onTimeslotsLoaded | No | Callback function triggered once the available timeslots have been fetched. |
+| 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. |
## Styling
diff --git a/packages/features/bookings/Booker/Booker.tsx b/packages/features/bookings/Booker/Booker.tsx
index 57580fa757b..1c6e4e16604 100644
--- a/packages/features/bookings/Booker/Booker.tsx
+++ b/packages/features/bookings/Booker/Booker.tsx
@@ -80,6 +80,7 @@ const BookerComponent = ({
confirmButtonDisabled,
timeZones,
eventMetaChildren,
+ roundRobinHideOrgAndTeam,
}: BookerProps & WrappedBookerProps) => {
const searchParams = useCompatSearchParams();
const isPlatformBookerEmbed = useIsPlatformBookerEmbed();
@@ -403,7 +404,8 @@ const BookerComponent = ({
isPlatform={isPlatform}
isPrivateLink={!!hashedLink}
locale={userLocale}
- timeZones={timeZones}>
+ timeZones={timeZones}
+ roundRobinHideOrgAndTeam={roundRobinHideOrgAndTeam}>
{eventMetaChildren}
</EventMeta>
{layout !== BookerLayouts.MONTH_VIEW &&
diff --git a/packages/features/bookings/Booker/components/EventMeta.tsx b/packages/features/bookings/Booker/components/EventMeta.tsx
index 3231274aae0..c5584653c05 100644
--- a/packages/features/bookings/Booker/components/EventMeta.tsx
+++ b/packages/features/bookings/Booker/components/EventMeta.tsx
@@ -54,6 +54,7 @@ export const EventMeta = ({
locale,
timeZones,
children,
+ roundRobinHideOrgAndTeam,
}: {
event?: Pick<
BookerEvent,
@@ -90,6 +91,7 @@ export const EventMeta = ({
locale?: string | null;
timeZones?: Timezone[];
children?: React.ReactNode;
+ roundRobinHideOrgAndTeam?: boolean;
}) => {
const { timeFormat, timezone } = useBookerTime();
const [setTimezone] = useTimePreferences((state) => [state.setTimezone]);
@@ -167,6 +169,7 @@ export const EventMeta = ({
profile={event.profile}
entity={event.entity}
isPrivateLink={isPrivateLink}
+ roundRobinHideOrgAndTeam={roundRobinHideOrgAndTeam}
/>
<EventTitle className={`${classNames?.eventMetaTitle} my-2`}>
{translatedTitle ?? event?.title}
diff --git a/packages/features/bookings/Booker/types.ts b/packages/features/bookings/Booker/types.ts
index bd025901598..45748a81384 100644
--- a/packages/features/bookings/Booker/types.ts
+++ b/packages/features/bookings/Booker/types.ts
@@ -140,11 +140,13 @@ export type WrappedBookerPropsForPlatform = WrappedBookerPropsMain & {
verifyCode: undefined;
customClassNames?: CustomClassNames;
timeZones?: Timezone[];
+ roundRobinHideOrgAndTeam?: boolean;
};
export type WrappedBookerPropsForWeb = WrappedBookerPropsMain & {
isPlatform: false;
verifyCode: UseVerifyCodeReturnType;
timeZones?: Timezone[];
+ roundRobinHideOrgAndTeam?: boolean;
};
export type WrappedBookerProps = WrappedBookerPropsForPlatform | WrappedBookerPropsForWeb;
diff --git a/packages/features/bookings/components/event-meta/Members.tsx b/packages/features/bookings/components/event-meta/Members.tsx
index e71260af508..cf001f4d2b5 100644
--- a/packages/features/bookings/components/event-meta/Members.tsx
+++ b/packages/features/bookings/components/event-meta/Members.tsx
@@ -18,6 +18,7 @@ export interface EventMembersProps {
profile: BookerEvent["profile"];
entity: BookerEvent["entity"];
isPrivateLink: boolean;
+ roundRobinHideOrgAndTeam?: boolean;
}
export const EventMembers = ({
@@ -26,6 +27,7 @@ export const EventMembers = ({
profile,
entity,
isPrivateLink,
+ roundRobinHideOrgAndTeam,
}: EventMembersProps) => {
const username = useBookerStore((state) => state.username);
const isDynamic = !!(username && username.indexOf("+") > -1);
@@ -40,6 +42,10 @@ export const EventMembers = ({
!users.length ||
(profile.name !== users[0].name && schedulingType === SchedulingType.COLLECTIVE);
+ if (schedulingType === SchedulingType.ROUND_ROBIN && roundRobinHideOrgAndTeam) {
+ return <div className="h-6" />;
+ }
+
const orgOrTeamAvatarItem =
isDynamic || (!profile.image && !entity.logoUrl) || !entity.teamSlug
? []
diff --git a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
index 9de9a0d0259..84ee9e2fa09 100644
--- a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
+++ b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx
@@ -549,6 +549,7 @@ export const BookerPlatformWrapper = (
hasValidLicense={true}
isBookingDryRun={isBookingDryRun ?? routingParams?.isBookingDryRun}
eventMetaChildren={props.eventMetaChildren}
+ roundRobinHideOrgAndTeam={props.roundRobinHideOrgAndTeam}
/>
</AtomsWrapper>
);
diff --git a/packages/platform/atoms/booker/types.ts b/packages/platform/atoms/booker/types.ts
index e10542fd895..44bab500a40 100644
--- a/packages/platform/atoms/booker/types.ts
+++ b/packages/platform/atoms/booker/types.ts
@@ -84,6 +84,7 @@ export type BookerPlatformWrapperAtomProps = Omit<
eventMetaChildren?: React.ReactNode;
onTimeslotsLoaded?: (slots: Record<string, Slot[]>) => void;
startTime?: string | Date;
+ roundRobinHideOrgAndTeam?: boolean;
};
type VIEW_TYPE = keyof typeof BookerLayouts;
diff --git a/packages/platform/examples/base/src/pages/booking.tsx b/packages/platform/examples/base/src/pages/booking.tsx
index c6152e45f93..93ac6a7fb46 100644
--- a/packages/platform/examples/base/src/pages/booking.tsx
+++ b/packages/platform/examples/base/src/pages/booking.tsx
@@ -93,6 +93,7 @@ export default function Bookings(props: { calUsername: string; calEmail: string
<Booker
// timeZones={["Europe/London", "Asia/Kolkata"]}
// isBookingDryRun={true}
+ // roundRobinHideOrgAndTeam={true}
bannerUrl="https://i0.wp.com/mahala.co.uk/wp-content/uploads/2014/12/img_banner-thin_mountains.jpg?fit=800%2C258&ssl=1"
eventSlug={eventTypeSlug}
onCreateBookingSuccess={(data) => {