diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsx index 82972e0e44..2d5f588fa4 100644 --- a/apps/web/components/eventtype/EventSetupTab.tsx +++ b/apps/web/components/eventtype/EventSetupTab.tsx @@ -1,16 +1,18 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; import { zodResolver } from "@hookform/resolvers/zod"; import { isValidPhoneNumber } from "libphonenumber-js"; +import { Trans } from "next-i18next"; +import Link from "next/link"; import type { EventTypeSetupProps, FormValues } from "pages/event-types/[type]"; import { useState } from "react"; import { Controller, useForm, useFormContext } from "react-hook-form"; import { MultiValue } from "react-select"; import { z } from "zod"; -import { EventLocationType, getEventLocationType } from "@calcom/app-store/locations"; +import { EventLocationType, getEventLocationType, MeetLocationType } from "@calcom/app-store/locations"; import { CAL_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { Button, Icon, Label, Select, Skeleton, TextField, SettingsToggle } from "@calcom/ui"; +import { Button, Icon, Label, Select, SettingsToggle, Skeleton, TextField } from "@calcom/ui"; import { slugify } from "@lib/slugify"; @@ -195,6 +197,23 @@ export const EventSetupTab = ( ); })} + {validLocations.some((location) => location.type === MeetLocationType) && ( +
+ + +

+ The “Add to calendar” for this event type needs to be a Google Calendar for Meet to work. + Change it{" "} + + here. + {" "} + We will fall back to Cal video if you do not change it. +

+
+
+ )} {validLocations.length > 0 && validLocations.length !== locationOptions.length && (
  • + + + + + ); +} diff --git a/packages/app-store/googlevideo/components/index.ts b/packages/app-store/googlevideo/components/index.ts new file mode 100644 index 0000000000..0d6008d4ca --- /dev/null +++ b/packages/app-store/googlevideo/components/index.ts @@ -0,0 +1 @@ +export { default as InstallAppButton } from "./InstallAppButton"; diff --git a/packages/app-store/locations.ts b/packages/app-store/locations.ts index 5789eb830e..47b50c8b5e 100644 --- a/packages/app-store/locations.ts +++ b/packages/app-store/locations.ts @@ -40,6 +40,8 @@ export type EventLocationType = DefaultEventLocationType | EventLocationTypeFrom export const DailyLocationType = "integrations:daily"; +export const MeetLocationType = "integrations:google:meet"; + export enum DefaultEventLocationTypeEnum { /** * Booker Address diff --git a/packages/app-store/types.d.ts b/packages/app-store/types.d.ts index 081887a80c..b586522960 100644 --- a/packages/app-store/types.d.ts +++ b/packages/app-store/types.d.ts @@ -7,6 +7,7 @@ import { ButtonProps } from "@calcom/ui"; export type IntegrationOAuthCallbackState = { returnTo: string; + installGoogleVideo?: boolean; }; export interface InstallAppButtonProps { diff --git a/packages/core/EventManager.ts b/packages/core/EventManager.ts index 2a9c15888b..af95df3bc6 100644 --- a/packages/core/EventManager.ts +++ b/packages/core/EventManager.ts @@ -5,6 +5,7 @@ import { z } from "zod"; import { FAKE_DAILY_CREDENTIAL } from "@calcom/app-store/dailyvideo/lib/VideoApiAdapter"; import { getEventLocationTypeFromApp } from "@calcom/app-store/locations"; +import { MeetLocationType } from "@calcom/app-store/locations"; import getApps from "@calcom/app-store/utils"; import prisma from "@calcom/prisma"; import { Attendee } from "@calcom/prisma/client"; @@ -28,7 +29,7 @@ import { createEvent, updateEvent } from "./CalendarManager"; import { createMeeting, updateMeeting } from "./videoClient"; export const isDedicatedIntegration = (location: string): boolean => { - return location !== "integrations:google:meet" && location.includes("integrations:"); + return location !== MeetLocationType && location.includes("integrations:"); }; export const getLocationRequestFromIntegration = (location: string) => { @@ -102,9 +103,15 @@ export default class EventManager { const evt = processLocation(event); // Fallback to cal video if no location is set if (!evt.location) evt["location"] = "integrations:daily"; + + // Fallback to Cal Video if Google Meet is selected w/o a Google Cal + if (evt.location === MeetLocationType && evt.destinationCalendar?.integration !== "google_calendar") { + evt["location"] = "integrations:daily"; + } const isDedicated = evt.location ? isDedicatedIntegration(evt.location) : null; const results: Array>> = []; + // If and only if event type is a dedicated meeting, create a dedicated video meeting. if (isDedicated) { const result = await this.createVideoEvent(evt); diff --git a/packages/emails/src/components/AppsStatus.tsx b/packages/emails/src/components/AppsStatus.tsx index 67f43488ad..d7b35960e6 100644 --- a/packages/emails/src/components/AppsStatus.tsx +++ b/packages/emails/src/components/AppsStatus.tsx @@ -16,6 +16,7 @@ export const AppsStatus = (props: { calEvent: CalendarEvent; t: TFunction }) =>
  • {status.appName}{" "} {status.success >= 1 && `✅ ${status.success > 1 ? `(x${status.success})` : ""}`} + {status.failures >= 1 && `❌ ${status.failures > 1 ? `(x${status.failures})` : ""}`} {status.warnings && status.warnings.length >= 1 && ( )} - {status.failures >= 1 && `❌ ${status.failures > 1 ? `(x${status.failures})` : ""}`} {status.errors.length >= 1 && (