From dc33da59f78c3547744686788c3460b2002b879e Mon Sep 17 00:00:00 2001 From: zomars Date: Sun, 24 Apr 2022 13:51:35 -0600 Subject: [PATCH] Adds staging/prod admin console links --- apps/web/ee/components/LicenseRequired.tsx | 12 +++++------- packages/ee/server/checkLicense.ts | 4 +++- packages/lib/constants.ts | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/web/ee/components/LicenseRequired.tsx b/apps/web/ee/components/LicenseRequired.tsx index 90768dcac4..64ce2716d7 100644 --- a/apps/web/ee/components/LicenseRequired.tsx +++ b/apps/web/ee/components/LicenseRequired.tsx @@ -2,6 +2,8 @@ import { ExclamationIcon } from "@heroicons/react/solid"; import { useSession } from "next-auth/react"; import { AriaRole, FC, Fragment } from "react"; +import { CONSOLE_URL } from "@calcom/lib/constants"; + import EmptyScreen from "@components/EmptyScreen"; type LicenseRequiredProps = { @@ -27,13 +29,9 @@ const LicenseRequired: FC = ({ children, as = "", ...rest headline="This is an enterprise feature" description={ <> - To enable this feature, please refer to{" "} - - cal.com/enterprise + To enable this feature, get a deployment key at{" "} + + Cal.com console . diff --git a/packages/ee/server/checkLicense.ts b/packages/ee/server/checkLicense.ts index 5629f05772..c003a388ad 100644 --- a/packages/ee/server/checkLicense.ts +++ b/packages/ee/server/checkLicense.ts @@ -1,7 +1,9 @@ import cache from "memory-cache"; +import { CONSOLE_URL } from "@calcom/lib/constants"; + async function checkLicense(license: string): Promise { - const url = `${process.env.NEXT_PUBLIC_CONSOLE_URL}/api/license?key=${license}`; + const url = `${CONSOLE_URL}/api/license?key=${license}`; const cachedResponse = cache.get(url); if (cachedResponse) { return cachedResponse; diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts index f9f4d02344..1f76263bed 100644 --- a/packages/lib/constants.ts +++ b/packages/lib/constants.ts @@ -2,6 +2,7 @@ export const WEBAPP_URL = process.env.NEXT_PUBLIC_WEBAPP_URL || `https://${proce /** @deprecated use `WEBAPP_URL` */ export const BASE_URL = WEBAPP_URL; export const WEBSITE_URL = process.env.NEXT_PUBLIC_WEBSITE_URL || "https://cal.com"; +export const CONSOLE_URL = `https://console.cal.${process.env.VERCEL_ENV === "production" ? "com" : "dev"}`; export const IS_PRODUCTION = process.env.NODE_ENV === "production"; export const TRIAL_LIMIT_DAYS = 14; export const HOSTED_CAL_FEATURES = process.env.HOSTED_CAL_FEATURES || BASE_URL === "https://app.cal.com";