Skip to content

Scheduling infrastructure for absolutely everyone.

chore: migrate /apps/[slug]/setup (#19039)

Benny Joo3ca44cff0cd6
diff --git a/apps/web/app/(use-page-wrapper)/apps/[slug]/setup/page.tsx b/apps/web/app/(use-page-wrapper)/apps/[slug]/setup/page.tsx
new file mode 100644
index 00000000000..6ac89e64551
--- /dev/null
+++ b/apps/web/app/(use-page-wrapper)/apps/[slug]/setup/page.tsx
@@ -0,0 +1,35 @@
+import { withAppDirSsr } from "app/WithAppDirSsr";
+import type { PageProps as ServerPageProps } from "app/_types";
+import { _generateMetadata } from "app/_utils";
+import { cookies, headers } from "next/headers";
+
+import { getServerSideProps } from "@calcom/app-store/_pages/setup/_getServerSideProps";
+
+import { buildLegacyCtx } from "@lib/buildLegacyCtx";
+
+import SetupView, { type PageProps as ClientPageProps } from "~/apps/[slug]/setup/setup-view";
+
+export const generateMetadata = async ({ params }: ServerPageProps) => {
+ const metadata = await _generateMetadata(
+ () => `${params.slug}`,
+ () => ""
+ );
+ return {
+ ...metadata,
+ robots: {
+ index: false,
+ follow: false,
+ },
+ };
+};
+
+const getData = withAppDirSsr<ClientPageProps>(getServerSideProps);
+
+const ServerPage = async ({ params, searchParams }: ServerPageProps) => {
+ const context = buildLegacyCtx(headers(), cookies(), params, searchParams);
+
+ const { dehydratedState, ...props } = await getData(context);
+ return <SetupView {...props} />;
+};
+
+export default ServerPage;
\ No newline at end of file
diff --git a/apps/web/app/future/apps/[slug]/setup/page.tsx b/apps/web/app/future/apps/[slug]/setup/page.tsx
deleted file mode 100644
index c10edd12a20..00000000000
--- a/apps/web/app/future/apps/[slug]/setup/page.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { withAppDirSsr } from "app/WithAppDirSsr";
-import type { PageProps as _PageProps } from "app/_types";
-import { _generateMetadata } from "app/_utils";
-import { WithLayout } from "app/layoutHOC";
-
-import { getServerSideProps } from "@calcom/app-store/_pages/setup/_getServerSideProps";
-
-import Page, { type PageProps } from "~/apps/[slug]/setup/setup-view";
-
-export const generateMetadata = async ({ params }: _PageProps) => {
- return await _generateMetadata(
- () => `${params.slug}`,
- () => ""
- );
-};
-
-const getData = withAppDirSsr<PageProps>(getServerSideProps);
-
-export default WithLayout({ getLayout: null, Page, getData });
diff --git a/apps/web/app/future/routing-forms/[...pages]/page.tsx b/apps/web/app/future/routing-forms/[...pages]/page.tsx
deleted file mode 100644
index 4ecc5a1aa08..00000000000
--- a/apps/web/app/future/routing-forms/[...pages]/page.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { PageProps } from "app/_types";
-import { redirect } from "next/navigation";
-import z from "zod";
-
-const paramsSchema = z
- .object({
- pages: z.array(z.string()),
- })
- .catch({
- pages: [],
- });
-
-const Page = ({ params, searchParams }: PageProps) => {
- const { pages } = paramsSchema.parse({ ...params, ...searchParams });
-
- redirect(`/apps/routing-forms/${pages.length ? pages.join("/") : ""}`);
-};
-
-export default Page;
diff --git a/apps/web/app/future/routing-forms/page.tsx b/apps/web/app/future/routing-forms/page.tsx
deleted file mode 100644
index ba222ba4761..00000000000
--- a/apps/web/app/future/routing-forms/page.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { redirect } from "next/navigation";
-
-const Page = () => {
- redirect("/apps/routing-forms/forms");
-};
-
-export default Page;
diff --git a/apps/web/modules/apps/[slug]/setup/setup-view.tsx b/apps/web/modules/apps/[slug]/setup/setup-view.tsx
index 921423ce79b..da07c32b8ef 100644
--- a/apps/web/modules/apps/[slug]/setup/setup-view.tsx
+++ b/apps/web/modules/apps/[slug]/setup/setup-view.tsx
@@ -7,7 +7,6 @@ import { AppSetupPage } from "@calcom/app-store/_pages/setup";
import type { getServerSideProps } from "@calcom/app-store/_pages/setup/_getServerSideProps";
import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";
import type { inferSSRProps } from "@calcom/types/inferSSRProps";
-import { HeadSeo } from "@calcom/ui";
export type PageProps = inferSSRProps<typeof getServerSideProps>;
@@ -28,11 +27,5 @@ export default function SetupInformation(props: PageProps) {
router.replace(`/auth/login?${urlSearchParams.toString()}`);
}
- return (
- <>
- {/* So that the set up page does not get indexed by search engines */}
- <HeadSeo nextSeoProps={{ noindex: true, nofollow: true }} title={`${slug} | Cal.com`} description="" />
- <AppSetupPage slug={slug} {...props} />
- </>
- );
+ return <AppSetupPage slug={slug} {...props} />;
}
diff --git a/apps/web/pages/apps/[slug]/setup.tsx b/apps/web/pages/apps/[slug]/setup.tsx
deleted file mode 100644
index 625040aa7aa..00000000000
--- a/apps/web/pages/apps/[slug]/setup.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { getServerSideProps } from "@calcom/app-store/_pages/setup/_getServerSideProps";
-
-import PageWrapper from "@components/PageWrapper";
-
-import type { PageProps } from "~/apps/[slug]/setup/setup-view";
-import SetupView from "~/apps/[slug]/setup/setup-view";
-
-const Page = (props: PageProps) => <SetupView {...props} />;
-
-Page.PageWrapper = PageWrapper;
-
-export { getServerSideProps };
-
-export default Page;