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
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@calcom/atoms": minor
|
||||
---
|
||||
|
||||
booker atom: allow toggling org and team info when booking round robin
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 &&
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
? []
|
||||
|
||||
@@ -549,6 +549,7 @@ export const BookerPlatformWrapper = (
|
||||
hasValidLicense={true}
|
||||
isBookingDryRun={isBookingDryRun ?? routingParams?.isBookingDryRun}
|
||||
eventMetaChildren={props.eventMetaChildren}
|
||||
roundRobinHideOrgAndTeam={props.roundRobinHideOrgAndTeam}
|
||||
/>
|
||||
</AtomsWrapper>
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user