Skip to content

Commit 08d232a

Browse files
revert: "feat: Ability to set a locked timezone for event type (#20425)" (#21066)
This reverts commit 0324070.
1 parent d9b3f86 commit 08d232a

19 files changed

Lines changed: 11 additions & 65 deletions

File tree

apps/web/server/lib/[user]/getServerSideProps.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ type UserPageProps = {
5959
| "length"
6060
| "hidden"
6161
| "lockTimeZoneToggleOnBookingPage"
62-
| "lockedTimeZone"
6362
| "requiresConfirmation"
6463
| "canSendCalVideoTranscriptionEmails"
6564
| "requiresBookerEmailVerification"

apps/web/test/lib/handleChildrenEventTypes.test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ describe("handleChildrenEventTypes", () => {
111111
timeZone,
112112
requiresBookerEmailVerification,
113113
lockTimeZoneToggleOnBookingPage,
114-
lockedTimeZone,
115114
useEventTypeDestinationCalendarEmail,
116115
secondaryEmailId,
117116
autoTranslateDescriptionEnabled,
@@ -137,7 +136,6 @@ describe("handleChildrenEventTypes", () => {
137136
parentId: 1,
138137
users: { connect: [{ id: 4 }] },
139138
lockTimeZoneToggleOnBookingPage: false,
140-
lockedTimeZone: "Europe/London",
141139
requiresBookerEmailVerification: false,
142140
instantMeetingScheduleId: undefined,
143141
bookingLimits: undefined,
@@ -170,7 +168,6 @@ describe("handleChildrenEventTypes", () => {
170168
scheduleId,
171169
requiresBookerEmailVerification,
172170
lockTimeZoneToggleOnBookingPage,
173-
lockedTimeZone,
174171
useEventTypeDestinationCalendarEmail,
175172
secondaryEmailId,
176173
...evType
@@ -201,7 +198,6 @@ describe("handleChildrenEventTypes", () => {
201198
locations: [],
202199
scheduleId: null,
203200
lockTimeZoneToggleOnBookingPage: false,
204-
lockedTimeZone: "Europe/London",
205201
requiresBookerEmailVerification: false,
206202
hashedLink: {
207203
deleteMany: {},
@@ -276,7 +272,6 @@ describe("handleChildrenEventTypes", () => {
276272
timeZone,
277273
requiresBookerEmailVerification,
278274
lockTimeZoneToggleOnBookingPage,
279-
lockedTimeZone,
280275
useEventTypeDestinationCalendarEmail,
281276
secondaryEmailId,
282277
autoTranslateDescriptionEnabled,
@@ -309,7 +304,6 @@ describe("handleChildrenEventTypes", () => {
309304
customReplyToEmail: null,
310305
instantMeetingScheduleId: undefined,
311306
lockTimeZoneToggleOnBookingPage: false,
312-
lockedTimeZone: "Europe/London",
313307
requiresBookerEmailVerification: false,
314308
userId: 4,
315309
workflows: undefined,
@@ -336,7 +330,6 @@ describe("handleChildrenEventTypes", () => {
336330
userId,
337331
requiresBookerEmailVerification,
338332
lockTimeZoneToggleOnBookingPage,
339-
lockedTimeZone,
340333
useEventTypeDestinationCalendarEmail,
341334
secondaryEmailId,
342335
...evType
@@ -370,7 +363,6 @@ describe("handleChildrenEventTypes", () => {
370363
deleteMany: {},
371364
},
372365
lockTimeZoneToggleOnBookingPage: false,
373-
lockedTimeZone: "Europe/London",
374366
requiresBookerEmailVerification: false,
375367
instantMeetingScheduleId: undefined,
376368
},
@@ -401,7 +393,6 @@ describe("handleChildrenEventTypes", () => {
401393
// eslint-disable-next-line @typescript-eslint/no-unused-vars
402394
requiresBookerEmailVerification,
403395
lockTimeZoneToggleOnBookingPage,
404-
lockedTimeZone,
405396
useEventTypeDestinationCalendarEmail,
406397
secondaryEmailId,
407398
autoTranslateDescriptionEnabled,
@@ -427,7 +418,6 @@ describe("handleChildrenEventTypes", () => {
427418
schedulingType: SchedulingType.MANAGED,
428419
requiresBookerEmailVerification: false,
429420
lockTimeZoneToggleOnBookingPage: false,
430-
lockedTimeZone: "Europe/London",
431421
useEventTypeDestinationCalendarEmail: false,
432422
workflows: [],
433423
parentId: 1,
@@ -462,7 +452,6 @@ describe("handleChildrenEventTypes", () => {
462452
instantMeetingScheduleId: undefined,
463453
locations: [],
464454
lockTimeZoneToggleOnBookingPage: false,
465-
lockedTimeZone: "Europe/London",
466455
requiresBookerEmailVerification: false,
467456
parentId: 1,
468457
userId: 5,
@@ -489,7 +478,6 @@ describe("handleChildrenEventTypes", () => {
489478
customReplyToEmail: null,
490479
rrSegmentQueryValue: undefined,
491480
lockTimeZoneToggleOnBookingPage: false,
492-
lockedTimeZone: "Europe/London",
493481
requiresBookerEmailVerification: false,
494482
hashedLink: {
495483
deleteMany: {},

docs/platform/guides/teams-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,4 @@ export default function TeamEvent(){
245245
</Step>
246246

247247

248-
</Steps>
248+
</Steps>

packages/features/bookings/Booker/components/EventMeta.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { useTimePreferences } from "@calcom/features/bookings/lib";
1313
import type { BookerEvent } from "@calcom/features/bookings/types";
1414
import { useLocale } from "@calcom/lib/hooks/useLocale";
1515
import { markdownToSafeHTMLClient } from "@calcom/lib/markdownToSafeHTMLClient";
16+
import { CURRENT_TIMEZONE } from "@calcom/lib/timezoneConstants";
1617
import type { EventTypeTranslation } from "@calcom/prisma/client";
1718
import { EventTypeAutoTranslatedField } from "@calcom/prisma/enums";
1819

@@ -56,7 +57,6 @@ export const EventMeta = ({
5657
event?: Pick<
5758
BookerEvent,
5859
| "lockTimeZoneToggleOnBookingPage"
59-
| "lockedTimeZone"
6060
| "schedule"
6161
| "seatsPerTimeSlot"
6262
| "subsetOfUsers"
@@ -109,9 +109,9 @@ export const EventMeta = ({
109109
);
110110

111111
useEffect(() => {
112-
//In case the event has lockTimeZone enabled ,set the timezone to event's locked timezone
113-
if (event && event?.lockTimeZoneToggleOnBookingPage && event?.lockedTimeZone) {
114-
setTimezone(event?.lockedTimeZone);
112+
//In case the event has lockTimeZone enabled ,set the timezone to event's attached availability timezone
113+
if (event && event?.lockTimeZoneToggleOnBookingPage && event?.schedule?.timeZone) {
114+
setTimezone(event.schedule?.timeZone);
115115
}
116116
}, [event, setTimezone]);
117117

@@ -225,7 +225,7 @@ export const EventMeta = ({
225225
indicatorsContainer: () => "ml-auto",
226226
container: () => "max-w-full",
227227
}}
228-
value={event.lockTimeZoneToggleOnBookingPage ? event.lockedTimeZone : timezone}
228+
value={event.lockTimeZoneToggleOnBookingPage ? CURRENT_TIMEZONE : timezone}
229229
onChange={({ value }) => {
230230
setTimezone(value);
231231
setBookerStoreTimezone(value);

packages/features/bookings/lib/handleNewBooking/getEventTypesFromDB.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export const getEventTypesFromDB = async (eventTypeId: number) => {
5858
periodDays: true,
5959
periodCountCalendarDays: true,
6060
lockTimeZoneToggleOnBookingPage: true,
61-
lockedTimeZone: true,
6261
requiresConfirmation: true,
6362
requiresConfirmationForFreeEmail: true,
6463
requiresBookerEmailVerification: true,

packages/features/bookings/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export type BookerEvent = Pick<
4646
| "price"
4747
| "currency"
4848
| "lockTimeZoneToggleOnBookingPage"
49-
| "lockedTimeZone"
5049
| "schedule"
5150
| "seatsPerTimeSlot"
5251
| "title"

packages/features/eventtypes/components/tabs/advanced/EventAdvancedTab.tsx

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
} from "@calcom/atoms/selected-calendars/wrappers/SelectedCalendarsSettingsWebWrapper";
1313
import getLocationsOptionsForSelect from "@calcom/features/bookings/lib/getLocationOptionsForSelect";
1414
import DestinationCalendarSelector from "@calcom/features/calendars/DestinationCalendarSelector";
15-
import { TimezoneSelect } from "@calcom/features/components/timezone-select";
1615
import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hooks/useLockedFieldsManager";
1716
import {
1817
allowDisablingAttendeeConfirmationEmails,
@@ -1003,40 +1002,15 @@ export const EventAdvancedTab = ({
10031002
toggleSwitchAtTheEnd={true}
10041003
switchContainerClassName={classNames(
10051004
"border-subtle rounded-lg border py-6 px-4 sm:px-6",
1006-
customClassNames?.timezoneLock?.container,
1007-
formMethods.getValues("lockTimeZoneToggleOnBookingPage") && "rounded-b-none"
1005+
customClassNames?.timezoneLock?.container
10081006
)}
10091007
title={t("lock_timezone_toggle_on_booking_page")}
10101008
{...lockTimeZoneToggleOnBookingPageLocked}
10111009
description={t("description_lock_timezone_toggle_on_booking_page")}
10121010
checked={value}
10131011
onCheckedChange={(e) => onChange(e)}
10141012
data-testid="lock-timezone-toggle"
1015-
childrenClassName="lg:ml-0">
1016-
<div className="border-subtle flex flex-col gap-6 rounded-b-lg border border-t-0 p-6">
1017-
<div>
1018-
<Controller
1019-
name="lockedTimeZone"
1020-
control={formMethods.control}
1021-
render={({ field: { value } }) => (
1022-
<>
1023-
<Label className="text-default mb-2 block text-sm font-medium">
1024-
<>{t("timezone")}</>
1025-
</Label>
1026-
<TimezoneSelect
1027-
id="lockedTimeZone"
1028-
value={value}
1029-
onChange={(event) => {
1030-
if (event)
1031-
formMethods.setValue("lockedTimeZone", event.value, { shouldDirty: true });
1032-
}}
1033-
/>
1034-
</>
1035-
)}
1036-
/>
1037-
</div>
1038-
</div>
1039-
</SettingsToggle>
1013+
/>
10401014
)}
10411015
/>
10421016
<Controller

packages/features/eventtypes/lib/getPublicEvent.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const getPublicEventSelect = (fetchAllUsers: boolean) => {
6767
disableGuests: true,
6868
metadata: true,
6969
lockTimeZoneToggleOnBookingPage: true,
70-
lockedTimeZone: true,
7170
requiresConfirmation: true,
7271
autoTranslateDescriptionEnabled: true,
7372
fieldTranslations: {

packages/features/eventtypes/lib/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export type FormValues = {
8080
description: string;
8181
disableGuests: boolean;
8282
lockTimeZoneToggleOnBookingPage: boolean;
83-
lockedTimeZone: string;
8483
requiresConfirmation: boolean;
8584
requiresConfirmationWillBlockSlot: boolean;
8685
requiresConfirmationForFreeEmail: boolean;

packages/lib/defaultEvents.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ const commons = {
100100
destinationCalendar: null,
101101
team: null,
102102
lockTimeZoneToggleOnBookingPage: false,
103-
lockedTimeZone: "Europe/London",
104103
requiresConfirmation: false,
105104
requiresConfirmationForFreeEmail: false,
106105
requiresBookerEmailVerification: false,

0 commit comments

Comments
 (0)