Scheduling infrastructure for absolutely everyone.
[CAL-211] Confirmed booking page for rescheduled event should show previous time and reschedule reason (#5369)
GitStart2a0b0be9d0a2
diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsxindex f27a2a36f46..a8f90b0f1b7 100644--- a/apps/web/components/booking/pages/BookingPage.tsx+++ b/apps/web/components/booking/pages/BookingPage.tsx@@ -143,6 +143,7 @@ const BookingPage = ({isSuccessBookingPage: true,email: bookingForm.getValues("email"),eventTypeSlug: eventType.slug,+ formerTime: booking?.startTime.toString(),},});},@@ -158,6 +159,7 @@ const BookingPage = ({allRemainingBookings: true,email: bookingForm.getValues("email"),eventTypeSlug: eventType.slug,+ formerTime: booking?.startTime.toString(),},});},diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsxindex ce9f890cf33..6a39a2db207 100644--- a/apps/web/pages/booking/[uid].tsx+++ b/apps/web/pages/booking/[uid].tsx@@ -168,6 +168,7 @@ const querySchema = z.object({changes: stringToBoolean,reschedule: stringToBoolean,isSuccessBookingPage: z.string().optional(),+ formerTime: z.string().optional(),});export default function Success(props: SuccessProps) {@@ -179,6 +180,7 @@ export default function Success(props: SuccessProps) {isSuccessBookingPage,cancel: isCancellationMode,changes,+ formerTime,} = querySchema.parse(router.query);if ((isCancellationMode || changes) && typeof window !== "undefined") {@@ -425,9 +427,11 @@ export default function Success(props: SuccessProps) {<p className="text-neutral-600 dark:text-gray-300">{getTitle()}</p></div><div className="border-bookinglightest text-bookingdark dark:border-darkgray-300 mt-8 grid grid-cols-3 border-t pt-8 text-left dark:text-gray-300">- {isCancelled && cancellationReason && (+ {(isCancelled || reschedule) && cancellationReason && (<>- <div className="font-medium">{t("reason")}</div>+ <div className="font-medium">+ {isCancelled ? t("reason") : t("reschedule_reason_success_page")}+ </div><div className="col-span-2 mb-6 last:mb-0">{cancellationReason}</div></>)}@@ -435,6 +439,19 @@ export default function Success(props: SuccessProps) {<div className="col-span-2 mb-6 last:mb-0">{eventName}</div><div className="font-medium">{t("when")}</div><div className="col-span-2 mb-6 last:mb-0">+ {reschedule && !!formerTime && (+ <p className="line-through">+ <RecurringBookings+ eventType={props.eventType}+ duration={calculatedDuration}+ recurringBookings={props.recurringBookings}+ allRemainingBookings={allRemainingBookings}+ date={dayjs(formerTime)}+ is24h={is24h}+ isCancelled={isCancelled}+ />+ </p>+ )}<RecurringBookingseventType={props.eventType}duration={calculatedDuration}@@ -790,10 +807,10 @@ export function RecurringBookings({{eventType.recurringEvent?.count &&recurringBookingsSorted.slice(0, 4).map((dateStr: string, idx: number) => (<div key={idx} className={classNames("mb-2", isCancelled ? "line-through" : "")}>- {dayjs.tz(dateStr, timeZone()).format("MMMM DD, YYYY")}+ {dayjs.tz(dateStr, timeZone()).format("dddd, DD MMMM YYYY")}<br />- {formatTime(dateStr, is24h ? 24 : 12, timeZone())} -{" "}- {formatTime(dayjs(dateStr).add(duration, "m"), is24h ? 24 : 12, timeZone())}{" "}+ {formatTime(dateStr, is24h ? 24 : 12, timeZone().toLowerCase())} -{" "}+ {formatTime(dayjs(dateStr).add(duration, "m"), is24h ? 24 : 12, timeZone().toLowerCase())}{" "}<span className="text-bookinglight">({timeZone()})</span></div>))}@@ -808,10 +825,10 @@ export function RecurringBookings({{eventType.recurringEvent?.count &&recurringBookingsSorted.slice(4).map((dateStr: string, idx: number) => (<div key={idx} className={classNames("mb-2", isCancelled ? "line-through" : "")}>- {dayjs.tz(dateStr, timeZone()).format("MMMM DD, YYYY")}+ {dayjs.tz(dateStr, timeZone()).format("dddd, DD MMMM YYYY")}<br />- {formatTime(dateStr, is24h ? 24 : 12, timeZone())} -{" "}- {formatTime(dayjs(dateStr).add(duration, "m"), is24h ? 24 : 12, timeZone())}{" "}+ {formatTime(dateStr, is24h ? 24 : 12, timeZone().toLowerCase())} -{" "}+ {formatTime(dayjs(dateStr).add(duration, "m"), is24h ? 24 : 12, timeZone().toLowerCase())}{" "}<span className="text-bookinglight">({timeZone()})</span></div>))}@@ -824,10 +841,10 @@ export function RecurringBookings({return (<div className={classNames(isCancelled ? "line-through" : "")}>- {dayjs.tz(date, timeZone()).format("MMMM DD, YYYY")}+ {dayjs.tz(date, timeZone()).format("dddd, DD MMMM YYYY")}<br />- {formatTime(date, is24h ? 24 : 12, timeZone())} -{" "}- {formatTime(dayjs(date).add(duration, "m"), is24h ? 24 : 12, timeZone())}{" "}+ {formatTime(date, is24h ? 24 : 12, timeZone().toLowerCase())} -{" "}+ {formatTime(dayjs(date).add(duration, "m"), is24h ? 24 : 12, timeZone().toLowerCase())}{" "}<span className="text-bookinglight">({timeZone()})</span></div>);diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.jsonindex 62f11e2a535..50536e5666f 100644--- a/apps/web/public/static/locales/en/common.json+++ b/apps/web/public/static/locales/en/common.json@@ -1395,6 +1395,7 @@"attendee_email_info": "The person booking's email","kbar_search_placeholder": "Type a command or search...","invalid_credential": "Oh no! Looks like permission expired or was revoked. Please reinstall again.",+ "reschedule_reason_success_page": "Reschedule reason","choose_common_schedule_team_event": "Choose a common schedule","choose_common_schedule_team_event_description": "Enable this if you want to use a common schedule between hosts. When disabled, each host will be booked based on their default schedule.","reason": "Reason",