Skip to content

Scheduling infrastructure for absolutely everyone.

fix: invalid type of enable_transcription_storage (#15049)

Udit Takkar87a8b5a8dd07
diff --git a/apps/web/modules/videos/ai/ai-transcribe.tsx b/apps/web/modules/videos/ai/ai-transcribe.tsx
index b30b8c2a4df..ce85280c746 100644
--- a/apps/web/modules/videos/ai/ai-transcribe.tsx
+++ b/apps/web/modules/videos/ai/ai-transcribe.tsx
@@ -6,7 +6,7 @@ import { Toaster } from "react-hot-toast";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { showToast } from "@calcom/ui";
-export const CalAiTransctibe = () => {
+export const CalAiTranscribe = () => {
const daily = useDaily();
const { t } = useLocale();
diff --git a/apps/web/modules/videos/views/videos-single-view.getServerSideProps.tsx b/apps/web/modules/videos/views/videos-single-view.getServerSideProps.tsx
index b7b0e11241b..6c28da10675 100644
--- a/apps/web/modules/videos/views/videos-single-view.getServerSideProps.tsx
+++ b/apps/web/modules/videos/views/videos-single-view.getServerSideProps.tsx
@@ -60,6 +60,19 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
};
}
+ const hasTeamPlan = booking.user?.id
+ ? await prisma.membership.findFirst({
+ where: {
+ userId: booking.user.id,
+ team: {
+ slug: {
+ not: null,
+ },
+ },
+ },
+ })
+ : false;
+
const profile = booking.user
? (
await UserRepository.enrichUserWithItsProfile({
@@ -114,6 +127,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
}
: bookingObj.user,
},
+ hasTeamPlan: !!hasTeamPlan,
trpcState: ssr.dehydrate(),
},
};
diff --git a/apps/web/modules/videos/views/videos-single-view.tsx b/apps/web/modules/videos/views/videos-single-view.tsx
index a170b66fc23..df8979ff8c3 100644
--- a/apps/web/modules/videos/views/videos-single-view.tsx
+++ b/apps/web/modules/videos/views/videos-single-view.tsx
@@ -14,13 +14,13 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
import { Icon } from "@calcom/ui";
-import { CalAiTransctibe } from "~/videos/ai/ai-transcribe";
+import { CalAiTranscribe } from "~/videos/ai/ai-transcribe";
import { type PageProps } from "./videos-single-view.getServerSideProps";
export default function JoinCall(props: PageProps) {
const { t } = useLocale();
- const { meetingUrl, meetingPassword, booking } = props;
+ const { meetingUrl, meetingPassword, booking, hasTeamPlan } = props;
const [daily, setDaily] = useState<DailyCall | null>(null);
useEffect(() => {
@@ -47,14 +47,16 @@ export default function JoinCall(props: PageProps) {
},
url: meetingUrl,
...(typeof meetingPassword === "string" && { token: meetingPassword }),
- customTrayButtons: {
- transcription: {
- label: "Cal.ai",
- tooltip: "Toggle real time transcription powered by AI",
- iconPath: `${WEBAPP_URL}/sparkles.svg`,
- iconPathDarkMode: `${WEBAPP_URL}/sparkles.svg`,
+ ...(hasTeamPlan && {
+ customTrayButtons: {
+ transcription: {
+ label: "Cal.ai",
+ tooltip: "Toggle real time transcription powered by AI",
+ iconPath: `${WEBAPP_URL}/sparkles.svg`,
+ iconPathDarkMode: `${WEBAPP_URL}/sparkles.svg`,
+ },
},
- },
+ }),
});
setDaily(callFrame);
@@ -86,7 +88,7 @@ export default function JoinCall(props: PageProps) {
</Head>
<DailyProvider callObject={daily}>
<div className="mx-auto" style={{ zIndex: 2, position: "absolute", bottom: 60, width: "100%" }}>
- <CalAiTransctibe />
+ <CalAiTranscribe />
</div>
<div style={{ zIndex: 2, position: "relative" }}>
{booking?.user?.organization?.calVideoLogo ? (
diff --git a/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts b/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts
index 3c75f492389..2bfd4bab7c1 100644
--- a/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts
+++ b/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts
@@ -30,7 +30,7 @@ const dailyReturnTypeSchema = z.object({
enable_chat: z.boolean(),
enable_knocking: z.boolean(),
enable_prejoin_ui: z.boolean(),
- enable_transcription_storage: z.boolean(),
+ enable_transcription_storage: z.boolean().default(false),
}),
});
@@ -179,9 +179,11 @@ const DailyVideoApiAdapter = (): VideoApiAdapter => {
exp: exp,
enable_recording: scalePlan === "true" && !!hasTeamPlan === true ? "cloud" : undefined,
enable_transcription_storage: !!hasTeamPlan,
- permissions: {
- canAdmin: ["transcription"],
- },
+ ...(!!hasTeamPlan && {
+ permissions: {
+ canAdmin: ["transcription"],
+ },
+ }),
},
};
};