Skip to content

Commit

Permalink
chore: migrate /apps/[slug]/setup (#19039)
Browse files Browse the repository at this point in the history
* chore: remove unused files in /future dir

* chore: migrate /apps/[slug]/setup
  • Loading branch information
hbjORbj authored Jan 31, 2025
1 parent 8dd05dd commit 3ca44cf
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 67 deletions.
35 changes: 35 additions & 0 deletions apps/web/app/(use-page-wrapper)/apps/[slug]/setup/page.tsx
Original file line number Diff line number Diff line change
@@ -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;
19 changes: 0 additions & 19 deletions apps/web/app/future/apps/[slug]/setup/page.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions apps/web/app/future/routing-forms/[...pages]/page.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions apps/web/app/future/routing-forms/page.tsx

This file was deleted.

9 changes: 1 addition & 8 deletions apps/web/modules/apps/[slug]/setup/setup-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>;

Expand All @@ -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} />;
}
14 changes: 0 additions & 14 deletions apps/web/pages/apps/[slug]/setup.tsx

This file was deleted.

0 comments on commit 3ca44cf

Please sign in to comment.