Scheduling infrastructure for absolutely everyone.
chore: App router - add missing metadata for `/[user]` pages (#16516)
Benny Jooaa3c91ebd686
diff --git a/apps/web/app/future/[user]/[type]/embed/page.tsx b/apps/web/app/future/[user]/[type]/embed/page.tsxindex 22db0557c90..3986b0b9ae5 100644--- a/apps/web/app/future/[user]/[type]/embed/page.tsx+++ b/apps/web/app/future/[user]/[type]/embed/page.tsx@@ -2,8 +2,11 @@ import { withAppDirSsr } from "app/WithAppDirSsr";import withEmbedSsrAppDir from "app/WithEmbedSSR";import { WithLayout } from "app/layoutHOC";-import LegacyPage from "~/users/views/users-type-public-view";-import { getServerSideProps, type PageProps } from "~/users/views/users-type-public-view.getServerSideProps";+import { getServerSideProps } from "@server/lib/[user]/[type]/getServerSideProps";++import LegacyPage, { type PageProps } from "~/users/views/users-type-public-view";++export { generateMetadata } from "../page";const getData = withAppDirSsr<PageProps>(getServerSideProps);diff --git a/apps/web/app/future/[user]/[type]/page.tsx b/apps/web/app/future/[user]/[type]/page.tsxindex 024c56c91b7..3a61c20e5ba 100644--- a/apps/web/app/future/[user]/[type]/page.tsx+++ b/apps/web/app/future/[user]/[type]/page.tsx@@ -9,11 +9,10 @@ import { EventRepository } from "@calcom/lib/server/repository/event";import { buildLegacyCtx } from "@lib/buildLegacyCtx";+import { getServerSideProps } from "@server/lib/[user]/[type]/getServerSideProps";++import type { PageProps as LegacyPageProps } from "~/users/views/users-type-public-view";import LegacyPage from "~/users/views/users-type-public-view";-import {- getServerSideProps,- type PageProps as LegacyPageProps,-} from "~/users/views/users-type-public-view.getServerSideProps";export const generateMetadata = async ({ params, searchParams }: PageProps) => {const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams);diff --git a/apps/web/app/future/[user]/embed/page.tsx b/apps/web/app/future/[user]/embed/page.tsxindex cb67b983974..5aae7be4346 100644--- a/apps/web/app/future/[user]/embed/page.tsx+++ b/apps/web/app/future/[user]/embed/page.tsx@@ -2,8 +2,12 @@ import { withAppDirSsr } from "app/WithAppDirSsr";import withEmbedSsrAppDir from "app/WithEmbedSSR";import { WithLayout } from "app/layoutHOC";+import { getServerSideProps } from "@server/lib/[user]/getServerSideProps";++import type { PageProps as UserPageProps } from "~/users/views/users-public-view";import LegacyPage from "~/users/views/users-public-view";-import { getServerSideProps, type UserPageProps } from "~/users/views/users-public-view.getServerSideProps";++export { generateMetadata } from "../page";const getData = withAppDirSsr<UserPageProps>(getServerSideProps);diff --git a/apps/web/app/future/[user]/page.tsx b/apps/web/app/future/[user]/page.tsxindex 76871c3848e..e26286d1d50 100644--- a/apps/web/app/future/[user]/page.tsx+++ b/apps/web/app/future/[user]/page.tsx@@ -8,8 +8,10 @@ import { getLayout } from "@calcom/features/MainLayoutAppDir";import { buildLegacyCtx } from "@lib/buildLegacyCtx";+import { getServerSideProps } from "@server/lib/[user]/getServerSideProps";++import type { PageProps as LegacyPageProps } from "~/users/views/users-public-view";import LegacyPage from "~/users/views/users-public-view";-import { getServerSideProps, type UserPageProps } from "~/users/views/users-public-view.getServerSideProps";export const generateMetadata = async ({ params, searchParams }: PageProps) => {const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams));@@ -21,5 +23,5 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => {);};-const getData = withAppDirSsr<UserPageProps>(getServerSideProps);+const getData = withAppDirSsr<LegacyPageProps>(getServerSideProps);export default WithLayout({ getLayout, getData, Page: LegacyPage })<"P">;diff --git a/apps/web/lib/org/[orgSlug]/[user]/[type]/getServerSideProps.tsx b/apps/web/lib/org/[orgSlug]/[user]/[type]/getServerSideProps.tsxindex 452f5bef6c5..0fe7c10c0cf 100644--- a/apps/web/lib/org/[orgSlug]/[user]/[type]/getServerSideProps.tsx+++ b/apps/web/lib/org/[orgSlug]/[user]/[type]/getServerSideProps.tsx@@ -7,7 +7,7 @@ import prisma from "@calcom/prisma";import { getServerSideProps as GSSTeamTypePage } from "@lib/team/[slug]/[type]/getServerSideProps";-import { getServerSideProps as GSSUserTypePage } from "~/users/views/users-type-public-view.getServerSideProps";+import { getServerSideProps as GSSUserTypePage } from "@server/lib/[user]/[type]/getServerSideProps";const paramsSchema = z.object({orgSlug: z.string().transform((s) => slugify(s)),diff --git a/apps/web/modules/users/views/users-public-view.tsx b/apps/web/modules/users/views/users-public-view.tsxindex f42ae41d5e6..fe31046a93f 100644--- a/apps/web/modules/users/views/users-public-view.tsx+++ b/apps/web/modules/users/views/users-public-view.tsx@@ -18,7 +18,7 @@ import { useRouterQuery } from "@calcom/lib/hooks/useRouterQuery";import useTheme from "@calcom/lib/hooks/useTheme";import { HeadSeo, Icon, UnpublishedEntity, UserAvatar } from "@calcom/ui";-import { type getServerSideProps } from "./users-public-view.getServerSideProps";+import type { getServerSideProps } from "@server/lib/[user]/getServerSideProps";export type PageProps = InferGetServerSidePropsType<typeof getServerSideProps>;export function UserPage(props: PageProps) {diff --git a/apps/web/modules/users/views/users-type-public-view.tsx b/apps/web/modules/users/views/users-type-public-view.tsxindex e071569be93..5099ea9ddaf 100644--- a/apps/web/modules/users/views/users-type-public-view.tsx+++ b/apps/web/modules/users/views/users-type-public-view.tsx@@ -6,7 +6,12 @@ import { Booker } from "@calcom/atoms/monorepo";import { getBookerWrapperClasses } from "@calcom/features/bookings/Booker/utils/getBookerWrapperClasses";import { BookerSeo } from "@calcom/features/bookings/components/BookerSeo";-import { type PageProps } from "./users-type-public-view.getServerSideProps";+import type { inferSSRProps } from "@lib/types/inferSSRProps";+import type { EmbedProps } from "@lib/withEmbedSsr";++import type { getServerSideProps } from "@server/lib/[user]/[type]/getServerSideProps";++export type PageProps = inferSSRProps<typeof getServerSideProps> & EmbedProps;export const getMultipleDurationValue = (multipleDurationConfig: number[] | undefined,diff --git a/apps/web/pages/[user]/[type]/embed.tsx b/apps/web/pages/[user]/[type]/embed.tsxindex 4b8882841dc..5fa5747255b 100644--- a/apps/web/pages/[user]/[type]/embed.tsx+++ b/apps/web/pages/[user]/[type]/embed.tsx@@ -1,15 +1,7 @@import withEmbedSsr from "@lib/withEmbedSsr";-import PageWrapper from "@components/PageWrapper";--import TypePage from "~/users/views/users-type-public-view";-import type { PageProps } from "~/users/views/users-type-public-view.getServerSideProps";-import { getServerSideProps as _getServerSideProps } from "~/users/views/users-type-public-view.getServerSideProps";+import { getServerSideProps as _getServerSideProps } from "@server/lib/[user]/[type]/getServerSideProps";export const getServerSideProps = withEmbedSsr(_getServerSideProps);-const Type = (props: PageProps) => <TypePage {...props} />;--Type.PageWrapper = PageWrapper;--export default Type;+export { default } from "./index";diff --git a/apps/web/pages/[user]/[type]/index.tsx b/apps/web/pages/[user]/[type]/index.tsxindex 6b92d18f058..4e98c0bc991 100644--- a/apps/web/pages/[user]/[type]/index.tsx+++ b/apps/web/pages/[user]/[type]/index.tsx@@ -1,9 +1,9 @@import PageWrapper from "@components/PageWrapper";+import type { PageProps } from "~/users/views/users-type-public-view";import TypePage from "~/users/views/users-type-public-view";-import type { PageProps } from "~/users/views/users-type-public-view.getServerSideProps";-export { getServerSideProps } from "~/users/views/users-type-public-view.getServerSideProps";+export { getServerSideProps } from "@server/lib/[user]/[type]/getServerSideProps";const Type = (props: PageProps) => <TypePage {...props} />;diff --git a/apps/web/pages/[user]/embed.tsx b/apps/web/pages/[user]/embed.tsxindex 5c0a3bb1c35..066b82b7fb6 100644--- a/apps/web/pages/[user]/embed.tsx+++ b/apps/web/pages/[user]/embed.tsx@@ -1,14 +1,6 @@import withEmbedSsr from "@lib/withEmbedSsr";-import PageWrapper from "@components/PageWrapper";--import User, { type PageProps } from "~/users/views/users-public-view";-import { getServerSideProps as _getServerSideProps } from "~/users/views/users-public-view.getServerSideProps";--const UserPage = (props: PageProps) => <User {...props} />;--UserPage.PageWrapper = PageWrapper;--export default UserPage;+import { getServerSideProps as _getServerSideProps } from "@server/lib/[user]/getServerSideProps";+export { default } from "./index";export const getServerSideProps = withEmbedSsr(_getServerSideProps);diff --git a/apps/web/pages/[user]/index.tsx b/apps/web/pages/[user]/index.tsxindex ba62763f770..e01386f25fc 100644--- a/apps/web/pages/[user]/index.tsx+++ b/apps/web/pages/[user]/index.tsx@@ -2,7 +2,7 @@ import PageWrapper from "@components/PageWrapper";import User, { type PageProps } from "~/users/views/users-public-view";-export { getServerSideProps } from "~/users/views/users-public-view.getServerSideProps";+export { getServerSideProps } from "@server/lib/[user]/getServerSideProps";const UserPage = (props: PageProps) => <User {...props} />;diff --git a/apps/web/pages/org/[orgSlug]/[user]/[type]/index.tsx b/apps/web/pages/org/[orgSlug]/[user]/[type]/index.tsxindex 152e5c7aad2..67bf2539d06 100644--- a/apps/web/pages/org/[orgSlug]/[user]/[type]/index.tsx+++ b/apps/web/pages/org/[orgSlug]/[user]/[type]/index.tsx@@ -5,7 +5,7 @@ import PageWrapper from "@components/PageWrapper";import type { PageProps as TeamTypePageProps } from "~/team/type-view";import TeamTypePage from "~/team/type-view";import UserTypePage from "~/users/views/users-type-public-view";-import type { PageProps as UserTypePageProps } from "~/users/views/users-type-public-view.getServerSideProps";+import type { PageProps as UserTypePageProps } from "~/users/views/users-type-public-view";export { getServerSideProps } from "@lib/org/[orgSlug]/[user]/[type]/getServerSideProps";diff --git a/apps/web/pages/org/[orgSlug]/[user]/index.tsx b/apps/web/pages/org/[orgSlug]/[user]/index.tsxindex 001514be6c7..504830e7f62 100644--- a/apps/web/pages/org/[orgSlug]/[user]/index.tsx+++ b/apps/web/pages/org/[orgSlug]/[user]/index.tsx@@ -5,7 +5,7 @@ import PageWrapper from "@components/PageWrapper";import type { PageProps as TeamPageProps } from "~/team/team-view";import TeamPage from "~/team/team-view";import UserPage from "~/users/views/users-public-view";-import { type UserPageProps } from "~/users/views/users-public-view.getServerSideProps";+import type { PageProps as UserPageProps } from "~/users/views/users-public-view";export { getServerSideProps } from "@lib/org/[orgSlug]/[user]/getServerSideProps";diff --git a/apps/web/scripts/vercel-app-router-deploy.sh b/apps/web/scripts/vercel-app-router-deploy.shindex f8d4ceb8631..ebe3402fca7 100755--- a/apps/web/scripts/vercel-app-router-deploy.sh+++ b/apps/web/scripts/vercel-app-router-deploy.sh@@ -39,7 +39,6 @@ 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 workingrm -rf \- app/future/[user]\app/future/booking\app/future/d\app/future/enterprise\diff --git a/apps/web/modules/users/views/users-type-public-view.getServerSideProps.tsx b/apps/web/server/lib/[user]/[type]/getServerSideProps.tssimilarity index 97%rename from apps/web/modules/users/views/users-type-public-view.getServerSideProps.tsxrename to apps/web/server/lib/[user]/[type]/getServerSideProps.tsindex 1e0e6fffa80..e041660d87e 100644--- a/apps/web/modules/users/views/users-type-public-view.getServerSideProps.tsx+++ b/apps/web/server/lib/[user]/[type]/getServerSideProps.ts@@ -15,10 +15,6 @@ import prisma from "@calcom/prisma";import { RedirectType } from "@calcom/prisma/client";import { getTemporaryOrgRedirect } from "@lib/getTemporaryOrgRedirect";-import { type inferSSRProps } from "@lib/types/inferSSRProps";-import { type EmbedProps } from "@lib/withEmbedSsr";--export type PageProps = inferSSRProps<typeof getServerSideProps> & EmbedProps;type Props = {eventData: Pick<diff --git a/apps/web/modules/users/views/users-public-view.getServerSideProps.tsx b/apps/web/server/lib/[user]/getServerSideProps.tssimilarity index 99%rename from apps/web/modules/users/views/users-public-view.getServerSideProps.tsxrename to apps/web/server/lib/[user]/getServerSideProps.tsindex 830834897df..534e3011e4d 100644--- a/apps/web/modules/users/views/users-public-view.getServerSideProps.tsx+++ b/apps/web/server/lib/[user]/getServerSideProps.ts@@ -23,7 +23,7 @@ import type { EmbedProps } from "@lib/withEmbedSsr";import { ssrInit } from "@server/lib/ssr";const log = logger.getSubLogger({ prefix: ["[[pages/[user]]]"] });-export type UserPageProps = {+type UserPageProps = {trpcState: DehydratedState;profile: {name: string;