chore: Remove Pages Router / Use App Router - more, maintenance, upgrade, connect-and-join (#16531)

* Remove Pages Router / Render App Router

* remove head component from maintenance view

* use i18n metadata
This commit is contained in:
Benny Joo
2024-12-10 14:37:25 -07:00
committed by GitHub
parent 44d6c1f3fb
commit c2c082c105
17 changed files with 23 additions and 58 deletions
-4
View File
@@ -371,10 +371,6 @@ APP_ROUTER_AUTH_SAML_ENABLED=0
APP_ROUTER_AUTH_ERROR_ENABLED=0
APP_ROUTER_AUTH_PLATFORM_ENABLED=0
APP_ROUTER_AUTH_OAUTH2_ENABLED=0
APP_ROUTER_MORE_ENABLED=0
APP_ROUTER_MAINTENANCE_ENABLED=0
APP_ROUTER_UPGRADE_ENABLED=0
APP_ROUTER_CONNECT_AND_JOIN_ENABLED=0
# disable setry server source maps
SENTRY_DISABLE_SERVER_WEBPACK_PLUGIN=1
-4
View File
@@ -27,10 +27,6 @@ const ROUTES: [URLPattern, boolean][] = [
["/video/:path*", process.env.APP_ROUTER_VIDEO_ENABLED === "1"] as const,
["/team", process.env.APP_ROUTER_TEAM_ENABLED === "1"] as const,
["/teams", process.env.APP_ROUTER_TEAMS_ENABLED === "1"] as const,
["/more", process.env.APP_ROUTER_MORE_ENABLED === "1"] as const,
["/maintenance", process.env.APP_ROUTER_MAINTENANCE_ENABLED === "1"] as const,
["/upgrade", process.env.APP_ROUTER_UPGRADE_ENABLED === "1"] as const,
["/connect-and-join", process.env.APP_ROUTER_CONNECT_AND_JOIN_ENABLED === "1"] as const,
["/availability", process.env.APP_ROUTER_AVAILABILITY_ENABLED === "1"] as const,
].map(([pathname, enabled]) => [
new URLPattern({
@@ -5,7 +5,7 @@ import LegacyPage from "~/connect-and-join/connect-and-join-view";
export const generateMetadata = async () => {
return await _generateMetadata(
() => "Connect and Join",
(t) => t("connect_and_join"),
() => ""
);
};
@@ -5,10 +5,17 @@ import { APP_NAME } from "@calcom/lib/constants";
import LegacyPage from "~/maintenance/maintenance-view";
export const generateMetadata = async () =>
await _generateMetadata(
export const generateMetadata = async () => {
const metadata = await _generateMetadata(
(t) => t("under_maintenance"),
(t) => t("under_maintenance_description", { appName: APP_NAME })
);
return {
...metadata,
icons: {
icon: "/favicon.ico",
},
};
};
export default WithLayout({ getLayout: null, Page: LegacyPage })<"P">;
@@ -5,7 +5,7 @@ import Page from "~/more/more-page-view";
export const generateMetadata = async () => {
return await _generateMetadata(
() => "More",
(t) => t("more"),
() => ""
);
};
@@ -5,7 +5,7 @@ import LegacyPage from "~/upgrade/upgrade-view";
export const generateMetadata = async () =>
await _generateMetadata(
() => "Upgrade",
(t) => t("upgrade"),
() => ""
);
@@ -1,17 +1,11 @@
"use client";
import Head from "next/head";
import { APP_NAME, WEBSITE_URL } from "@calcom/lib/constants";
import { WEBSITE_URL } from "@calcom/lib/constants";
import { Button } from "@calcom/ui";
export default function MaintenancePage() {
return (
<div className="bg-subtle flex h-screen">
<Head>
<title>Under Maintenance | {APP_NAME}</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<div className="bg-default m-auto rounded-md p-10 text-right ltr:text-left">
<h1 className="text-emphasis text-2xl font-medium">Down for maintenance</h1>
<p className="text-default mb-6 mt-4 max-w-2xl text-sm">
-8
View File
@@ -1,8 +0,0 @@
import PageWrapper from "@components/PageWrapper";
import ConnectAndJoinPage from "~/connect-and-join/connect-and-join-view";
const Page = () => <ConnectAndJoinPage />;
Page.PageWrapper = PageWrapper;
export default Page;
-1
View File
@@ -1 +0,0 @@
export { default } from "~/maintenance/maintenance-view";
-8
View File
@@ -1,8 +0,0 @@
import PageWrapper from "@components/PageWrapper";
import MorePage from "~/more/more-page-view";
const Page = () => <MorePage />;
Page.PageWrapper = PageWrapper;
export default Page;
-8
View File
@@ -1,8 +0,0 @@
import PageWrapper from "@components/PageWrapper";
import UpgradePage from "~/upgrade/upgrade-view";
const Page = () => <UpgradePage />;
Page.PageWrapper = PageWrapper;
export default Page;
@@ -885,6 +885,7 @@
"requires_confirmation_will_block_slot_description": "Unconfirmed bookings still block calendar slots.",
"recurring_event": "Recurring Event",
"recurring_event_description": "People can subscribe for recurring events",
"connect_and_join": "Connect and Join",
"cannot_be_used_with_paid_event_types": "It cannot be used with paid event types",
"warning_payment_instant_meeting_event": "Instant Meetings are not supported with recurring events and payment apps yet",
"warning_instant_meeting_experimental": "Experimental: Instant Meeting Events are currently experimental.",
@@ -28,10 +28,6 @@ checkRoute "$APP_ROUTER_BOOKING_ENABLED" app/future/booking
checkRoute "$APP_ROUTER_VIDEO_ENABLED" app/future/video
checkRoute "$APP_ROUTER_TEAM_ENABLED" app/future/team
checkRoute "$APP_ROUTER_TEAMS_ENABLED" app/future/teams
checkRoute "$APP_ROUTER_MORE_ENABLED" app/future/more
checkRoute "$APP_ROUTER_MAINTENANCE_ENABLED" app/future/maintenance
checkRoute "$APP_ROUTER_UPGRADE_ENABLED" app/future/upgrade
checkRoute "$APP_ROUTER_CONNECT_AND_JOIN_ENABLED" app/future/connect-and-join
# These are routes that don't have and environment variable to enable or disable them
# Will stop removing gradually as we test and confirm that they are working
@@ -6,7 +6,13 @@ import { WEBAPP_URL_FOR_OAUTH } from "@calcom/lib/constants";
import getAppKeysFromSlug from "../../_utils/getAppKeysFromSlug";
import { encodeOAuthState } from "../../_utils/oauth/encodeOAuthState";
const scopes = ["User.Read", "Calendars.Read", "Calendars.ReadWrite", "Calendars.ReadWrite.Shared", "offline_access"];
const scopes = [
"User.Read",
"Calendars.Read",
"Calendars.ReadWrite",
"Calendars.ReadWrite.Shared",
"offline_access",
];
let client_id = "";
+1 -1
View File
@@ -572,7 +572,7 @@ if (only === "all" || only == "ns:columnViewHideEventTypeDetails") {
Cal.ns.columnViewHideEventTypeDetails("ui", {
hideEventTypeDetails: true,
});
Cal.ns.columnViewHideEventTypeDetails("on", {
action: "*",
callback,
+1 -3
View File
@@ -31,8 +31,6 @@ describe("Cal", () => {
CalClass = (await import("./embed")).Cal;
});
describe("createIframe", () => {
describe("params handling with forwardQueryParams feature enabled", () => {
beforeEach(() => {
@@ -126,7 +124,7 @@ describe("Cal", () => {
expect(iframe.src).toContain("duration=30");
expect(iframe.src).toContain("email=test%40example.com");
});
it("should respect forwardQueryParams setting to disable sending page query params but still send the ones in the config", () => {
mockSearchParams("?param1=value");
-4
View File
@@ -251,10 +251,6 @@
"APP_ROUTER_AUTH_ERROR_ENABLED",
"APP_ROUTER_AUTH_PLATFORM_ENABLED",
"APP_ROUTER_AUTH_OAUTH2_ENABLED",
"APP_ROUTER_MORE_ENABLED",
"APP_ROUTER_MAINTENANCE_ENABLED",
"APP_ROUTER_UPGRADE_ENABLED",
"APP_ROUTER_CONNECT_AND_JOIN_ENABLED",
"APP_ROUTER_TEAM_ENABLED",
"APP_ROUTER_TEAMS_ENABLED",
"APP_ROUTER_AVAILABILITY_ENABLED",