Skip to content

Scheduling infrastructure for absolutely everyone.

fix: enforce team-only access on premium toggles in cal video (#25680) (#25681)

Eesh Midhad034e7aff786
diff --git a/packages/features/eventtypes/components/locations/CalVideoSettings.tsx b/packages/features/eventtypes/components/locations/CalVideoSettings.tsx
index 49d01b0fb59..a7acb11f62b 100644
--- a/packages/features/eventtypes/components/locations/CalVideoSettings.tsx
+++ b/packages/features/eventtypes/components/locations/CalVideoSettings.tsx
@@ -4,6 +4,7 @@ import { useState } from "react";
import { useFormContext, Controller } from "react-hook-form";
import { useIsPlatform } from "@calcom/atoms/hooks/useIsPlatform";
+import { useHasTeamPlan } from "@calcom/features/billing/hooks/useHasPaidPlan";
import type { FormValues } from "@calcom/features/eventtypes/lib/types";
import type { CalVideoSettings as CalVideoSettingsType } from "@calcom/features/eventtypes/lib/types";
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -22,6 +23,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
const isPlatform = useIsPlatform();
const [isExpanded, setIsExpanded] = useState(false);
const [parent] = useAutoAnimate<HTMLDivElement>();
+ const { hasTeamPlan } = useHasTeamPlan();
return (
<>
<Tooltip content="expandable" side="right" className="lg:hidden">
@@ -51,6 +53,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
title={t("disable_recording_for_guests")}
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
checked={value}
+ disabled={!hasTeamPlan}
onCheckedChange={onChange}
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
/>
@@ -67,6 +70,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
title={t("disable_recording_for_organizer")}
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
checked={value}
+ disabled={!hasTeamPlan}
onCheckedChange={onChange}
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
/>
@@ -84,6 +88,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
title={t("enable_automatic_recording")}
labelClassName="text-sm"
checked={value}
+ disabled={!hasTeamPlan}
onCheckedChange={onChange}
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
/>
@@ -101,6 +106,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
title={t("enable_automatic_transcription")}
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
checked={value}
+ disabled={!hasTeamPlan}
onCheckedChange={onChange}
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
/>
@@ -118,6 +124,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
title={t("disable_transcription_for_guests")}
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
checked={value}
+ disabled={!hasTeamPlan}
onCheckedChange={onChange}
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
/>
@@ -135,6 +142,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
title={t("disable_transcription_for_organizer")}
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
checked={value}
+ disabled={!hasTeamPlan}
onCheckedChange={onChange}
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
/>
@@ -153,6 +161,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
description={t("require_email_for_guests_description")}
labelClassName="text-sm leading-6 whitespace-normal break-words"
checked={value}
+ disabled={!hasTeamPlan}
onCheckedChange={onChange}
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
/>