From 6c069a4afe112ad34f6085a1945d2954d21dca38 Mon Sep 17 00:00:00 2001 From: keerthi vardhan Date: Tue, 2 Sep 2025 10:24:06 +0530 Subject: [PATCH] feat: skip onboarding and fix UI for redirect apps (#23115) * skip onboarding and fix UI for redirect apps * fix --------- Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Co-authored-by: unknown --- apps/web/components/apps/AppPage.tsx | 19 +++++++++++++ apps/web/public/static/locales/en/common.json | 1 + packages/app-store/_utils/redirectApps.ts | 24 +++++++++++++++++ packages/features/apps/components/AppCard.tsx | 27 +++++++++++++++++-- 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 packages/app-store/_utils/redirectApps.ts diff --git a/apps/web/components/apps/AppPage.tsx b/apps/web/components/apps/AppPage.tsx index 9fa038f3ef..e297e7d4ba 100644 --- a/apps/web/components/apps/AppPage.tsx +++ b/apps/web/components/apps/AppPage.tsx @@ -3,6 +3,7 @@ import { useRouter } from "next/navigation"; import type { IframeHTMLAttributes } from "react"; import React, { useEffect, useState } from "react"; +import { isRedirectApp } from "@calcom/app-store/_utils/redirectApps"; import useAddAppMutation from "@calcom/app-store/_utils/useAddAppMutation"; import { AppDependencyComponent, InstallAppButton } from "@calcom/app-store/components"; import { doesAppSupportTeamInstall, isConferencing } from "@calcom/app-store/utils"; @@ -112,6 +113,11 @@ export const AppPage = ({ }); const handleAppInstall = () => { + if (isRedirectApp(slug)) { + setIsLoading(true); + mutation.mutate({ type, variant, slug }); + return; + } setIsLoading(true); if (isConferencing(categories) && !concurrentMeetings) { mutation.mutate({ @@ -185,6 +191,19 @@ export const AppPage = ({ }, []); const installOrDisconnectAppButton = () => { + if (isRedirectApp(slug)) { + return ( + + ); + } + if (appDbQuery.isPending) { return ; } diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 20185cd16e..3623d3c708 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -3573,6 +3573,7 @@ "webhook_metadata": "Metadata", "stats": "Stats", "booking_status": "Booking status", + "visit": "Visit", "location_custom_label_input_label": "Custom label on booking page", "meeting_link": "Meeting link", "my_bookings": "My Bookings", diff --git a/packages/app-store/_utils/redirectApps.ts b/packages/app-store/_utils/redirectApps.ts new file mode 100644 index 0000000000..d983a5daf8 --- /dev/null +++ b/packages/app-store/_utils/redirectApps.ts @@ -0,0 +1,24 @@ +export const REDIRECT_APPS = [ + "amie", + "autocheckin", + "bolna", + "chatbase", + "clic", + "deel", + "elevenlabs", + "granola", + "greetmate-ai", + "lindy", + "linear", + "millis-ai", + "monobot", + "retell-ai", + "synthflow", + "telli", + "vimcal", + "wordpress", +]; + +export const isRedirectApp = (slug: string): boolean => { + return REDIRECT_APPS.includes(slug); +}; diff --git a/packages/features/apps/components/AppCard.tsx b/packages/features/apps/components/AppCard.tsx index 2067ab63a9..5aa05b7e23 100644 --- a/packages/features/apps/components/AppCard.tsx +++ b/packages/features/apps/components/AppCard.tsx @@ -3,6 +3,7 @@ import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; +import { isRedirectApp } from "@calcom/app-store/_utils/redirectApps"; import useAddAppMutation from "@calcom/app-store/_utils/useAddAppMutation"; import { InstallAppButton } from "@calcom/app-store/components"; import { doesAppSupportTeamInstall, isConferencing } from "@calcom/app-store/utils"; @@ -56,6 +57,10 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar }, [app.name, searchText]); const handleAppInstall = () => { + if (isRedirectApp(app.slug)) { + mutation.mutate({ type: app.type, variant: app.variant, slug: app.slug }); + return; + } if (isConferencing(app.categories) && !app.concurrentMeetings) { mutation.mutate({ type: app.type, @@ -148,7 +153,9 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar loading: mutation.isPending, }; } - return ; + return ( + + ); }} /> ) @@ -170,7 +177,9 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar loading: mutation.isPending, }; } - return ; + return ( + + ); }} /> )} @@ -192,11 +201,25 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar const InstallAppButtonChild = ({ paid, + isRedirect = false, ...props }: { paid: App["paid"]; + isRedirect?: boolean; } & ButtonProps) => { const { t } = useLocale(); + if (isRedirect) { + return ( + + ); + } // Paid apps don't support team installs at the moment // Also, cal.ai(the only paid app at the moment) doesn't support team install either if (paid) {