diff --git a/apps/web/server/lib/[user]/getServerSideProps.ts b/apps/web/server/lib/[user]/getServerSideProps.ts index 4b1a8b8c5a..9b39ecdf69 100644 --- a/apps/web/server/lib/[user]/getServerSideProps.ts +++ b/apps/web/server/lib/[user]/getServerSideProps.ts @@ -59,7 +59,6 @@ type UserPageProps = { | "length" | "hidden" | "lockTimeZoneToggleOnBookingPage" - | "lockedTimeZone" | "requiresConfirmation" | "canSendCalVideoTranscriptionEmails" | "requiresBookerEmailVerification" diff --git a/apps/web/test/lib/handleChildrenEventTypes.test.ts b/apps/web/test/lib/handleChildrenEventTypes.test.ts index 82021c88ad..281a37d8db 100644 --- a/apps/web/test/lib/handleChildrenEventTypes.test.ts +++ b/apps/web/test/lib/handleChildrenEventTypes.test.ts @@ -111,7 +111,6 @@ describe("handleChildrenEventTypes", () => { timeZone, requiresBookerEmailVerification, lockTimeZoneToggleOnBookingPage, - lockedTimeZone, useEventTypeDestinationCalendarEmail, secondaryEmailId, autoTranslateDescriptionEnabled, @@ -137,7 +136,6 @@ describe("handleChildrenEventTypes", () => { parentId: 1, users: { connect: [{ id: 4 }] }, lockTimeZoneToggleOnBookingPage: false, - lockedTimeZone: "Europe/London", requiresBookerEmailVerification: false, instantMeetingScheduleId: undefined, bookingLimits: undefined, @@ -170,7 +168,6 @@ describe("handleChildrenEventTypes", () => { scheduleId, requiresBookerEmailVerification, lockTimeZoneToggleOnBookingPage, - lockedTimeZone, useEventTypeDestinationCalendarEmail, secondaryEmailId, ...evType @@ -201,7 +198,6 @@ describe("handleChildrenEventTypes", () => { locations: [], scheduleId: null, lockTimeZoneToggleOnBookingPage: false, - lockedTimeZone: "Europe/London", requiresBookerEmailVerification: false, hashedLink: { deleteMany: {}, @@ -276,7 +272,6 @@ describe("handleChildrenEventTypes", () => { timeZone, requiresBookerEmailVerification, lockTimeZoneToggleOnBookingPage, - lockedTimeZone, useEventTypeDestinationCalendarEmail, secondaryEmailId, autoTranslateDescriptionEnabled, @@ -309,7 +304,6 @@ describe("handleChildrenEventTypes", () => { customReplyToEmail: null, instantMeetingScheduleId: undefined, lockTimeZoneToggleOnBookingPage: false, - lockedTimeZone: "Europe/London", requiresBookerEmailVerification: false, userId: 4, workflows: undefined, @@ -336,7 +330,6 @@ describe("handleChildrenEventTypes", () => { userId, requiresBookerEmailVerification, lockTimeZoneToggleOnBookingPage, - lockedTimeZone, useEventTypeDestinationCalendarEmail, secondaryEmailId, ...evType @@ -370,7 +363,6 @@ describe("handleChildrenEventTypes", () => { deleteMany: {}, }, lockTimeZoneToggleOnBookingPage: false, - lockedTimeZone: "Europe/London", requiresBookerEmailVerification: false, instantMeetingScheduleId: undefined, }, @@ -401,7 +393,6 @@ describe("handleChildrenEventTypes", () => { // eslint-disable-next-line @typescript-eslint/no-unused-vars requiresBookerEmailVerification, lockTimeZoneToggleOnBookingPage, - lockedTimeZone, useEventTypeDestinationCalendarEmail, secondaryEmailId, autoTranslateDescriptionEnabled, @@ -427,7 +418,6 @@ describe("handleChildrenEventTypes", () => { schedulingType: SchedulingType.MANAGED, requiresBookerEmailVerification: false, lockTimeZoneToggleOnBookingPage: false, - lockedTimeZone: "Europe/London", useEventTypeDestinationCalendarEmail: false, workflows: [], parentId: 1, @@ -462,7 +452,6 @@ describe("handleChildrenEventTypes", () => { instantMeetingScheduleId: undefined, locations: [], lockTimeZoneToggleOnBookingPage: false, - lockedTimeZone: "Europe/London", requiresBookerEmailVerification: false, parentId: 1, userId: 5, @@ -489,7 +478,6 @@ describe("handleChildrenEventTypes", () => { customReplyToEmail: null, rrSegmentQueryValue: undefined, lockTimeZoneToggleOnBookingPage: false, - lockedTimeZone: "Europe/London", requiresBookerEmailVerification: false, hashedLink: { deleteMany: {}, diff --git a/docs/platform/guides/teams-setup.mdx b/docs/platform/guides/teams-setup.mdx index 2fb88f6836..877396dcd7 100644 --- a/docs/platform/guides/teams-setup.mdx +++ b/docs/platform/guides/teams-setup.mdx @@ -245,4 +245,4 @@ export default function TeamEvent(){ - + \ No newline at end of file diff --git a/packages/features/bookings/Booker/components/EventMeta.tsx b/packages/features/bookings/Booker/components/EventMeta.tsx index 31e7e82d7f..c4e2c4d9dd 100644 --- a/packages/features/bookings/Booker/components/EventMeta.tsx +++ b/packages/features/bookings/Booker/components/EventMeta.tsx @@ -13,6 +13,7 @@ import { useTimePreferences } from "@calcom/features/bookings/lib"; import type { BookerEvent } from "@calcom/features/bookings/types"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { markdownToSafeHTMLClient } from "@calcom/lib/markdownToSafeHTMLClient"; +import { CURRENT_TIMEZONE } from "@calcom/lib/timezoneConstants"; import type { EventTypeTranslation } from "@calcom/prisma/client"; import { EventTypeAutoTranslatedField } from "@calcom/prisma/enums"; @@ -56,7 +57,6 @@ export const EventMeta = ({ event?: Pick< BookerEvent, | "lockTimeZoneToggleOnBookingPage" - | "lockedTimeZone" | "schedule" | "seatsPerTimeSlot" | "subsetOfUsers" @@ -109,9 +109,9 @@ export const EventMeta = ({ ); useEffect(() => { - //In case the event has lockTimeZone enabled ,set the timezone to event's locked timezone - if (event && event?.lockTimeZoneToggleOnBookingPage && event?.lockedTimeZone) { - setTimezone(event?.lockedTimeZone); + //In case the event has lockTimeZone enabled ,set the timezone to event's attached availability timezone + if (event && event?.lockTimeZoneToggleOnBookingPage && event?.schedule?.timeZone) { + setTimezone(event.schedule?.timeZone); } }, [event, setTimezone]); @@ -225,7 +225,7 @@ export const EventMeta = ({ indicatorsContainer: () => "ml-auto", container: () => "max-w-full", }} - value={event.lockTimeZoneToggleOnBookingPage ? event.lockedTimeZone : timezone} + value={event.lockTimeZoneToggleOnBookingPage ? CURRENT_TIMEZONE : timezone} onChange={({ value }) => { setTimezone(value); setBookerStoreTimezone(value); diff --git a/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts b/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts index 4f33094694..277fc2451f 100644 --- a/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts +++ b/packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts @@ -58,7 +58,6 @@ export const getEventTypesFromDB = async (eventTypeId: number) => { periodDays: true, periodCountCalendarDays: true, lockTimeZoneToggleOnBookingPage: true, - lockedTimeZone: true, requiresConfirmation: true, requiresConfirmationForFreeEmail: true, requiresBookerEmailVerification: true, diff --git a/packages/features/bookings/types.ts b/packages/features/bookings/types.ts index 2490b6c8f9..464b454582 100644 --- a/packages/features/bookings/types.ts +++ b/packages/features/bookings/types.ts @@ -46,7 +46,6 @@ export type BookerEvent = Pick< | "price" | "currency" | "lockTimeZoneToggleOnBookingPage" - | "lockedTimeZone" | "schedule" | "seatsPerTimeSlot" | "title" diff --git a/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx b/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx index 86dd902570..be706ca4a0 100644 --- a/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx +++ b/packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx @@ -12,7 +12,6 @@ import { } from "@calcom/atoms/selected-calendars/wrappers/SelectedCalendarsSettingsWebWrapper"; import getLocationsOptionsForSelect from "@calcom/features/bookings/lib/getLocationOptionsForSelect"; import DestinationCalendarSelector from "@calcom/features/calendars/DestinationCalendarSelector"; -import { TimezoneSelect } from "@calcom/features/components/timezone-select"; import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hooks/useLockedFieldsManager"; import { allowDisablingAttendeeConfirmationEmails, @@ -1003,8 +1002,7 @@ export const EventAdvancedTab = ({ toggleSwitchAtTheEnd={true} switchContainerClassName={classNames( "border-subtle rounded-lg border py-6 px-4 sm:px-6", - customClassNames?.timezoneLock?.container, - formMethods.getValues("lockTimeZoneToggleOnBookingPage") && "rounded-b-none" + customClassNames?.timezoneLock?.container )} title={t("lock_timezone_toggle_on_booking_page")} {...lockTimeZoneToggleOnBookingPageLocked} @@ -1012,31 +1010,7 @@ export const EventAdvancedTab = ({ checked={value} onCheckedChange={(e) => onChange(e)} data-testid="lock-timezone-toggle" - childrenClassName="lg:ml-0"> -