From 3c6fdfe724c8263b0315809e34011c2ac95e0b62 Mon Sep 17 00:00:00 2001 From: Peer Richelsen Date: Thu, 4 Jan 2024 18:23:51 +0000 Subject: [PATCH] chore: removed old booker feature flag (#13040) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Omar López --- packages/features/embed/Embed.tsx | 57 +++++++++---------- packages/features/flags/config.ts | 1 - .../settings/BookerLayoutSelector.tsx | 4 -- .../migration.sql | 4 ++ 4 files changed, 30 insertions(+), 36 deletions(-) create mode 100644 packages/prisma/migrations/20240105110500_removed_newbooker_feature_flag/migration.sql diff --git a/packages/features/embed/Embed.tsx b/packages/features/embed/Embed.tsx index fcaa08a4b6..1b4174f1eb 100644 --- a/packages/features/embed/Embed.tsx +++ b/packages/features/embed/Embed.tsx @@ -16,7 +16,6 @@ import { useBookerStore, useInitializeBookerStore } from "@calcom/features/booki import { useEvent, useScheduleForEvent } from "@calcom/features/bookings/Booker/utils/event"; import { useTimePreferences } from "@calcom/features/bookings/lib/timePreferences"; import DatePicker from "@calcom/features/calendars/DatePicker"; -import { useFlagMap } from "@calcom/features/flags/context/provider"; import { useNonEmptyScheduleDays } from "@calcom/features/schedules"; import { useSlotsForDate } from "@calcom/features/schedules/lib/use-schedule/useSlotsForDate"; import { APP_NAME, CAL_URL } from "@calcom/lib/constants"; @@ -515,8 +514,6 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ const { goto, removeQueryParams } = useRouterHelpers(); const iframeRef = useRef(null); const dialogContentRef = useRef(null); - const flags = useFlagMap(); - const isBookerLayoutsEnabled = flags["booker-layouts"] === true; const emailContentRef = useRef(null); const { data } = useSession(); const [month, selectedDatesAndTimes] = useBookerStore( @@ -957,34 +954,32 @@ const EmbedTypeCodeAndPreviewDialogContent = ({ ))} - {isBookerLayoutsEnabled && ( - diff --git a/packages/features/flags/config.ts b/packages/features/flags/config.ts index 50e61214a9..bb03d0f5d4 100644 --- a/packages/features/flags/config.ts +++ b/packages/features/flags/config.ts @@ -12,7 +12,6 @@ export type AppFlags = { "managed-event-types": boolean; organizations: boolean; "email-verification": boolean; - "booker-layouts": boolean; "google-workspace-directory": boolean; "disable-signup": boolean; }; diff --git a/packages/features/settings/BookerLayoutSelector.tsx b/packages/features/settings/BookerLayoutSelector.tsx index 3ac38433bb..e097298db0 100644 --- a/packages/features/settings/BookerLayoutSelector.tsx +++ b/packages/features/settings/BookerLayoutSelector.tsx @@ -4,7 +4,6 @@ import Link from "next/link"; import { useCallback, useState } from "react"; import { Controller, useFormContext } from "react-hook-form"; -import { useFlagMap } from "@calcom/features/flags/context/provider"; import { classNames } from "@calcom/lib"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { BookerLayouts, defaultBookerLayoutSettings } from "@calcom/prisma/zod-utils"; @@ -53,9 +52,6 @@ export const BookerLayoutSelector = ({ // Only fallback if event current does not have any settings, and the fallbackToUserSettings boolean is set. const shouldShowUserSettings = (fallbackToUserSettings && !getValues(name || defaultFieldName)) || false; - const flags = useFlagMap(); - if (flags["booker-layouts"] !== true) return null; - return (
diff --git a/packages/prisma/migrations/20240105110500_removed_newbooker_feature_flag/migration.sql b/packages/prisma/migrations/20240105110500_removed_newbooker_feature_flag/migration.sql new file mode 100644 index 0000000000..bdf05ec0ab --- /dev/null +++ b/packages/prisma/migrations/20240105110500_removed_newbooker_feature_flag/migration.sql @@ -0,0 +1,4 @@ +-- Removes the feature flag for the new booker layouts which is no longer needed +DELETE FROM "Feature" +WHERE + slug = 'booker-layouts';