Skip to content

Commit d034e7a

Browse files
eeshmUdit-takkar
andauthored
fix: enforce team-only access on premium toggles in cal video (calcom#25680) (calcom#25681)
* fix(cal-video): enforce team-only access on premium toggles * fix(cal-video): disable redirect URL field and add upgrade badge for non-team users * chore: improvments --------- Co-authored-by: Udit Takkar <udit222001@gmail.com>
1 parent 13103c0 commit d034e7a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

packages/features/eventtypes/components/locations/CalVideoSettings.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useState } from "react";
44
import { useFormContext, Controller } from "react-hook-form";
55

66
import { useIsPlatform } from "@calcom/atoms/hooks/useIsPlatform";
7+
import { useHasTeamPlan } from "@calcom/features/billing/hooks/useHasPaidPlan";
78
import type { FormValues } from "@calcom/features/eventtypes/lib/types";
89
import type { CalVideoSettings as CalVideoSettingsType } from "@calcom/features/eventtypes/lib/types";
910
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -22,6 +23,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
2223
const isPlatform = useIsPlatform();
2324
const [isExpanded, setIsExpanded] = useState(false);
2425
const [parent] = useAutoAnimate<HTMLDivElement>();
26+
const { hasTeamPlan } = useHasTeamPlan();
2527
return (
2628
<>
2729
<Tooltip content="expandable" side="right" className="lg:hidden">
@@ -51,6 +53,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
5153
title={t("disable_recording_for_guests")}
5254
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
5355
checked={value}
56+
disabled={!hasTeamPlan}
5457
onCheckedChange={onChange}
5558
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
5659
/>
@@ -67,6 +70,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
6770
title={t("disable_recording_for_organizer")}
6871
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
6972
checked={value}
73+
disabled={!hasTeamPlan}
7074
onCheckedChange={onChange}
7175
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
7276
/>
@@ -84,6 +88,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
8488
title={t("enable_automatic_recording")}
8589
labelClassName="text-sm"
8690
checked={value}
91+
disabled={!hasTeamPlan}
8792
onCheckedChange={onChange}
8893
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
8994
/>
@@ -101,6 +106,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
101106
title={t("enable_automatic_transcription")}
102107
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
103108
checked={value}
109+
disabled={!hasTeamPlan}
104110
onCheckedChange={onChange}
105111
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
106112
/>
@@ -118,6 +124,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
118124
title={t("disable_transcription_for_guests")}
119125
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
120126
checked={value}
127+
disabled={!hasTeamPlan}
121128
onCheckedChange={onChange}
122129
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
123130
/>
@@ -135,6 +142,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
135142
title={t("disable_transcription_for_organizer")}
136143
labelClassName="text-sm leading-6 whitespace-normal wrap-break-word"
137144
checked={value}
145+
disabled={!hasTeamPlan}
138146
onCheckedChange={onChange}
139147
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
140148
/>
@@ -153,6 +161,7 @@ const CalVideoSettings = ({ calVideoSettings }: { calVideoSettings?: CalVideoSet
153161
description={t("require_email_for_guests_description")}
154162
labelClassName="text-sm leading-6 whitespace-normal break-words"
155163
checked={value}
164+
disabled={!hasTeamPlan}
156165
onCheckedChange={onChange}
157166
Badge={<UpgradeTeamsBadge checkForActiveStatus />}
158167
/>

0 commit comments

Comments
 (0)