diff --git a/apps/api/pages/api/event-types/_utils/getCalLink.ts b/apps/api/pages/api/event-types/_utils/getCalLink.ts index 77d6d4b464..1877e3547f 100644 --- a/apps/api/pages/api/event-types/_utils/getCalLink.ts +++ b/apps/api/pages/api/event-types/_utils/getCalLink.ts @@ -1,4 +1,4 @@ -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBSITE_URL } from "@calcom/lib/constants"; export default function getCalLink(eventType: { team?: { slug: string | null } | null; @@ -6,7 +6,7 @@ export default function getCalLink(eventType: { users?: { username: string | null }[]; slug: string; }) { - return `${CAL_URL}/${ + return `${WEBSITE_URL}/${ eventType?.team ? `team/${eventType?.team?.slug}` : eventType?.owner diff --git a/apps/web/components/apps/InstallAppButtonChild.tsx b/apps/web/components/apps/InstallAppButtonChild.tsx index 90eb9361ad..c7bb898465 100644 --- a/apps/web/components/apps/InstallAppButtonChild.tsx +++ b/apps/web/components/apps/InstallAppButtonChild.tsx @@ -2,7 +2,7 @@ import useAddAppMutation from "@calcom/app-store/_utils/useAddAppMutation"; import { doesAppSupportTeamInstall } from "@calcom/app-store/utils"; import { Spinner } from "@calcom/features/calendars/weeklyview/components/spinner/Spinner"; import type { UserAdminTeams } from "@calcom/features/ee/teams/lib/getUserAdminTeams"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { RouterOutputs } from "@calcom/trpc/react"; import type { AppFrontendPayload } from "@calcom/types/App"; @@ -125,7 +125,7 @@ export const InstallAppButtonChild = ({ StartIcon={(props) => ( diff --git a/apps/web/components/eventtype/EventAdvancedTab.tsx b/apps/web/components/eventtype/EventAdvancedTab.tsx index e2f4bba3b9..f033636b18 100644 --- a/apps/web/components/eventtype/EventAdvancedTab.tsx +++ b/apps/web/components/eventtype/EventAdvancedTab.tsx @@ -18,8 +18,7 @@ import { FormBuilder } from "@calcom/features/form-builder/FormBuilder"; import type { EditableSchema } from "@calcom/features/form-builder/schema"; import { BookerLayoutSelector } from "@calcom/features/settings/BookerLayoutSelector"; import { classNames } from "@calcom/lib"; -import { APP_NAME, CAL_URL } from "@calcom/lib/constants"; -import { IS_VISUAL_REGRESSION_TESTING } from "@calcom/lib/constants"; +import { APP_NAME, IS_VISUAL_REGRESSION_TESTING, WEBSITE_URL } from "@calcom/lib/constants"; import { generateHashedLink } from "@calcom/lib/generateHashedLink"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { Prisma } from "@calcom/prisma/client"; @@ -74,7 +73,7 @@ export const EventAdvancedTab = ({ eventType, team }: Pick here. {" "} @@ -412,7 +412,7 @@ export const EventSetupTab = ( {isChildrenManagedEventType && !locationAvailable && locationDetails && (

{t("app_not_connected", { appName: locationDetails.name })}{" "} - + {t("connect_now")}

@@ -444,9 +444,10 @@ export const EventSetupTab = ( const lengthLockedProps = shouldLockDisableProps("length"); const descriptionLockedProps = shouldLockDisableProps("description"); + const urlPrefix = orgBranding ? orgBranding?.fullDomain.replace(/^(https?:|)\/\//, "") - : `${CAL_URL?.replace(/^(https?:|)\/\//, "")}`; + : `${WEBSITE_URL?.replace(/^(https?:|)\/\//, "")}`; return (
diff --git a/apps/web/components/ui/UsernameAvailability/index.tsx b/apps/web/components/ui/UsernameAvailability/index.tsx index a2fe787f52..f65efe65aa 100644 --- a/apps/web/components/ui/UsernameAvailability/index.tsx +++ b/apps/web/components/ui/UsernameAvailability/index.tsx @@ -4,7 +4,7 @@ import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider"; -import { CAL_URL, IS_SELF_HOSTED } from "@calcom/lib/constants"; +import { WEBSITE_URL, IS_SELF_HOSTED } from "@calcom/lib/constants"; import type { TRPCClientErrorLike } from "@calcom/trpc/client"; import { trpc } from "@calcom/trpc/react"; import type { AppRouter } from "@calcom/trpc/server/routers/_app"; @@ -45,7 +45,7 @@ export const UsernameAvailabilityField = ({ const usernamePrefix = orgBranding ? orgBranding?.fullDomain.replace(/^(https?:|)\/\//, "") - : `${CAL_URL?.replace(/^(https?:|)\/\//, "")}`; + : `${WEBSITE_URL?.replace(/^(https?:|)\/\//, "")}`; return ( { ).length; } - const permalink = `${CAL_URL}/${team ? `team/${team.slug}` : eventType.users[0].username}/${ + const permalink = `${WEBSITE_URL}/${team ? `team/${team.slug}` : eventType.users[0].username}/${ eventType.slug }`; const tabMap = { diff --git a/apps/web/test/utils/bookingScenario/expects.ts b/apps/web/test/utils/bookingScenario/expects.ts index 64f04b4b7a..83849cd7b1 100644 --- a/apps/web/test/utils/bookingScenario/expects.ts +++ b/apps/web/test/utils/bookingScenario/expects.ts @@ -8,7 +8,7 @@ import { expect, vi } from "vitest"; import "vitest-fetch-mock"; import dayjs from "@calcom/dayjs"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBSITE_URL } from "@calcom/lib/constants"; import logger from "@calcom/lib/logger"; import { safeStringify } from "@calcom/lib/safeStringify"; import { BookingStatus } from "@calcom/prisma/enums"; @@ -382,7 +382,7 @@ export function expectSuccessfulBookingCreationEmails({ bookingTimeRange?: { start: Date; end: Date }; booking: { uid: string; urlOrigin?: string }; }) { - const bookingUrlOrigin = booking.urlOrigin || CAL_URL; + const bookingUrlOrigin = booking.urlOrigin || WEBSITE_URL; expect(emails).toHaveEmail( { titleTag: "confirmed_event_type_subject", @@ -742,7 +742,7 @@ export function expectBookingRequestRescheduledEmails({ booking: { uid: string; urlOrigin?: string }; bookNewTimePath: string; }) { - const bookingUrlOrigin = booking.urlOrigin || CAL_URL; + const bookingUrlOrigin = booking.urlOrigin || WEBSITE_URL; expect(emails).toHaveEmail( { diff --git a/packages/app-store/components.tsx b/packages/app-store/components.tsx index 9a0263c89b..e69dc43ae4 100644 --- a/packages/app-store/components.tsx +++ b/packages/app-store/components.tsx @@ -5,7 +5,6 @@ import { useEffect, useRef } from "react"; import useAddAppMutation from "@calcom/app-store/_utils/useAddAppMutation"; import classNames from "@calcom/lib/classNames"; import { WEBAPP_URL } from "@calcom/lib/constants"; -import { CAL_URL } from "@calcom/lib/constants"; import { deriveAppDictKeyFromType } from "@calcom/lib/deriveAppDictKeyFromType"; import { useHasTeamPlan } from "@calcom/lib/hooks/useHasPaidPlan"; import { useLocale } from "@calcom/lib/hooks/useLocale"; @@ -156,7 +155,7 @@ export const AppDependencyComponent = ({
<> {t("connect_app", { dependencyName: dependency.name })} diff --git a/packages/app-store/googlecalendar/components/ExistingGoogleCal.tsx b/packages/app-store/googlecalendar/components/ExistingGoogleCal.tsx index 70f33f8942..b8f9a56dd2 100644 --- a/packages/app-store/googlecalendar/components/ExistingGoogleCal.tsx +++ b/packages/app-store/googlecalendar/components/ExistingGoogleCal.tsx @@ -1,6 +1,6 @@ import Link from "next/link"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { AlertCircle, ArrowRight, Check } from "@calcom/ui/components/icon"; @@ -38,7 +38,7 @@ const ExistingGoogleCal = ({ gCalInstalled, appName }: { gCalInstalled?: boolean
<> {t("connect_google_calendar")} diff --git a/packages/app-store/intercom/api/callback.ts b/packages/app-store/intercom/api/callback.ts index 7bb265a8b1..6665aba5b6 100644 --- a/packages/app-store/intercom/api/callback.ts +++ b/packages/app-store/intercom/api/callback.ts @@ -1,6 +1,6 @@ import type { NextApiRequest, NextApiResponse } from "next"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl"; import logger from "@calcom/lib/logger"; import prisma from "@calcom/prisma"; @@ -86,7 +86,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) ); res.redirect( - getSafeRedirectUrl(`${CAL_URL}/apps/installed/automation?hl=intercom`) ?? + getSafeRedirectUrl(`${WEBAPP_URL}/apps/installed/automation?hl=intercom`) ?? getInstalledAppPath({ variant: "automation", slug: "intercom" }) ); } diff --git a/packages/app-store/intercom/api/configure.ts b/packages/app-store/intercom/api/configure.ts index 3465369510..aee21b8534 100644 --- a/packages/app-store/intercom/api/configure.ts +++ b/packages/app-store/intercom/api/configure.ts @@ -1,6 +1,6 @@ import type { NextApiRequest, NextApiResponse } from "next"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBSITE_URL } from "@calcom/lib/constants"; import prisma from "@calcom/prisma"; import type { @@ -94,7 +94,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) } return { - id: `${CAL_URL}/${slug}/${eventType.slug}`, + id: `${WEBSITE_URL}/${slug}/${eventType.slug}`, type: "item", title: eventType.title, subtitle: `${slug}/${eventType.slug}`, diff --git a/packages/app-store/intercom/lib/isValidCalURL.ts b/packages/app-store/intercom/lib/isValidCalURL.ts index c5690eabfa..e370b2f2ee 100644 --- a/packages/app-store/intercom/lib/isValidCalURL.ts +++ b/packages/app-store/intercom/lib/isValidCalURL.ts @@ -1,4 +1,4 @@ -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBSITE_URL } from "@calcom/lib/constants"; import prisma from "@calcom/prisma"; import type { TextComponent } from "../lib"; @@ -9,11 +9,11 @@ import type { TextComponent } from "../lib"; * @returns boolean */ export async function isValidCalURL(url: string) { - const regex = new RegExp(`^${CAL_URL}/`, `i`); + const regex = new RegExp(`^${WEBSITE_URL}/`, `i`); const error: TextComponent = { type: "text", - text: `This is not a valid ${CAL_URL.replace("https://", "")} link`, + text: `This is not a valid ${WEBSITE_URL.replace("https://", "")} link`, style: "error", align: "left", }; diff --git a/packages/app-store/routing-forms/components/FormActions.tsx b/packages/app-store/routing-forms/components/FormActions.tsx index 3723b43afb..adbabd464b 100644 --- a/packages/app-store/routing-forms/components/FormActions.tsx +++ b/packages/app-store/routing-forms/components/FormActions.tsx @@ -8,7 +8,7 @@ import { z } from "zod"; import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider"; import { RoutingFormEmbedButton, RoutingFormEmbedDialog } from "@calcom/features/embed/RoutingFormEmbed"; import { classNames } from "@calcom/lib"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBSITE_URL } from "@calcom/lib/constants"; import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { useRouterQuery } from "@calcom/lib/hooks/useRouterQuery"; @@ -405,8 +405,8 @@ export const FormAction = forwardRef(function FormAction { redirectUrl += `&${getFieldIdentifier(field)}={Recalled_Response_For_This_Field}`; diff --git a/packages/app-store/typeform/playwright/tests/basic.e2e.ts b/packages/app-store/typeform/playwright/tests/basic.e2e.ts index 052385cdf5..122b627742 100644 --- a/packages/app-store/typeform/playwright/tests/basic.e2e.ts +++ b/packages/app-store/typeform/playwright/tests/basic.e2e.ts @@ -5,7 +5,7 @@ import { addForm as addRoutingForm, addOneFieldAndDescriptionAndSaveForm, } from "@calcom/app-store/routing-forms/playwright/tests/testUtils"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import type { Fixtures } from "@calcom/web/playwright/lib/fixtures"; import { test } from "@calcom/web/playwright/lib/fixtures"; @@ -46,7 +46,7 @@ test.describe("Typeform App", () => { const text = await page.evaluate(async () => { return navigator.clipboard.readText(); }); - expect(text).toBe(`${CAL_URL}/router?form=${formId}&test={Recalled_Response_For_This_Field}`); + expect(text).toBe(`${WEBAPP_URL}/router?form=${formId}&test={Recalled_Response_For_This_Field}`); }); test("should copy link in RoutingForms list", async ({ page, context, users }) => { @@ -66,7 +66,7 @@ test.describe("Typeform App", () => { const text = await page.evaluate(async () => { return navigator.clipboard.readText(); }); - expect(text).toBe(`${CAL_URL}/router?form=${formId}&test={Recalled_Response_For_This_Field}`); + expect(text).toBe(`${WEBAPP_URL}/router?form=${formId}&test={Recalled_Response_For_This_Field}`); }); }); }); diff --git a/packages/emails/src/templates/DisabledAppEmail.tsx b/packages/emails/src/templates/DisabledAppEmail.tsx index 4753502395..345ea0a76c 100644 --- a/packages/emails/src/templates/DisabledAppEmail.tsx +++ b/packages/emails/src/templates/DisabledAppEmail.tsx @@ -1,6 +1,6 @@ -import { TFunction } from "next-i18next"; +import type { TFunction } from "next-i18next"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import { BaseEmailHtml, CallToAction } from "../components"; @@ -30,7 +30,7 @@ export const DisabledAppEmail = ( ) : title && eventTypeId ? ( @@ -43,7 +43,7 @@ export const DisabledAppEmail = ( ) : appType.some((type) => type === "video") ? ( @@ -54,7 +54,7 @@ export const DisabledAppEmail = (
- + ) : appType.some((type) => type === "calendar") ? ( <> @@ -67,7 +67,7 @@ export const DisabledAppEmail = (
- + ) : ( <> @@ -77,7 +77,7 @@ export const DisabledAppEmail = (
- + )} diff --git a/packages/emails/src/templates/SlugReplacementEmail.tsx b/packages/emails/src/templates/SlugReplacementEmail.tsx index c40ebdb558..b8707a3b26 100644 --- a/packages/emails/src/templates/SlugReplacementEmail.tsx +++ b/packages/emails/src/templates/SlugReplacementEmail.tsx @@ -3,7 +3,7 @@ import type { TFunction } from "next-i18next"; import { Trans } from "next-i18next"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import { BaseEmailHtml, CallToAction } from "../components"; @@ -49,7 +49,7 @@ export const SlugReplacementEmail = ( diff --git a/packages/features/auth/lib/getServerSession.ts b/packages/features/auth/lib/getServerSession.ts index 6dd99d3c7c..18924bc16f 100644 --- a/packages/features/auth/lib/getServerSession.ts +++ b/packages/features/auth/lib/getServerSession.ts @@ -4,7 +4,7 @@ import type { AuthOptions, Session } from "next-auth"; import { getToken } from "next-auth/jwt"; import checkLicense from "@calcom/features/ee/common/server/checkLicense"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import logger from "@calcom/lib/logger"; import { safeStringify } from "@calcom/lib/safeStringify"; import { UserRepository } from "@calcom/lib/server/repository/user"; @@ -94,7 +94,7 @@ export async function getServerSession(options: { emailVerified: user.emailVerified, email_verified: user.emailVerified !== null, role: user.role, - image: `${CAL_URL}/${user.username}/avatar.png`, + image: `${WEBAPP_URL}/${user.username}/avatar.png`, belongsToActiveTeam: token.belongsToActiveTeam, org: token.org, locale: user.locale ?? undefined, diff --git a/packages/features/bookings/lib/handleNewBooking/test/fresh-booking.test.ts b/packages/features/bookings/lib/handleNewBooking/test/fresh-booking.test.ts index 816025130a..530e82f9d0 100644 --- a/packages/features/bookings/lib/handleNewBooking/test/fresh-booking.test.ts +++ b/packages/features/bookings/lib/handleNewBooking/test/fresh-booking.test.ts @@ -12,7 +12,7 @@ import type { NextApiRequest, NextApiResponse } from "next"; import { describe, expect } from "vitest"; import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData"; -import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants"; +import { WEBSITE_URL, WEBAPP_URL } from "@calcom/lib/constants"; import { ErrorCode } from "@calcom/lib/errorCodes"; import { resetTestEmails } from "@calcom/lib/testEmails"; import { BookingStatus } from "@calcom/prisma/enums"; @@ -219,7 +219,7 @@ describe("handleNewBooking", () => { expectSuccessfulBookingCreationEmails({ booking: { uid: createdBooking.uid!, - urlOrigin: org ? org.urlOrigin : CAL_URL, + urlOrigin: org ? org.urlOrigin : WEBSITE_URL, }, booker, organizer, diff --git a/packages/features/bookings/lib/handleNewBooking/test/recurring-event.test.ts b/packages/features/bookings/lib/handleNewBooking/test/recurring-event.test.ts index 8d19959531..8587acaaa6 100644 --- a/packages/features/bookings/lib/handleNewBooking/test/recurring-event.test.ts +++ b/packages/features/bookings/lib/handleNewBooking/test/recurring-event.test.ts @@ -1,29 +1,28 @@ import { v4 as uuidv4 } from "uuid"; import { describe, expect } from "vitest"; -import { WEBAPP_URL, CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL, WEBSITE_URL } from "@calcom/lib/constants"; import { ErrorCode } from "@calcom/lib/errorCodes"; import logger from "@calcom/lib/logger"; import { BookingStatus, SchedulingType } from "@calcom/prisma/enums"; import { test } from "@calcom/web/test/fixtures/fixtures"; import { createBookingScenario, - getGoogleCalendarCredential, - TestData, - getOrganizer, getBooker, - getScenarioData, - mockSuccessfulVideoMeetingCreation, - mockCalendarToHaveNoBusySlots, getDate, + getGoogleCalendarCredential, + getOrganizer, + getScenarioData, + mockCalendarToHaveNoBusySlots, + mockSuccessfulVideoMeetingCreation, + TestData, Timezones, } from "@calcom/web/test/utils/bookingScenario/bookingScenario"; import { createMockNextJsRequest } from "@calcom/web/test/utils/bookingScenario/createMockNextJsRequest"; import { - // expectWorkflowToBeTriggered, - expectSuccessfulBookingCreationEmails, - expectBookingToBeInDatabase, expectBookingCreatedWebhookToHaveBeenFired, + expectBookingToBeInDatabase, // expectWorkflowToBeTriggered, + expectSuccessfulBookingCreationEmails, expectSuccessfulCalendarEventCreationInCalendar, } from "@calcom/web/test/utils/bookingScenario/expects"; import { getMockRequestDataForBooking } from "@calcom/web/test/utils/bookingScenario/getMockRequestDataForBooking"; @@ -211,7 +210,7 @@ describe("handleNewBooking", () => { booking: { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion uid: createdBookings[0].uid!, - urlOrigin: CAL_URL, + urlOrigin: WEBSITE_URL, }, organizer, emails, @@ -559,7 +558,7 @@ describe("handleNewBooking", () => { booking: { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion uid: createdBookings[0].uid!, - urlOrigin: CAL_URL, + urlOrigin: WEBSITE_URL, }, organizer, emails, @@ -773,7 +772,7 @@ describe("handleNewBooking", () => { booking: { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion uid: createdBookings[0].uid!, - urlOrigin: CAL_URL, + urlOrigin: WEBSITE_URL, }, booker, organizer, diff --git a/packages/features/bookings/lib/handleNewBooking/test/team-bookings/collective-scheduling.test.ts b/packages/features/bookings/lib/handleNewBooking/test/team-bookings/collective-scheduling.test.ts index fbd1c019e4..104a147f35 100644 --- a/packages/features/bookings/lib/handleNewBooking/test/team-bookings/collective-scheduling.test.ts +++ b/packages/features/bookings/lib/handleNewBooking/test/team-bookings/collective-scheduling.test.ts @@ -4,7 +4,7 @@ import { describe, expect } from "vitest"; import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData"; import { OrganizerDefaultConferencingAppType } from "@calcom/app-store/locations"; -import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL, WEBSITE_URL } from "@calcom/lib/constants"; import { ErrorCode } from "@calcom/lib/errorCodes"; import { SchedulingType } from "@calcom/prisma/enums"; import { BookingStatus } from "@calcom/prisma/enums"; @@ -1486,7 +1486,7 @@ describe("handleNewBooking", () => { booking: { uid: createdBooking.uid!, // All booking links are of WEBAPP_URL and not of the org because the team isn't part of the org - urlOrigin: CAL_URL, + urlOrigin: WEBSITE_URL, }, booker, organizer, diff --git a/packages/features/ee/payments/components/Payment.tsx b/packages/features/ee/payments/components/Payment.tsx index 62d4da5518..8581ac6d7f 100644 --- a/packages/features/ee/payments/components/Payment.tsx +++ b/packages/features/ee/payments/components/Payment.tsx @@ -8,7 +8,7 @@ import { useEffect, useState } from "react"; import getStripe from "@calcom/app-store/stripepayment/lib/client"; import { getBookingRedirectExtraParams, useBookingSuccessRedirect } from "@calcom/lib/bookingSuccessRedirect"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { Button, CheckboxField } from "@calcom/ui"; @@ -48,7 +48,7 @@ type States = const getReturnUrl = (props: Props) => { if (!props.eventType.successRedirectUrl) { - return `${CAL_URL}/booking/${props.booking.uid}`; + return `${WEBAPP_URL}/booking/${props.booking.uid}`; } const returnUrl = new URL(props.eventType.successRedirectUrl); diff --git a/packages/features/ee/support/lib/intercom/useIntercom.ts b/packages/features/ee/support/lib/intercom/useIntercom.ts index 61c547a05b..43eda0529f 100644 --- a/packages/features/ee/support/lib/intercom/useIntercom.ts +++ b/packages/features/ee/support/lib/intercom/useIntercom.ts @@ -4,7 +4,7 @@ import { useIntercom as useIntercomLib } from "react-use-intercom"; import { z } from "zod"; import dayjs from "@calcom/dayjs"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBSITE_URL } from "@calcom/lib/constants"; import { useHasTeamPlan, useHasPaidPlan } from "@calcom/lib/hooks/useHasPaidPlan"; import { trpc } from "@calcom/trpc/react"; @@ -44,7 +44,7 @@ export const useIntercom = () => { customAttributes: { //keys should be snake cased user_name: data?.username, - link: `${CAL_URL}/${data?.username}`, + link: `${WEBSITE_URL}/${data?.username}`, identity_provider: data?.identityProvider, timezone: data?.timeZone, locale: data?.locale, diff --git a/packages/features/ee/workflows/components/WorkflowListPage.tsx b/packages/features/ee/workflows/components/WorkflowListPage.tsx index 2e0c9b9507..f2900ba032 100644 --- a/packages/features/ee/workflows/components/WorkflowListPage.tsx +++ b/packages/features/ee/workflows/components/WorkflowListPage.tsx @@ -5,7 +5,6 @@ import { useRouter } from "next/navigation"; import { useState } from "react"; import classNames from "@calcom/lib/classNames"; -import { CAL_URL } from "@calcom/lib/constants"; import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; @@ -24,8 +23,6 @@ import { } from "@calcom/ui"; import { Edit2, Link as LinkIcon, MoreHorizontal, Trash2 } from "@calcom/ui/components/icon"; -import { useOrgBranding } from "../../organizations/context/provider"; -import { subdomainSuffix } from "../../organizations/lib/orgDomains"; import { getActionIcon } from "../lib/getActionIcon"; import { DeleteDialog } from "./DeleteDialog"; @@ -61,9 +58,6 @@ export default function WorkflowListPage({ workflows }: Props) { const [parent] = useAutoAnimate(); const router = useRouter(); - const orgBranding = useOrgBranding(); - const urlPrefix = orgBranding ? `${orgBranding.slug}.${subdomainSuffix()}` : CAL_URL; - const mutation = trpc.viewer.workflowOrder.useMutation({ onError: async (err) => { console.error(err.message); diff --git a/packages/features/embed/Embed.tsx b/packages/features/embed/Embed.tsx index 026ffdd283..aa7e1833e5 100644 --- a/packages/features/embed/Embed.tsx +++ b/packages/features/embed/Embed.tsx @@ -18,7 +18,7 @@ import { useTimePreferences } from "@calcom/features/bookings/lib/timePreference import DatePicker from "@calcom/features/calendars/DatePicker"; import { useNonEmptyScheduleDays } from "@calcom/features/schedules"; import { useSlotsForDate } from "@calcom/features/schedules/lib/use-schedule/useSlotsForDate"; -import { APP_NAME, CAL_URL } from "@calcom/lib/constants"; +import { APP_NAME, WEBSITE_URL } from "@calcom/lib/constants"; import { weekdayToWeekIndex } from "@calcom/lib/date-fns"; import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; import { useLocale } from "@calcom/lib/hooks/useLocale"; @@ -400,7 +400,7 @@ const EmailEmbedPreview = ({ {selectedDateAndTime[key]?.length > 0 && selectedDateAndTime[key].map((time) => { - const bookingURL = `${CAL_URL}/${username}/${eventType.slug}?duration=${eventType.length}&date=${key}&month=${month}&slot=${time}`; + const bookingURL = `${WEBSITE_URL}/${username}/${eventType.slug}?duration=${eventType.length}&date=${key}&month=${month}&slot=${time}`; return ( { // If we are self hosted, calOrigin won't be app.cal.com so we need to pass it - // If we are not self hosted but it's still different from WEBAPP_URL and CAL_URL, we need to pass it -> It happens for organization booking URL at the moment - return IS_SELF_HOSTED || (embedCalOrigin !== WEBAPP_URL && embedCalOrigin !== CAL_URL); + // If we are not self hosted but it's still different from WEBAPP_URL and WEBSITE_URL, we need to pass it -> It happens for organization booking URL at the moment + return IS_SELF_HOSTED || (embedCalOrigin !== WEBAPP_URL && embedCalOrigin !== WEBSITE_URL); }; // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -121,7 +121,7 @@ export const Codes = { calLink: "${calLink}", layout: "${previewState.layout}" }); - + ${uiInstructionCode}`; }, @@ -155,7 +155,7 @@ export const Codes = { // \`data-cal-config='${JSON.stringify({ layout: previewState.layout, })}'\` - + ${uiInstructionCode}`; }, }, diff --git a/packages/features/eventtypes/components/ChildrenEventTypeSelect.tsx b/packages/features/eventtypes/components/ChildrenEventTypeSelect.tsx index e0d346a6e5..dfa28c5c8c 100644 --- a/packages/features/eventtypes/components/ChildrenEventTypeSelect.tsx +++ b/packages/features/eventtypes/components/ChildrenEventTypeSelect.tsx @@ -2,7 +2,7 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; import type { Props } from "react-select"; import { classNames } from "@calcom/lib"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBSITE_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { MembershipRole } from "@calcom/prisma/enums"; import { Avatar, Badge, Button, ButtonGroup, Select, Switch, Tooltip } from "@calcom/ui"; @@ -106,7 +106,7 @@ export const ChildrenEventTypeSelect = ({ color="secondary" target="_blank" variant="icon" - href={`${CAL_URL}/${children.owner?.username}/${children.slug}`} + href={`${WEBSITE_URL}/${children.owner?.username}/${children.slug}`} StartIcon={ExternalLink} /> diff --git a/packages/features/eventtypes/components/CreateEventTypeDialog.tsx b/packages/features/eventtypes/components/CreateEventTypeDialog.tsx index 59f776551e..7fb8a9eb15 100644 --- a/packages/features/eventtypes/components/CreateEventTypeDialog.tsx +++ b/packages/features/eventtypes/components/CreateEventTypeDialog.tsx @@ -1,8 +1,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { isValidPhoneNumber } from "libphonenumber-js"; import { useRouter } from "next/navigation"; -import { useEffect } from "react"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; @@ -14,7 +13,7 @@ import { HttpError } from "@calcom/lib/http-error"; import { md } from "@calcom/lib/markdownIt"; import slugify from "@calcom/lib/slugify"; import turndown from "@calcom/lib/turndownService"; -import { SchedulingType, MembershipRole } from "@calcom/prisma/enums"; +import { MembershipRole, SchedulingType } from "@calcom/prisma/enums"; import { unlockedManagedEventTypeProps } from "@calcom/prisma/zod-utils"; import { createEventTypeInput } from "@calcom/prisma/zod/custom/eventtype"; import { trpc } from "@calcom/trpc/react"; @@ -24,12 +23,12 @@ import { Dialog, DialogClose, DialogContent, + DialogFooter, + Editor, Form, RadioGroup as RadioArea, showToast, TextField, - Editor, - DialogFooter, } from "@calcom/ui"; // this describes the uniform data needed to create a new event type on Profile or Team diff --git a/packages/lib/OgImages.tsx b/packages/lib/OgImages.tsx index 74d0ae36e7..1bef494f38 100644 --- a/packages/lib/OgImages.tsx +++ b/packages/lib/OgImages.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { CAL_URL, LOGO } from "./constants"; +import { LOGO, WEBAPP_URL } from "./constants"; // Ensures tw prop is typed. declare module "react" { @@ -62,7 +62,7 @@ export const constructMeetingImage = ( `?type=meeting`, `&title=${encodeURIComponent(title)}`, `&meetingProfileName=${encodeURIComponent(profile.name)}`, - profile.image && `&meetingImage=${encodeURIComponent(CAL_URL + profile.image)}`, + profile.image && `&meetingImage=${encodeURIComponent(WEBAPP_URL + profile.image)}`, `${users.map((user) => `&names=${encodeURIComponent(user.name)}`).join("")}`, `${users.map((user) => `&usernames=${encodeURIComponent(user.username)}`).join("")}`, // Joining a multiline string for readability. @@ -103,7 +103,7 @@ const Wrapper = ({ children, variant = "light", rotateBackground }: WrapperProps background { const avatars = attendees .map((user) => { if ("image" in user && user?.image) return user.image; - if ("username" in user && user?.username) return `${CAL_URL}/${user.username}/avatar.png`; + if ("username" in user && user?.username) return `${WEBAPP_URL}/${user.username}/avatar.png`; return null; }) .filter(Boolean) as string[]; @@ -138,7 +138,7 @@ export const Meeting = ({ title, users = [], profile }: MeetingImageProps) => {
- Logo + Logo {avatars.length > 0 && (
/ @@ -191,7 +191,7 @@ const VisualBlur = ({ visualSlug }: { visualSlug: string }) => { style={{ filter: "blur(98px)", backgroundColor: "rgba(255, 255, 255, 0.7)", - backgroundImage: `url(${CAL_URL}${visualSlug})`, + backgroundImage: `url(${WEBAPP_URL}${visualSlug})`, backgroundSize: "400px 400px", }} /> @@ -202,7 +202,7 @@ const VisualBlur = ({ visualSlug }: { visualSlug: string }) => { style={{ filter: "blur(150px)", backgroundColor: "rgba(255, 255, 255, 0.7)", - backgroundImage: `url(${CAL_URL}${visualSlug})`, + backgroundImage: `url(${WEBAPP_URL}${visualSlug})`, backgroundSize: "630px 630px", }} /> @@ -212,13 +212,13 @@ const VisualBlur = ({ visualSlug }: { visualSlug: string }) => { export const App = ({ name, description, slug }: AppImageProps) => ( - Logo + Logo
- App icon + App icon
@@ -236,7 +236,7 @@ export const Generic = ({ title, description }: GenericImageProps) => (
- Logo + Logo
diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts index cc25a5b303..59960c41ee 100644 --- a/packages/lib/constants.ts +++ b/packages/lib/constants.ts @@ -78,7 +78,7 @@ export const SEO_IMG_DEFAULT = `${WEBSITE_URL}/og-image.png`; // This results in a 80% smaller image 🤯. It is however important that for the query // parameters you pass to the /api/social/og/image endpoint, you wrap them in encodeURIComponent // as well, otherwise the URL won't be valid. -export const SEO_IMG_OGIMG = `${CAL_URL}/_next/image?w=1200&q=100&url=${encodeURIComponent( +export const SEO_IMG_OGIMG = `${WEBAPP_URL}/_next/image?w=1200&q=100&url=${encodeURIComponent( "/api/social/og/image" )}`; export const SEO_IMG_OGIMG_VIDEO = `${WEBSITE_URL}/video-og-image.png`; diff --git a/packages/lib/getBookerUrl/server.ts b/packages/lib/getBookerUrl/server.ts index 551bff6540..a5c27bc4ec 100644 --- a/packages/lib/getBookerUrl/server.ts +++ b/packages/lib/getBookerUrl/server.ts @@ -1,12 +1,12 @@ -import { CAL_URL } from "../constants"; +import { WEBSITE_URL } from "../constants"; import { getBrand } from "../server/getBrand"; export const getBookerBaseUrl = async (organizationId: number | null) => { const orgBrand = await getBrand(organizationId); - return orgBrand?.fullDomain ?? CAL_URL; + return orgBrand?.fullDomain ?? WEBSITE_URL; }; export const getTeamBookerUrl = async (team: { organizationId: number | null }) => { const orgBrand = await getBrand(team.organizationId); - return orgBrand?.fullDomain ?? CAL_URL; + return orgBrand?.fullDomain ?? WEBSITE_URL; }; diff --git a/packages/lib/getEventTypeById.ts b/packages/lib/getEventTypeById.ts index 9a9b21c3ba..09979adf3e 100644 --- a/packages/lib/getEventTypeById.ts +++ b/packages/lib/getEventTypeById.ts @@ -14,7 +14,7 @@ import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-u import { TRPCError } from "@trpc/server"; -import { CAL_URL } from "./constants"; +import { WEBSITE_URL } from "./constants"; import { getBookerBaseUrl } from "./getBookerUrl/server"; interface getEventTypeByIdProps { @@ -304,7 +304,7 @@ export default async function getEventTypeById({ ? await getBookerBaseUrl(restEventType.team.parentId) : restEventType.owner ? await getBookerBaseUrl(currentOrganizationId) - : CAL_URL, + : WEBSITE_URL, children: childrenWithUserProfile.flatMap((ch) => ch.owner !== null ? { diff --git a/packages/lib/hooks/useBookerUrl.ts b/packages/lib/hooks/useBookerUrl.ts index 090826d482..329afc73f4 100644 --- a/packages/lib/hooks/useBookerUrl.ts +++ b/packages/lib/hooks/useBookerUrl.ts @@ -1,7 +1,7 @@ import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider"; -import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL, WEBSITE_URL } from "@calcom/lib/constants"; export const useBookerUrl = () => { const orgBranding = useOrgBranding(); - return orgBranding?.fullDomain ?? CAL_URL ?? WEBAPP_URL; + return orgBranding?.fullDomain ?? WEBSITE_URL ?? WEBAPP_URL; }; diff --git a/packages/ui/components/apps/AppCard.tsx b/packages/ui/components/apps/AppCard.tsx index 411d7071d3..1f1f4586a6 100644 --- a/packages/ui/components/apps/AppCard.tsx +++ b/packages/ui/components/apps/AppCard.tsx @@ -8,7 +8,7 @@ import { doesAppSupportTeamInstall } from "@calcom/app-store/utils"; import { Spinner } from "@calcom/features/calendars/weeklyview/components/spinner/Spinner"; import type { UserAdminTeams } from "@calcom/features/ee/teams/lib/getUserAdminTeams"; import classNames from "@calcom/lib/classNames"; -import { CAL_URL } from "@calcom/lib/constants"; +import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { AppFrontendPayload as App } from "@calcom/types/App"; import type { CredentialFrontendPayload as Credential } from "@calcom/types/Credential"; @@ -276,7 +276,7 @@ const InstallAppButtonChild = ({ StartIcon={(props) => (