From 7a9d291d1fcfa40e377aea9f3ff89e57dd48541b Mon Sep 17 00:00:00 2001 From: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:54:06 +0000 Subject: [PATCH] fix: handle cancelation reason when user is host (#18681) * handle cancelation reason when user is host * add attendee reason warning * add cancellation reason to tests when we are the host * req.body and not req * fix: isloggedIn logic * use new isLoggedInUser from ssr instead of client * update e2e tests to fill in reason when hosts --------- Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Udit Takkar Co-authored-by: Peer Richelsen --- apps/web/components/booking/CancelBooking.tsx | 14 +++++++++-- ...ookings-single-view.getServerSideProps.tsx | 23 +++++++++++++++---- .../bookings/views/bookings-single-view.tsx | 4 ++-- apps/web/playwright/booking-pages.e2e.ts | 3 +++ apps/web/playwright/booking-seats.e2e.ts | 4 ++++ .../playwright/dynamic-booking-pages.e2e.ts | 1 + apps/web/public/static/locales/en/common.json | 2 ++ .../bookings/lib/handleCancelBooking.ts | 7 ++++++ .../lib/handleSeats/test/handleSeats.test.ts | 3 +++ 9 files changed, 53 insertions(+), 8 deletions(-) diff --git a/apps/web/components/booking/CancelBooking.tsx b/apps/web/components/booking/CancelBooking.tsx index 0c1189ca9c..7c3021a3a9 100644 --- a/apps/web/components/booking/CancelBooking.tsx +++ b/apps/web/components/booking/CancelBooking.tsx @@ -5,7 +5,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useRefreshData } from "@calcom/lib/hooks/useRefreshData"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import type { RecurringEvent } from "@calcom/types/Calendar"; -import { Button, Icon, TextArea } from "@calcom/ui"; +import { Button, Icon, Label, TextArea } from "@calcom/ui"; type Props = { booking: { @@ -33,6 +33,7 @@ type Props = { }; eventType: unknown; }; + isHost: boolean; }; export default function CancelBooking(props: Props) { @@ -70,7 +71,7 @@ export default function CancelBooking(props: Props) { )} {!error && (
- +