Scheduling infrastructure for absolutely everyone.
chore: `settings/platform`, `settings/license-key` - remove pages router and use app router (#17384)
Benny Joo7263f3b00b4e
diff --git a/.env.example b/.env.exampleindex 40a8a67df2a..a59043e8027 100644--- a/.env.example+++ b/.env.example@@ -342,8 +342,6 @@ AB_TEST_BUCKET_PROBABILITY=50# whether we redirect to the future/event-types from event-types or notAPP_ROUTER_EVENT_TYPES_ENABLED=0APP_ROUTER_SETTINGS_DEVELOPER_ENABLED=0-APP_ROUTER_SETTINGS_MY_ACCOUNT_ENABLED=0-APP_ROUTER_SETTINGS_PLATFORM_ENABLED=0APP_ROUTER_SETTINGS_ORG_ENABLED=0APP_ROUTER_APPS_INSTALLED_CATEGORY_ENABLED=0APP_ROUTER_APPS_SLUG_ENABLED=0diff --git a/apps/web/abTest/middlewareFactory.ts b/apps/web/abTest/middlewareFactory.tsindex b618813189c..65bdb7fc24d 100644--- a/apps/web/abTest/middlewareFactory.ts+++ b/apps/web/abTest/middlewareFactory.ts@@ -8,8 +8,6 @@ import { FUTURE_ROUTES_ENABLED_COOKIE_NAME, FUTURE_ROUTES_OVERRIDE_COOKIE_NAME }const ROUTES: [URLPattern, boolean][] = [["/event-types", process.env.APP_ROUTER_EVENT_TYPES_ENABLED === "1"] as const,["/settings/developer/:path*", process.env.APP_ROUTER_SETTINGS_DEVELOPER_ENABLED === "1"] as const,- ["/settings/my-account/:path*", process.env.APP_ROUTER_SETTINGS_MY_ACCOUNT_ENABLED === "1"] as const,- ["/settings/platform/:path*", process.env.APP_ROUTER_SETTINGS_PLATFORM_ENABLED === "1"] as const,["/settings/organizations/:path*", process.env.APP_ROUTER_SETTINGS_ORG_ENABLED === "1"] as const,["/apps/installed/:category", process.env.APP_ROUTER_APPS_INSTALLED_CATEGORY_ENABLED === "1"] as const,["/apps/:slug", process.env.APP_ROUTER_APPS_SLUG_ENABLED === "1"] as const,diff --git a/apps/web/app/future/settings/platform/oauth-clients/[clientId]/edit/page.tsx b/apps/web/app/future/settings/platform/oauth-clients/[clientId]/edit/page.tsxindex 754e9a20fcc..0b4ef43affc 100644--- a/apps/web/app/future/settings/platform/oauth-clients/[clientId]/edit/page.tsx+++ b/apps/web/app/future/settings/platform/oauth-clients/[clientId]/edit/page.tsx@@ -5,7 +5,7 @@ import EditView from "~/settings/platform/oauth-clients/[clientId]/edit/edit-vieexport const generateMetadata = async () =>await _generateMetadata(- () => "OAuth client updation form",+ (t) => t("oAuth_client_updation_form"),() => "");diff --git a/apps/web/app/future/settings/platform/oauth-clients/[clientId]/edit/webhooks/page.tsx b/apps/web/app/future/settings/platform/oauth-clients/[clientId]/edit/webhooks/page.tsxindex 7eef008b4ee..e26b3432697 100644--- a/apps/web/app/future/settings/platform/oauth-clients/[clientId]/edit/webhooks/page.tsx+++ b/apps/web/app/future/settings/platform/oauth-clients/[clientId]/edit/webhooks/page.tsx@@ -5,7 +5,7 @@ import EditWebhooksView from "~/settings/platform/oauth-clients/[clientId]/edit/export const generateMetadata = async () =>await _generateMetadata(- () => "OAuth client updation form",+ (t) => t("oAuth_client_updation_form"),() => "");diff --git a/apps/web/app/future/settings/license-key/new/page.tsx b/apps/web/app/settings/license-key/new/page.tsxsimilarity index 100%rename from apps/web/app/future/settings/license-key/new/page.tsxrename to apps/web/app/settings/license-key/new/page.tsxdiff --git a/apps/web/app/settings/platform/billing/page.tsx b/apps/web/app/settings/platform/billing/page.tsxnew file mode 100644index 00000000000..0644ec7c7f7--- /dev/null+++ b/apps/web/app/settings/platform/billing/page.tsx@@ -0,0 +1,15 @@+import { _generateMetadata } from "app/_utils";+import { WithLayout } from "app/layoutHOC";++import PlatformBillingUpgrade from "~/settings/platform/billing/billing-view";++export const generateMetadata = async () => {+ return await _generateMetadata(+ (t) => t("platform_billing"),+ (t) => t("manage_billing_description")+ );+};++export default WithLayout({+ Page: PlatformBillingUpgrade,+});diff --git a/apps/web/app/settings/platform/new/page.tsx b/apps/web/app/settings/platform/new/page.tsxnew file mode 100644index 00000000000..033ef743807--- /dev/null+++ b/apps/web/app/settings/platform/new/page.tsx@@ -0,0 +1,21 @@+import { withAppDirSsr } from "app/WithAppDirSsr";+import { _generateMetadata } from "app/_utils";+import { WithLayout } from "app/layoutHOC";++import { getServerSideProps } from "@lib/settings/organizations/new/getServerSideProps";+import { type inferSSRProps } from "@lib/types/inferSSRProps";++import LegacyPage, { LayoutWrapper } from "~/settings/platform/new/create-new-view";++export const generateMetadata = async () =>+ await _generateMetadata(+ (t) => t("set_up_your_platform_organization"),+ (t) => t("platform_organization_description")+ );++export default WithLayout({+ getLayout: LayoutWrapper,+ Page: LegacyPage,+ getData: withAppDirSsr<inferSSRProps<typeof getServerSideProps>>(getServerSideProps),+ requiresLicense: true,+});diff --git a/apps/web/app/settings/platform/oauth-clients/[clientId]/edit/page.tsx b/apps/web/app/settings/platform/oauth-clients/[clientId]/edit/page.tsxnew file mode 100644index 00000000000..0b4ef43affc--- /dev/null+++ b/apps/web/app/settings/platform/oauth-clients/[clientId]/edit/page.tsx@@ -0,0 +1,15 @@+import { _generateMetadata } from "app/_utils";+import { WithLayout } from "app/layoutHOC";++import EditView from "~/settings/platform/oauth-clients/[clientId]/edit/edit-view";++export const generateMetadata = async () =>+ await _generateMetadata(+ (t) => t("oAuth_client_updation_form"),+ () => ""+ );++export default WithLayout({+ getLayout: null,+ Page: EditView,+});diff --git a/apps/web/app/settings/platform/oauth-clients/[clientId]/edit/webhooks/page.tsx b/apps/web/app/settings/platform/oauth-clients/[clientId]/edit/webhooks/page.tsxnew file mode 100644index 00000000000..e26b3432697--- /dev/null+++ b/apps/web/app/settings/platform/oauth-clients/[clientId]/edit/webhooks/page.tsx@@ -0,0 +1,15 @@+import { _generateMetadata } from "app/_utils";+import { WithLayout } from "app/layoutHOC";++import EditWebhooksView from "~/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view";++export const generateMetadata = async () =>+ await _generateMetadata(+ (t) => t("oAuth_client_updation_form"),+ () => ""+ );++export default WithLayout({+ getLayout: null,+ Page: EditWebhooksView,+});diff --git a/apps/web/app/settings/platform/oauth-clients/create/page.tsx b/apps/web/app/settings/platform/oauth-clients/create/page.tsxnew file mode 100644index 00000000000..5303d7dc4a4--- /dev/null+++ b/apps/web/app/settings/platform/oauth-clients/create/page.tsx@@ -0,0 +1,19 @@+import type { PageProps } from "app/_types";+import { _generateMetadata } from "app/_utils";+import { WithLayout } from "app/layoutHOC";++import CreateNewView from "~/settings/platform/oauth-clients/create-new-view";++export const generateMetadata = async ({ params, searchParams }: PageProps) => {+ const p = { ...params, ...searchParams };+ const clientId = p?.clientId ?? "";+ return await _generateMetadata(+ () => `OAuth client ${!!clientId ? "updation" : "creation"} form`,+ () => ""+ );+};++export default WithLayout({+ getLayout: null,+ Page: CreateNewView,+});diff --git a/apps/web/app/settings/platform/page.tsx b/apps/web/app/settings/platform/page.tsxnew file mode 100644index 00000000000..e6105fcc58a--- /dev/null+++ b/apps/web/app/settings/platform/page.tsx@@ -0,0 +1,16 @@+import { _generateMetadata } from "app/_utils";+import { WithLayout } from "app/layoutHOC";++import PlatformView from "~/settings/platform/platform-view";++export const generateMetadata = async () => {+ return await _generateMetadata(+ () => "Platform",+ () => "Manage everything related to platform."+ );+};++export default WithLayout({+ getLayout: null,+ Page: PlatformView,+});diff --git a/apps/web/app/settings/platform/plans/page.tsx b/apps/web/app/settings/platform/plans/page.tsxnew file mode 100644index 00000000000..a6c33b759a9--- /dev/null+++ b/apps/web/app/settings/platform/plans/page.tsx@@ -0,0 +1,15 @@+import { _generateMetadata } from "app/_utils";+import { WithLayout } from "app/layoutHOC";++import PlatformPlansView from "~/settings/platform/plans/platform-plans-view";++export const generateMetadata = async () => {+ return await _generateMetadata(+ () => "Platform plans",+ () => ""+ );+};++export default WithLayout({+ Page: PlatformPlansView,+});diff --git a/apps/web/modules/settings/platform/billing/billing-view.tsx b/apps/web/modules/settings/platform/billing/billing-view.tsxindex d7e1b7864db..8c4d6d16b10 100644--- a/apps/web/modules/settings/platform/billing/billing-view.tsx+++ b/apps/web/modules/settings/platform/billing/billing-view.tsx@@ -55,11 +55,11 @@ export default function PlatformBillingUpgrade() {return (<div><Shell- heading="Platform billing"- title="Platform billing"+ heading={t("platform_billing")}+ title={t("platform_billing")}hideHeadingOnMobilewithoutMain={false}- subtitle="Manage all things billing"+ subtitle={t("manage_billing_description")}isPlatformUser={true}><><div className="border-subtle space-y-6 rounded-lg border px-6 py-8 text-sm sm:space-y-8">diff --git a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-view.tsx b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-view.tsxindex 8285c973707..ec440afba53 100644--- a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-view.tsx+++ b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-view.tsx@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";import Shell from "@calcom/features/shell/Shell";import { ErrorCode } from "@calcom/lib/errorCodes";+import { useLocale } from "@calcom/lib/hooks/useLocale";import { PERMISSIONS_GROUPED_MAP } from "@calcom/platform-constants";import { showToast } from "@calcom/ui";@@ -30,6 +31,7 @@ import {} from "../../../../../../../../packages/platform/utils/permissions";export default function EditOAuthClient() {+ const { t } = useLocale();const router = useRouter();const params = useParams<{ clientId: string }>();const clientId = params?.clientId || "";@@ -78,7 +80,7 @@ export default function EditOAuthClient() {if (isPlatformUser && isPaidUser) {return (<div>- <Shell title="OAuth client updation form" isPlatformUser={true}>+ <Shell title={t("oAuth_client_updation_form")} isPlatformUser={true}><div className="m-2 md:mx-14 md:mx-5"><div className="border-subtle mx-auto block justify-between rounded-t-lg border px-4 py-6 sm:flex sm:px-6"><div className="flex w-full flex-col">diff --git a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsxindex 35583707afd..7e782eba0c5 100644--- a/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx+++ b/apps/web/modules/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view.tsx@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";import Shell from "@calcom/features/shell/Shell";import { WebhookForm } from "@calcom/features/webhooks/components";+import { useLocale } from "@calcom/lib/hooks/useLocale";import { WebhookTriggerEvents } from "@calcom/prisma/enums";import { showToast } from "@calcom/ui";@@ -18,6 +19,7 @@ import NoPlatformPlan from "@components/settings/platform/dashboard/NoPlatformPlimport { useGetUserAttributes } from "@components/settings/platform/hooks/useGetUserAttributes";export default function EditOAuthClientWebhooks() {+ const { t } = useLocale();const router = useRouter();const params = useParams<{ clientId: string }>();const clientId = params?.clientId || "";@@ -40,7 +42,7 @@ export default function EditOAuthClientWebhooks() {if (isPlatformUser && isPaidUser) {return (<div>- <Shell title="OAuth client updation form" isPlatformUser={true}>+ <Shell title={t("oAuth_client_updation_form")} isPlatformUser={true}><div className="m-2 md:mx-5"><div className="border-subtle mx-auto block justify-between rounded-t-lg border px-4 py-6 sm:flex sm:px-6"><div className="flex w-full flex-col">diff --git a/apps/web/pages/settings/license-key/new/index.tsx b/apps/web/pages/settings/license-key/new/index.tsxdeleted file mode 100644index c607a3709e1..00000000000--- a/apps/web/pages/settings/license-key/new/index.tsx+++ /dev/null@@ -1,27 +0,0 @@-"use client";--import { useLocale } from "@calcom/lib/hooks/useLocale";-import { Meta } from "@calcom/ui";--import { getServerSideProps } from "@lib/settings/license-key/new/getServerSideProps";--import PageWrapper from "@components/PageWrapper";--import CreateANewLicenseKeyForm, { LayoutWrapper } from "~/settings/license-key/new/new-view";--const CreateNewLicenseKeyPage = () => {- const { t } = useLocale();- return (- <>- <Meta title={t("set_up_your_organization")} description={t("organizations_description")} />- <CreateANewLicenseKeyForm />- </>- );-};--CreateNewLicenseKeyPage.getLayout = LayoutWrapper;-CreateNewLicenseKeyPage.PageWrapper = PageWrapper;--export default CreateNewLicenseKeyPage;--export { getServerSideProps };diff --git a/apps/web/pages/settings/platform/billing/index.tsx b/apps/web/pages/settings/platform/billing/index.tsxdeleted file mode 100644index 4bdf02297b9..00000000000--- a/apps/web/pages/settings/platform/billing/index.tsx+++ /dev/null@@ -1,12 +0,0 @@-import PageWrapper from "@components/PageWrapper";--import PlatformBillingUpgrade from "~/settings/platform/billing/billing-view";--const Page = new Proxy<{- (): JSX.Element;- PageWrapper?: typeof PageWrapper;-}>(PlatformBillingUpgrade, {});--Page.PageWrapper = PageWrapper;--export default Page;diff --git a/apps/web/pages/settings/platform/index.tsx b/apps/web/pages/settings/platform/index.tsxdeleted file mode 100644index 3d029175264..00000000000--- a/apps/web/pages/settings/platform/index.tsx+++ /dev/null@@ -1,12 +0,0 @@-import PageWrapper from "@components/PageWrapper";--import PlatformView from "~/settings/platform/platform-view";--const Page = new Proxy<{- (): JSX.Element;- PageWrapper?: typeof PageWrapper;-}>(PlatformView, {});--Page.PageWrapper = PageWrapper;--export default Page;diff --git a/apps/web/pages/settings/platform/new/index.tsx b/apps/web/pages/settings/platform/new/index.tsxdeleted file mode 100644index dfffff7d29f..00000000000--- a/apps/web/pages/settings/platform/new/index.tsx+++ /dev/null@@ -1,64 +0,0 @@-import { useRouter } from "next/navigation";--import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired";-import { useLocale } from "@calcom/lib/hooks/useLocale";-import { Meta } from "@calcom/ui";-import { SkeletonContainer, SkeletonText } from "@calcom/ui";--import { getServerSideProps } from "@lib/settings/organizations/new/getServerSideProps";--import PageWrapper from "@components/PageWrapper";-import usePlatformMe from "@components/settings/platform/hooks/usePlatformMe";--import CreateNewOrganizationPage, { LayoutWrapper } from "~/settings/platform/new/create-new-view";--const SkeletonLoader = () => {- return (- <SkeletonContainer>- <div className="mr-3">- <SkeletonText className="h-4 w-28" />- <SkeletonText className="mt-3 h-11 w-full" />- <SkeletonText className="mt-2 h-11 w-full" />- </div>- </SkeletonContainer>- );-};--const Page = () => {- const { t } = useLocale();- const { isFetching, data: platformMe } = usePlatformMe();- const router = useRouter();-- if (isFetching) {- return <SkeletonLoader />;- }-- if (platformMe?.organization?.id) {- // if user has a platform org redirect to platform dashboard- if (platformMe?.organization?.isPlatform) {- router.push("/settings/platform");- // user has a regular org redirect to organization settings- } else {- router.push("/settings/organizations/profile");- }- // display loader while redirection is happening- return <SkeletonLoader />;- }-- return (- <LicenseRequired>- <Meta- title={t("set_up_your_platform_organization")}- description={t("platform_organization_description")}- />- <CreateNewOrganizationPage />- </LicenseRequired>- );-};--Page.getLayout = LayoutWrapper;-Page.PageWrapper = PageWrapper;--export default Page;--export { getServerSideProps };diff --git a/apps/web/pages/settings/platform/oauth-clients/[clientId]/edit/index.tsx b/apps/web/pages/settings/platform/oauth-clients/[clientId]/edit/index.tsxdeleted file mode 100644index 5588eacbc36..00000000000--- a/apps/web/pages/settings/platform/oauth-clients/[clientId]/edit/index.tsx+++ /dev/null@@ -1,12 +0,0 @@-import PageWrapper from "@components/PageWrapper";--import EditView from "~/settings/platform/oauth-clients/[clientId]/edit/edit-view";--const Page = new Proxy<{- (): JSX.Element;- PageWrapper?: typeof PageWrapper;-}>(EditView, {});--Page.PageWrapper = PageWrapper;--export default Page;diff --git a/apps/web/pages/settings/platform/oauth-clients/[clientId]/edit/webhooks.tsx b/apps/web/pages/settings/platform/oauth-clients/[clientId]/edit/webhooks.tsxdeleted file mode 100644index 818de3ef2c4..00000000000--- a/apps/web/pages/settings/platform/oauth-clients/[clientId]/edit/webhooks.tsx+++ /dev/null@@ -1,12 +0,0 @@-import PageWrapper from "@components/PageWrapper";--import EditWebhooksView from "~/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view";--const Page = new Proxy<{- (): JSX.Element;- PageWrapper?: typeof PageWrapper;-}>(EditWebhooksView, {});--Page.PageWrapper = PageWrapper;--export default Page;diff --git a/apps/web/pages/settings/platform/oauth-clients/create.tsx b/apps/web/pages/settings/platform/oauth-clients/create.tsxdeleted file mode 100644index 593eef06ffd..00000000000--- a/apps/web/pages/settings/platform/oauth-clients/create.tsx+++ /dev/null@@ -1,12 +0,0 @@-import PageWrapper from "@components/PageWrapper";--import CreateOAuthClientView from "~/settings/platform/oauth-clients/create-new-view";--const Page = new Proxy<{- (): JSX.Element;- PageWrapper?: typeof PageWrapper;-}>(CreateOAuthClientView, {});--Page.PageWrapper = PageWrapper;--export default Page;diff --git a/apps/web/pages/settings/platform/plans/index.tsx b/apps/web/pages/settings/platform/plans/index.tsxdeleted file mode 100644index 8aa52be3e52..00000000000--- a/apps/web/pages/settings/platform/plans/index.tsx+++ /dev/null@@ -1,12 +0,0 @@-import PageWrapper from "@components/PageWrapper";--import PlatformPlansView from "~/settings/platform/plans/platform-plans-view";--const Page = new Proxy<{- (): JSX.Element;- PageWrapper?: typeof PageWrapper;-}>(PlatformPlansView, {});--Page.PageWrapper = PageWrapper;--export default Page;diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.jsonindex f4527d2b68c..d7aec12bdfd 100644--- a/apps/web/public/static/locales/en/common.json+++ b/apps/web/public/static/locales/en/common.json@@ -1630,6 +1630,7 @@"format": "Format","uppercase_for_letters": "Use uppercase for all letters","replace_whitespaces_underscores": "Replace whitespaces with underscores",+ "platform_billing": "Platform billing","manage_billing": "Manage billing","manage_billing_description": "Manage all things billing","billing_freeplan_title": "You're currently on the FREE plan",@@ -2276,6 +2277,7 @@"seat_options_doesnt_multiple_durations": "Seat option doesn't support multiple durations","include_calendar_event": "Include calendar event","oAuth": "OAuth",+ "oAuth_client_updation_form": "OAuth client updation form","recently_added": "Recently added","connect_all_calendars": "Connect all your calendars","connect_all_calendars_description": "{{appName}} reads availability from all your existing calendars.",diff --git a/apps/web/scripts/vercel-app-router-deploy.sh b/apps/web/scripts/vercel-app-router-deploy.shindex 442d1930826..4f25330eeea 100755--- a/apps/web/scripts/vercel-app-router-deploy.sh+++ b/apps/web/scripts/vercel-app-router-deploy.sh@@ -9,8 +9,6 @@ checkRoute () {checkRoute "$APP_ROUTER_EVENT_TYPES_ENABLED" app/future/event-typescheckRoute "$APP_ROUTER_AVAILABILITY_ENABLED" app/future/availabilitycheckRoute "$APP_ROUTER_SETTINGS_DEVELOPER_ENABLED" app/future/settings/developer-checkRoute "$APP_ROUTER_SETTINGS_MY_ACCOUNT_ENABLED" app/future/settings/my-account-checkRoute "$APP_ROUTER_SETTINGS_PLATFORM_ENABLED" app/future/settings/platformcheckRoute "$APP_ROUTER_SETTINGS_ORG_ENABLED" app/future/settings/organizationscheckRoute "$APP_ROUTER_APPS_INSTALLED_CATEGORY_ENABLED" app/future/apps/installedcheckRoute "$APP_ROUTER_APPS_SLUG_ENABLED" app/future/apps/\[slug\]diff --git a/turbo.json b/turbo.jsonindex a76a271955e..e89187f7da1 100644--- a/turbo.json+++ b/turbo.json@@ -241,8 +241,6 @@"APP_ROUTER_EVENT_TYPES_ENABLED","APP_ROUTER_GETTING_STARTED_STEP_ENABLED","APP_ROUTER_SETTINGS_DEVELOPER_ENABLED",- "APP_ROUTER_SETTINGS_MY_ACCOUNT_ENABLED",- "APP_ROUTER_SETTINGS_PLATFORM_ENABLED","APP_ROUTER_SETTINGS_ORG_ENABLED","APP_ROUTER_SETTINGS_TEAMS_ENABLED","APP_ROUTER_WORKFLOWS_ENABLED",