Make cal.com version available on all pages, even on login page. (#6221)

* Make cal.com version available on all pages, even on login page.

* Extract out calcom version as a utility

* added version to login screen

* added ee and ce to version

* fixed lint

* Fix import

* removed  version info component

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-01-02 20:24:35 +05:30
1 parent fe14839f1b
commit 33530ad8c8
5 files changed
+27 -24

No files matched your search

+7
View File
@@ -1,3 +1,6 @@
/* TODO: Get this from endpoint */
import pkg from "@calcom/web/package.json";
const VERCEL_URL = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : "";
const RAILWAY_STATIC_URL = process.env.RAILWAY_STATIC_URL ? `https://${process.env.RAILWAY_STATIC_URL}` : "";
const HEROKU_URL = process.env.HEROKU_APP_NAME ? `https://${process.env.HEROKU_APP_NAME}.herokuapp.com` : "";
@@ -53,3 +56,7 @@ export const IS_STRIPE_ENABLED = !!(
);
/** Self hosted shouldn't checkout when creating teams unless required */
export const IS_TEAM_BILLING_ENABLED = IS_STRIPE_ENABLED && (!IS_SELF_HOSTED || HOSTED_CAL_FEATURES);
export const CalComVersion = `v.${pkg.version}-${
process.env.NEXT_PUBLIC_WEBSITE_URL === "https://cal.com" ? "h" : "sh"
}-${process.env.CALCOM_LICENSE_KEY === "" ? "ee" : "ce"}`;
+2 -1
View File
@@ -1,7 +1,8 @@
{
"extends": "@calcom/tsconfig/base.json",
"compilerOptions": {
"target": "es5"
"target": "es5",
"resolveJsonModule": true
},
"include": [".", "../types/next-auth.d.ts"],
"exclude": ["dist", "build", "node_modules"]
+5 -20
View File
@@ -1,5 +1,4 @@
import type { User } from "@prisma/client";
import noop from "lodash/noop";
import { signOut, useSession } from "next-auth/react";
import Link from "next/link";
import { NextRouter, useRouter } from "next/router";
@@ -19,15 +18,15 @@ import CustomBranding from "@calcom/lib/CustomBranding";
import classNames from "@calcom/lib/classNames";
import {
APP_NAME,
COMPANY_NAME,
DESKTOP_APP_LINK,
JOIN_SLACK,
ROADMAP,
WEBAPP_URL,
COMPANY_NAME,
CalComVersion,
} from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import useTheme from "@calcom/lib/hooks/useTheme";
import isCalcom from "@calcom/lib/isCalcom";
import { trpc } from "@calcom/trpc/react";
import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
import { SVGComponent } from "@calcom/types/SVGComponent";
@@ -44,9 +43,6 @@ import {
showToast,
TimezoneChangeDialog,
} from "../..";
/* TODO: Get this from endpoint */
import pkg from "../../../../apps/web/package.json";
import ErrorBoundary from "../../ErrorBoundary";
import { KBarContent, KBarRoot, KBarTrigger } from "../../Kbar";
import Logo from "../../Logo";
@@ -720,19 +716,6 @@ const MobileNavigationMoreItem: React.FC<{
);
};
function DeploymentInfo() {
return (
<small
style={{
fontSize: "0.5rem",
}}
className="mx-3 mt-1 mb-2 hidden opacity-50 lg:block">
&copy; {new Date().getFullYear()} {COMPANY_NAME} v.{pkg.version + "-"}
{process.env.NEXT_PUBLIC_WEBSITE_URL === "https://cal.com" ? "h" : "sh"}
</small>
);
}
function SideBarContainer() {
const { status } = useSession();
const router = useRouter();
@@ -796,7 +779,9 @@ function SideBar() {
<UserDropdown small />
</span>
</div>
<DeploymentInfo />
<small className="mx-3 mt-1 mb-2 hidden text-[0.5rem] opacity-50 lg:block">
&copy; {new Date().getFullYear()} {COMPANY_NAME} {CalComVersion}
</small>
</div>
</aside>
</div>