diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx index b0ffea2ac6..194d39ceee 100644 --- a/apps/web/components/booking/BookingListItem.tsx +++ b/apps/web/components/booking/BookingListItem.tsx @@ -207,8 +207,8 @@ function BookingListItem(booking: BookingItemProps) { type: booking.eventType.id, eventSlug: booking.eventType.slug, user: user?.username || "", - name: booking.attendees[0].name, - email: booking.attendees[0].email, + name: booking.attendees[0] ? booking.attendees[0].name : undefined, + email: booking.attendees[0] ? booking.attendees[0].email : undefined, location: booking.location ? booking.location.includes("integration") ? (t("web_conferencing_details_to_follow") as string) @@ -218,6 +218,8 @@ function BookingListItem(booking: BookingItemProps) { bookingId: booking.id, recur: booking.recurringEventId, reschedule: booking.confirmed, + listingStatus: booking.listingStatus, + status: booking.status, }, }); }; diff --git a/apps/web/pages/success.tsx b/apps/web/pages/success.tsx index 0535ce609f..678166117a 100644 --- a/apps/web/pages/success.tsx +++ b/apps/web/pages/success.tsx @@ -148,7 +148,7 @@ type SuccessProps = inferSSRProps; export default function Success(props: SuccessProps) { const { t } = useLocale(); const router = useRouter(); - const { location: _location, name, reschedule, status } = router.query; + const { location: _location, name, reschedule, listingStatus, status } = router.query; const location = Array.isArray(_location) ? _location[0] : _location; const [is24h, setIs24h] = useState(isBrowserLocale24h()); const { data: session } = useSession(); @@ -176,6 +176,7 @@ export default function Success(props: SuccessProps) { const eventName = getEventName(eventNameObject); const needsConfirmation = eventType.requiresConfirmation && reschedule != "true"; + const isCancelled = status === "CANCELLED" || status === "REJECTED"; const telemetry = useTelemetry(); useEffect(() => { telemetry.withJitsu((jitsu) => @@ -238,6 +239,9 @@ export default function Success(props: SuccessProps) { function getTitle(): string { const titleSuffix = props.recurringBookings ? "_recurring" : ""; + if (isCancelled) { + return t("emailed_information_about_cancelled_event"); + } if (needsConfirmation) { if (props.profile.name !== null) { return t("user_needs_to_confirm_or_reject_booking" + titleSuffix, { @@ -298,25 +302,31 @@ export default function Success(props: SuccessProps) {
{giphyImage && !needsConfirmation && ( // eslint-disable-next-line @next/next/no-img-element {"Gif )} - {!giphyImage && !needsConfirmation && ( + {!giphyImage && !needsConfirmation && !isCancelled && ( )} - {needsConfirmation && } + {needsConfirmation && !isCancelled && ( + + )} + {isCancelled && }
-
{t("who")}
-
- {bookingInfo?.user && ( -
-

{bookingInfo.user.name}

-

{bookingInfo.user.email}

+ {(bookingInfo?.user || bookingInfo?.attendees) && ( + <> +
{t("who")}
+
+ {bookingInfo?.user && ( +
+

{bookingInfo.user.name}

+

{bookingInfo.user.email}

+
+ )} + {bookingInfo?.attendees.map((attendee, index) => ( +
+

{attendee.name}

+

{attendee.email}

+
+ ))}
- )} - {bookingInfo?.attendees.map((attendee, index) => ( -
-

{attendee.name}

-

{attendee.email}

-
- ))} -
+ + )} {location && ( <> -
{t("where")}
-
+
{t("where")}
+
{location.startsWith("http") ? ( {location} @@ -401,6 +415,7 @@ export default function Success(props: SuccessProps) {
{!needsConfirmation && + !isCancelled && (!isCancellationMode ? (
@@ -425,7 +440,7 @@ export default function Success(props: SuccessProps) { theme={userIsOwner ? "light" : props.profile.theme} /> ))} - {userIsOwner && !needsConfirmation && !isCancellationMode && ( + {userIsOwner && !needsConfirmation && !isCancellationMode && !isCancelled && (
{t("add_to_calendar")} @@ -591,7 +606,7 @@ type RecurringBookingsProps = { recurringBookings: SuccessProps["recurringBookings"]; date: dayjs.Dayjs; is24h: boolean; - status: string; + listingStatus: string; }; function RecurringBookings({ @@ -599,11 +614,11 @@ function RecurringBookings({ eventType, recurringBookings, date, - status, + listingStatus, }: RecurringBookingsProps) { const [moreEventsVisible, setMoreEventsVisible] = useState(false); const { t } = useLocale(); - return !isReschedule && recurringBookings && status === "upcoming" ? ( + return !isReschedule && recurringBookings && listingStatus === "upcoming" ? ( <> {eventType.recurringEvent?.count && recurringBookings.slice(0, 4).map((dateStr, idx) => ( diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index aed4952683..516cae00d9 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -867,8 +867,10 @@ "nevermind": "Nevermind", "go_to": "Go to: ", "zapier_invite_link": "Zapier Invite Link", + "meeting_url_provided_after_confirmed":"A Meeting URL will be created once the event is confirmed.", + "event_cancelled":"This event is cancelled", + "emailed_information_about_cancelled_event": "We emailed you and the other attendees to let them know.", "this_input_will_shown_booking_this_event": "This input will be shown when booking this event", - "meeting_url_provided_after_confirmed": "A Meeting URL will be created once the event is confirmed.", "meeting_url_in_conformation_email": "Meeting url is in the confirmation email", "url_start_with_https": "URL needs to start with http:// or https://", "number_provided": "Phone number will be provided" diff --git a/turbo.json b/turbo.json index ae353d1b56..fdf20fe6e8 100644 --- a/turbo.json +++ b/turbo.json @@ -105,7 +105,12 @@ "outputs": [".next/**"] }, "build": { - "dependsOn": ["^build", "@calcom/embed-core#build","@calcom/embed-react#build", "@calcom/embed-react#build"], + "dependsOn": [ + "^build", + "@calcom/embed-core#build", + "@calcom/embed-react#build", + "@calcom/embed-react#build" + ], "outputs": ["dist/**", ".next/**"] }, "db-deploy": {}, @@ -150,7 +155,7 @@ "dependsOn": ["@calcom/prisma#db-reset", "@calcom/web#test", "@calcom/web#build"] }, "type-check": { - "dependsOn": ["@calcom/embed-react#build","@calcom/embed-core#build", "@calcom/embed-snippet#build"], + "dependsOn": ["@calcom/embed-react#build", "@calcom/embed-core#build", "@calcom/embed-snippet#build"], "outputs": [] } }