From ce0c8476977dc14b16832f089515fd5e2c9e89ac Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sat, 14 Dec 2024 13:51:00 -0500 Subject: [PATCH 01/57] update env vars --- .env.example | 1 - apps/web/abTest/middlewareFactory.ts | 1 - apps/web/scripts/vercel-app-router-deploy.sh | 1 - turbo.json | 1 - 4 files changed, 4 deletions(-) diff --git a/.env.example b/.env.example index 124aac0ff8c14d..f5f9c43ab4b4fa 100644 --- a/.env.example +++ b/.env.example @@ -359,7 +359,6 @@ APP_ROUTER_BOOKING_ENABLED=0 APP_ROUTER_BOOKINGS_STATUS_ENABLED=0 APP_ROUTER_GETTING_STARTED_STEP_ENABLED=0 APP_ROUTER_APPS_ENABLED=0 -APP_ROUTER_TEAM_ENABLED=0 APP_ROUTER_TEAMS_ENABLED=0 APP_ROUTER_AUTH_FORGOT_PASSWORD_ENABLED=0 APP_ROUTER_AUTH_LOGIN_ENABLED=0 diff --git a/apps/web/abTest/middlewareFactory.ts b/apps/web/abTest/middlewareFactory.ts index e3555464beee7a..dc8c6aaaeaccae 100644 --- a/apps/web/abTest/middlewareFactory.ts +++ b/apps/web/abTest/middlewareFactory.ts @@ -23,7 +23,6 @@ const ROUTES: [URLPattern, boolean][] = [ ["/getting-started/:step", process.env.APP_ROUTER_GETTING_STARTED_STEP_ENABLED === "1"] as const, ["/bookings/:status", process.env.APP_ROUTER_BOOKINGS_STATUS_ENABLED === "1"] as const, ["/booking/:path*", process.env.APP_ROUTER_BOOKING_ENABLED === "1"] as const, - ["/team", process.env.APP_ROUTER_TEAM_ENABLED === "1"] as const, ["/teams", process.env.APP_ROUTER_TEAMS_ENABLED === "1"] as const, ].map(([pathname, enabled]) => [ new URLPattern({ diff --git a/apps/web/scripts/vercel-app-router-deploy.sh b/apps/web/scripts/vercel-app-router-deploy.sh index 591c0b3c3c4234..ef99b69b22f151 100755 --- a/apps/web/scripts/vercel-app-router-deploy.sh +++ b/apps/web/scripts/vercel-app-router-deploy.sh @@ -23,7 +23,6 @@ checkRoute "$APP_ROUTER_AUTH_OAUTH2_ENABLED" app/future/auth/oauth2 checkRoute "$APP_ROUTER_GETTING_STARTED_STEP_ENABLED" app/future/getting-started checkRoute "$APP_ROUTER_BOOKINGS_STATUS_ENABLED" app/future/bookings checkRoute "$APP_ROUTER_BOOKING_ENABLED" app/future/booking -checkRoute "$APP_ROUTER_TEAM_ENABLED" app/future/team checkRoute "$APP_ROUTER_TEAMS_ENABLED" app/future/teams # These are routes that don't have and environment variable to enable or disable them diff --git a/turbo.json b/turbo.json index 2eb54ef949c6cb..ea5bf9503ff96e 100644 --- a/turbo.json +++ b/turbo.json @@ -249,7 +249,6 @@ "APP_ROUTER_AUTH_ERROR_ENABLED", "APP_ROUTER_AUTH_PLATFORM_ENABLED", "APP_ROUTER_AUTH_OAUTH2_ENABLED", - "APP_ROUTER_TEAM_ENABLED", "APP_ROUTER_TEAMS_ENABLED", "APP_USER_NAME", "BASECAMP3_CLIENT_ID", From 5535bea8c700aa027c2de1c09be3b4471e3ccc2c Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sat, 14 Dec 2024 13:51:12 -0500 Subject: [PATCH 02/57] update middleware --- apps/web/middleware.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts index 1290b8bd176096..e05f357ec55d6b 100644 --- a/apps/web/middleware.ts +++ b/apps/web/middleware.ts @@ -194,6 +194,7 @@ export const config = { "/future/teams/", "/settings/:path*", "/availability/:path*", + "/team/:path*", ], }; From eb984960d5bae9adae21a771712b4ea291908836 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sat, 14 Dec 2024 13:51:20 -0500 Subject: [PATCH 03/57] remove pages router and move pages to /app --- .../{future/team => }/[slug]/[type]/embed/page.tsx | 0 .../app/{future/team => }/[slug]/[type]/page.tsx | 0 .../app/{future/team => }/[slug]/embed/page.tsx | 0 apps/web/app/{future/team => }/[slug]/page.tsx | 0 apps/web/pages/team/[slug].tsx | 10 ---------- apps/web/pages/team/[slug]/[type].tsx | 10 ---------- apps/web/pages/team/[slug]/[type]/embed.tsx | 14 -------------- apps/web/pages/team/[slug]/embed.tsx | 14 -------------- 8 files changed, 48 deletions(-) rename apps/web/app/{future/team => }/[slug]/[type]/embed/page.tsx (100%) rename apps/web/app/{future/team => }/[slug]/[type]/page.tsx (100%) rename apps/web/app/{future/team => }/[slug]/embed/page.tsx (100%) rename apps/web/app/{future/team => }/[slug]/page.tsx (100%) delete mode 100644 apps/web/pages/team/[slug].tsx delete mode 100644 apps/web/pages/team/[slug]/[type].tsx delete mode 100644 apps/web/pages/team/[slug]/[type]/embed.tsx delete mode 100644 apps/web/pages/team/[slug]/embed.tsx diff --git a/apps/web/app/future/team/[slug]/[type]/embed/page.tsx b/apps/web/app/[slug]/[type]/embed/page.tsx similarity index 100% rename from apps/web/app/future/team/[slug]/[type]/embed/page.tsx rename to apps/web/app/[slug]/[type]/embed/page.tsx diff --git a/apps/web/app/future/team/[slug]/[type]/page.tsx b/apps/web/app/[slug]/[type]/page.tsx similarity index 100% rename from apps/web/app/future/team/[slug]/[type]/page.tsx rename to apps/web/app/[slug]/[type]/page.tsx diff --git a/apps/web/app/future/team/[slug]/embed/page.tsx b/apps/web/app/[slug]/embed/page.tsx similarity index 100% rename from apps/web/app/future/team/[slug]/embed/page.tsx rename to apps/web/app/[slug]/embed/page.tsx diff --git a/apps/web/app/future/team/[slug]/page.tsx b/apps/web/app/[slug]/page.tsx similarity index 100% rename from apps/web/app/future/team/[slug]/page.tsx rename to apps/web/app/[slug]/page.tsx diff --git a/apps/web/pages/team/[slug].tsx b/apps/web/pages/team/[slug].tsx deleted file mode 100644 index 34386176f19333..00000000000000 --- a/apps/web/pages/team/[slug].tsx +++ /dev/null @@ -1,10 +0,0 @@ -import PageWrapper from "@components/PageWrapper"; - -import TeamPage, { type PageProps } from "~/team/team-view"; - -const Page = (props: PageProps) => ; - -Page.PageWrapper = PageWrapper; - -export default Page; -export { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; diff --git a/apps/web/pages/team/[slug]/[type].tsx b/apps/web/pages/team/[slug]/[type].tsx deleted file mode 100644 index 1138cc20a17625..00000000000000 --- a/apps/web/pages/team/[slug]/[type].tsx +++ /dev/null @@ -1,10 +0,0 @@ -import PageWrapper from "@components/PageWrapper"; - -import TypePage, { type PageProps } from "~/team/type-view"; - -const Page = (props: PageProps) => ; - -Page.PageWrapper = PageWrapper; - -export default Page; -export { getServerSideProps } from "@lib/team/[slug]/[type]/getServerSideProps"; diff --git a/apps/web/pages/team/[slug]/[type]/embed.tsx b/apps/web/pages/team/[slug]/[type]/embed.tsx deleted file mode 100644 index 3f41c896ab7a8c..00000000000000 --- a/apps/web/pages/team/[slug]/[type]/embed.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { getServerSideProps as _getServerSideProps } from "@lib/team/[slug]/[type]/getServerSideProps"; -import withEmbedSsr from "@lib/withEmbedSsr"; - -import PageWrapper from "@components/PageWrapper"; - -import TypePage, { type PageProps } from "~/team/type-view"; - -export const getServerSideProps = withEmbedSsr(_getServerSideProps); - -const Page = (props: PageProps) => ; - -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/team/[slug]/embed.tsx b/apps/web/pages/team/[slug]/embed.tsx deleted file mode 100644 index 1ef45e647ae84f..00000000000000 --- a/apps/web/pages/team/[slug]/embed.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { getServerSideProps as _getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; -import withEmbedSsr from "@lib/withEmbedSsr"; - -import PageWrapper from "@components/PageWrapper"; - -import TeamPage, { type PageProps } from "~/team/team-view"; - -export const getServerSideProps = withEmbedSsr(_getServerSideProps); - -const Page = (props: PageProps) => ; - -Page.PageWrapper = PageWrapper; - -export default Page; From c4fb7bc0863c1e783ff8930634580a476eda2f91 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Tue, 17 Dec 2024 23:31:49 -0500 Subject: [PATCH 04/57] move to /team --- apps/web/app/{ => team}/[slug]/[type]/embed/page.tsx | 0 apps/web/app/{ => team}/[slug]/[type]/page.tsx | 0 apps/web/app/{ => team}/[slug]/embed/page.tsx | 0 apps/web/app/{ => team}/[slug]/page.tsx | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename apps/web/app/{ => team}/[slug]/[type]/embed/page.tsx (100%) rename apps/web/app/{ => team}/[slug]/[type]/page.tsx (100%) rename apps/web/app/{ => team}/[slug]/embed/page.tsx (100%) rename apps/web/app/{ => team}/[slug]/page.tsx (100%) diff --git a/apps/web/app/[slug]/[type]/embed/page.tsx b/apps/web/app/team/[slug]/[type]/embed/page.tsx similarity index 100% rename from apps/web/app/[slug]/[type]/embed/page.tsx rename to apps/web/app/team/[slug]/[type]/embed/page.tsx diff --git a/apps/web/app/[slug]/[type]/page.tsx b/apps/web/app/team/[slug]/[type]/page.tsx similarity index 100% rename from apps/web/app/[slug]/[type]/page.tsx rename to apps/web/app/team/[slug]/[type]/page.tsx diff --git a/apps/web/app/[slug]/embed/page.tsx b/apps/web/app/team/[slug]/embed/page.tsx similarity index 100% rename from apps/web/app/[slug]/embed/page.tsx rename to apps/web/app/team/[slug]/embed/page.tsx diff --git a/apps/web/app/[slug]/page.tsx b/apps/web/app/team/[slug]/page.tsx similarity index 100% rename from apps/web/app/[slug]/page.tsx rename to apps/web/app/team/[slug]/page.tsx From 704a6675638ec8c4082ff1e5bddd56d9dfb905b9 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Tue, 17 Dec 2024 23:33:00 -0500 Subject: [PATCH 05/57] update imports --- apps/web/pages/org/[orgSlug]/index.ts | 3 ++- apps/web/pages/org/[orgSlug]/team/[slug]/index.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/pages/org/[orgSlug]/index.ts b/apps/web/pages/org/[orgSlug]/index.ts index a29283de79e8d2..696a1aeadaf970 100644 --- a/apps/web/pages/org/[orgSlug]/index.ts +++ b/apps/web/pages/org/[orgSlug]/index.ts @@ -1 +1,2 @@ -export { getServerSideProps, default } from "@pages/team/[slug]"; +export { default } from "~/team/team-view"; +export { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; diff --git a/apps/web/pages/org/[orgSlug]/team/[slug]/index.ts b/apps/web/pages/org/[orgSlug]/team/[slug]/index.ts index a29283de79e8d2..696a1aeadaf970 100644 --- a/apps/web/pages/org/[orgSlug]/team/[slug]/index.ts +++ b/apps/web/pages/org/[orgSlug]/team/[slug]/index.ts @@ -1 +1,2 @@ -export { getServerSideProps, default } from "@pages/team/[slug]"; +export { default } from "~/team/team-view"; +export { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; From 20813345fbe1982343e647f0dfa181aff98e7f07 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Tue, 17 Dec 2024 23:34:41 -0500 Subject: [PATCH 06/57] fix --- apps/web/pages/org/[orgSlug]/index.ts | 2 -- apps/web/pages/org/[orgSlug]/index.tsx | 10 ++++++++++ apps/web/pages/org/[orgSlug]/team/[slug]/index.ts | 2 -- apps/web/pages/org/[orgSlug]/team/[slug]/index.tsx | 10 ++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) delete mode 100644 apps/web/pages/org/[orgSlug]/index.ts create mode 100644 apps/web/pages/org/[orgSlug]/index.tsx delete mode 100644 apps/web/pages/org/[orgSlug]/team/[slug]/index.ts create mode 100644 apps/web/pages/org/[orgSlug]/team/[slug]/index.tsx diff --git a/apps/web/pages/org/[orgSlug]/index.ts b/apps/web/pages/org/[orgSlug]/index.ts deleted file mode 100644 index 696a1aeadaf970..00000000000000 --- a/apps/web/pages/org/[orgSlug]/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from "~/team/team-view"; -export { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; diff --git a/apps/web/pages/org/[orgSlug]/index.tsx b/apps/web/pages/org/[orgSlug]/index.tsx new file mode 100644 index 00000000000000..34386176f19333 --- /dev/null +++ b/apps/web/pages/org/[orgSlug]/index.tsx @@ -0,0 +1,10 @@ +import PageWrapper from "@components/PageWrapper"; + +import TeamPage, { type PageProps } from "~/team/team-view"; + +const Page = (props: PageProps) => ; + +Page.PageWrapper = PageWrapper; + +export default Page; +export { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; diff --git a/apps/web/pages/org/[orgSlug]/team/[slug]/index.ts b/apps/web/pages/org/[orgSlug]/team/[slug]/index.ts deleted file mode 100644 index 696a1aeadaf970..00000000000000 --- a/apps/web/pages/org/[orgSlug]/team/[slug]/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from "~/team/team-view"; -export { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; diff --git a/apps/web/pages/org/[orgSlug]/team/[slug]/index.tsx b/apps/web/pages/org/[orgSlug]/team/[slug]/index.tsx new file mode 100644 index 00000000000000..34386176f19333 --- /dev/null +++ b/apps/web/pages/org/[orgSlug]/team/[slug]/index.tsx @@ -0,0 +1,10 @@ +import PageWrapper from "@components/PageWrapper"; + +import TeamPage, { type PageProps } from "~/team/team-view"; + +const Page = (props: PageProps) => ; + +Page.PageWrapper = PageWrapper; + +export default Page; +export { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; From d95d2d432620def1c82e4b2f45341ff89ce88e87 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Tue, 17 Dec 2024 23:47:12 -0500 Subject: [PATCH 07/57] remove pages router and move org pages to /app --- .../[orgSlug]/[user]/[type]/embed/page.tsx | 0 .../org/[orgSlug]/[user]/[type]/page.tsx | 0 .../org/[orgSlug]/[user]/embed/page.tsx | 0 .../org/[orgSlug]/[user]/page.tsx | 0 .../{future => }/org/[orgSlug]/embed/page.tsx | 0 .../team/[slug]/[type]/page.tsx | 0 .../app/{future => }/org/[orgSlug]/page.tsx | 0 .../org/[orgSlug]/team/[slug]/[type]/page.tsx | 0 .../org/[orgSlug]/team/[slug]/page.tsx | 0 .../org/[orgSlug]/[user]/[type]/embed.tsx | 7 ------- .../org/[orgSlug]/[user]/[type]/index.tsx | 17 --------------- apps/web/pages/org/[orgSlug]/[user]/embed.tsx | 9 -------- apps/web/pages/org/[orgSlug]/[user]/index.tsx | 21 ------------------- apps/web/pages/org/[orgSlug]/embed.tsx | 7 ------- apps/web/pages/org/[orgSlug]/index.tsx | 10 --------- .../instant-meeting/team/[slug]/[type].tsx | 10 --------- .../pages/org/[orgSlug]/team/[slug]/[type].ts | 1 - .../pages/org/[orgSlug]/team/[slug]/index.tsx | 10 --------- 18 files changed, 92 deletions(-) rename apps/web/app/{future => }/org/[orgSlug]/[user]/[type]/embed/page.tsx (100%) rename apps/web/app/{future => }/org/[orgSlug]/[user]/[type]/page.tsx (100%) rename apps/web/app/{future => }/org/[orgSlug]/[user]/embed/page.tsx (100%) rename apps/web/app/{future => }/org/[orgSlug]/[user]/page.tsx (100%) rename apps/web/app/{future => }/org/[orgSlug]/embed/page.tsx (100%) rename apps/web/app/{future => }/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx (100%) rename apps/web/app/{future => }/org/[orgSlug]/page.tsx (100%) rename apps/web/app/{future => }/org/[orgSlug]/team/[slug]/[type]/page.tsx (100%) rename apps/web/app/{future => }/org/[orgSlug]/team/[slug]/page.tsx (100%) delete mode 100644 apps/web/pages/org/[orgSlug]/[user]/[type]/embed.tsx delete mode 100644 apps/web/pages/org/[orgSlug]/[user]/[type]/index.tsx delete mode 100644 apps/web/pages/org/[orgSlug]/[user]/embed.tsx delete mode 100644 apps/web/pages/org/[orgSlug]/[user]/index.tsx delete mode 100644 apps/web/pages/org/[orgSlug]/embed.tsx delete mode 100644 apps/web/pages/org/[orgSlug]/index.tsx delete mode 100644 apps/web/pages/org/[orgSlug]/instant-meeting/team/[slug]/[type].tsx delete mode 100644 apps/web/pages/org/[orgSlug]/team/[slug]/[type].ts delete mode 100644 apps/web/pages/org/[orgSlug]/team/[slug]/index.tsx diff --git a/apps/web/app/future/org/[orgSlug]/[user]/[type]/embed/page.tsx b/apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx similarity index 100% rename from apps/web/app/future/org/[orgSlug]/[user]/[type]/embed/page.tsx rename to apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx diff --git a/apps/web/app/future/org/[orgSlug]/[user]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx similarity index 100% rename from apps/web/app/future/org/[orgSlug]/[user]/[type]/page.tsx rename to apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx diff --git a/apps/web/app/future/org/[orgSlug]/[user]/embed/page.tsx b/apps/web/app/org/[orgSlug]/[user]/embed/page.tsx similarity index 100% rename from apps/web/app/future/org/[orgSlug]/[user]/embed/page.tsx rename to apps/web/app/org/[orgSlug]/[user]/embed/page.tsx diff --git a/apps/web/app/future/org/[orgSlug]/[user]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/page.tsx similarity index 100% rename from apps/web/app/future/org/[orgSlug]/[user]/page.tsx rename to apps/web/app/org/[orgSlug]/[user]/page.tsx diff --git a/apps/web/app/future/org/[orgSlug]/embed/page.tsx b/apps/web/app/org/[orgSlug]/embed/page.tsx similarity index 100% rename from apps/web/app/future/org/[orgSlug]/embed/page.tsx rename to apps/web/app/org/[orgSlug]/embed/page.tsx diff --git a/apps/web/app/future/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx similarity index 100% rename from apps/web/app/future/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx rename to apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx diff --git a/apps/web/app/future/org/[orgSlug]/page.tsx b/apps/web/app/org/[orgSlug]/page.tsx similarity index 100% rename from apps/web/app/future/org/[orgSlug]/page.tsx rename to apps/web/app/org/[orgSlug]/page.tsx diff --git a/apps/web/app/future/org/[orgSlug]/team/[slug]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/team/[slug]/[type]/page.tsx similarity index 100% rename from apps/web/app/future/org/[orgSlug]/team/[slug]/[type]/page.tsx rename to apps/web/app/org/[orgSlug]/team/[slug]/[type]/page.tsx diff --git a/apps/web/app/future/org/[orgSlug]/team/[slug]/page.tsx b/apps/web/app/org/[orgSlug]/team/[slug]/page.tsx similarity index 100% rename from apps/web/app/future/org/[orgSlug]/team/[slug]/page.tsx rename to apps/web/app/org/[orgSlug]/team/[slug]/page.tsx diff --git a/apps/web/pages/org/[orgSlug]/[user]/[type]/embed.tsx b/apps/web/pages/org/[orgSlug]/[user]/[type]/embed.tsx deleted file mode 100644 index a3752b2a3b8888..00000000000000 --- a/apps/web/pages/org/[orgSlug]/[user]/[type]/embed.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import withEmbedSsr from "@lib/withEmbedSsr"; - -import { getServerSideProps as _getServerSideProps } from "."; - -export { default, type PageProps } from "."; - -export const getServerSideProps = withEmbedSsr(_getServerSideProps); diff --git a/apps/web/pages/org/[orgSlug]/[user]/[type]/index.tsx b/apps/web/pages/org/[orgSlug]/[user]/[type]/index.tsx deleted file mode 100644 index 1b876a36c1c7b3..00000000000000 --- a/apps/web/pages/org/[orgSlug]/[user]/[type]/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -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"; - -export { getServerSideProps } from "@lib/org/[orgSlug]/[user]/[type]/getServerSideProps"; - -export type PageProps = UserTypePageProps | TeamTypePageProps; - -export default function Page(props: PageProps) { - if ((props as TeamTypePageProps)?.teamId) return ; - return ; -} - -Page.PageWrapper = PageWrapper; diff --git a/apps/web/pages/org/[orgSlug]/[user]/embed.tsx b/apps/web/pages/org/[orgSlug]/[user]/embed.tsx deleted file mode 100644 index 6317514b2d6fe3..00000000000000 --- a/apps/web/pages/org/[orgSlug]/[user]/embed.tsx +++ /dev/null @@ -1,9 +0,0 @@ -"use client"; - -import withEmbedSsr from "@lib/withEmbedSsr"; - -import { getServerSideProps as _getServerSideProps } from "../[user]"; - -export { default } from "../[user]"; - -export const getServerSideProps = withEmbedSsr(_getServerSideProps); diff --git a/apps/web/pages/org/[orgSlug]/[user]/index.tsx b/apps/web/pages/org/[orgSlug]/[user]/index.tsx deleted file mode 100644 index 504830e7f62136..00000000000000 --- a/apps/web/pages/org/[orgSlug]/[user]/index.tsx +++ /dev/null @@ -1,21 +0,0 @@ -"use client"; - -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 { PageProps as UserPageProps } from "~/users/views/users-public-view"; - -export { getServerSideProps } from "@lib/org/[orgSlug]/[user]/getServerSideProps"; - -export type PageProps = UserPageProps | TeamPageProps; - -function Page(props: PageProps) { - if ((props as TeamPageProps)?.team) return ; - return ; -} - -Page.PageWrapper = PageWrapper; - -export default Page; diff --git a/apps/web/pages/org/[orgSlug]/embed.tsx b/apps/web/pages/org/[orgSlug]/embed.tsx deleted file mode 100644 index 97a9a1c4e93b16..00000000000000 --- a/apps/web/pages/org/[orgSlug]/embed.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import withEmbedSsr from "@lib/withEmbedSsr"; - -import { getServerSideProps as _getServerSideProps } from "./index"; - -export { default } from "./index"; - -export const getServerSideProps = withEmbedSsr(_getServerSideProps); diff --git a/apps/web/pages/org/[orgSlug]/index.tsx b/apps/web/pages/org/[orgSlug]/index.tsx deleted file mode 100644 index 34386176f19333..00000000000000 --- a/apps/web/pages/org/[orgSlug]/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import PageWrapper from "@components/PageWrapper"; - -import TeamPage, { type PageProps } from "~/team/team-view"; - -const Page = (props: PageProps) => ; - -Page.PageWrapper = PageWrapper; - -export default Page; -export { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; diff --git a/apps/web/pages/org/[orgSlug]/instant-meeting/team/[slug]/[type].tsx b/apps/web/pages/org/[orgSlug]/instant-meeting/team/[slug]/[type].tsx deleted file mode 100644 index 2877917dba98d2..00000000000000 --- a/apps/web/pages/org/[orgSlug]/instant-meeting/team/[slug]/[type].tsx +++ /dev/null @@ -1,10 +0,0 @@ -import PageWrapper from "@components/PageWrapper"; - -import type { PageProps } from "~/org/[orgSlug]/instant-meeting/team/[slug]/[type]/instant-meeting-view"; -import Type from "~/org/[orgSlug]/instant-meeting/team/[slug]/[type]/instant-meeting-view"; - -const Page = (props: PageProps) => ; -Page.PageWrapper = PageWrapper; - -export { getServerSideProps } from "@lib/org/[orgSlug]/instant-meeting/team/[slug]/[type]/getServerSideProps"; -export default Page; diff --git a/apps/web/pages/org/[orgSlug]/team/[slug]/[type].ts b/apps/web/pages/org/[orgSlug]/team/[slug]/[type].ts deleted file mode 100644 index 85e0b39d1aed09..00000000000000 --- a/apps/web/pages/org/[orgSlug]/team/[slug]/[type].ts +++ /dev/null @@ -1 +0,0 @@ -export { getServerSideProps, default } from "@pages/team/[slug]/[type]"; diff --git a/apps/web/pages/org/[orgSlug]/team/[slug]/index.tsx b/apps/web/pages/org/[orgSlug]/team/[slug]/index.tsx deleted file mode 100644 index 34386176f19333..00000000000000 --- a/apps/web/pages/org/[orgSlug]/team/[slug]/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import PageWrapper from "@components/PageWrapper"; - -import TeamPage, { type PageProps } from "~/team/team-view"; - -const Page = (props: PageProps) => ; - -Page.PageWrapper = PageWrapper; - -export default Page; -export { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; From d3c53c196a961c6888d0f76aa95854e9eec004b9 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Wed, 18 Dec 2024 00:11:08 -0500 Subject: [PATCH 08/57] wip --- apps/web/app/org/[orgSlug]/[user]/page.tsx | 43 ++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/apps/web/app/org/[orgSlug]/[user]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/page.tsx index a783b6d61cfc86..684bd2868a1f8d 100644 --- a/apps/web/app/org/[orgSlug]/[user]/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/page.tsx @@ -1,7 +1,44 @@ -import Page, { getServerSideProps, type PageProps } from "@pages/org/[orgSlug]/[user]"; import { withAppDirSsr } from "app/WithAppDirSsr"; +import { PageProps } from "app/_types"; +import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; +import { cookies, headers } from "next/headers"; -const getData = withAppDirSsr(getServerSideProps); +import { buildLegacyCtx } from "@lib/buildLegacyCtx"; +import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/getServerSideProps"; -export default WithLayout({ getLayout: null, getData, Page }); +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 { PageProps as UserPageProps } from "~/users/views/users-public-view"; + +type OrgPageProps = UserPageProps | TeamPageProps; +const getData = withAppDirSsr(getServerSideProps); + +export const generateMetadata = async ({ params, searchParams }: PageProps) => { + const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); + const props = await getData(legacyCtx); + + if ((props as TeamPageProps)?.team) { + return await _generateMetadata( + (t) => props.team.name || t("nameless_team"), + (t) => props.team.name || t("nameless_team") + ); + } + return await _generateMetadata( + (t) => (props as UserPageProps).profile.name, + (t) => (props as UserPageProps).markdownStrippedBio + ); +}; + +const Page = async ({ params, searchParams }: PageProps) => { + const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); + + const props = await getData(legacyCtx); + + if ((props as TeamPageProps)?.team) { + return ; + } + return ; +}; +export default WithLayout({ getLayout: null, getData, ServerPage: Page }); From d308a828e31dbbda8da6bf16d2a931da311a4bc1 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Wed, 18 Dec 2024 00:16:53 -0500 Subject: [PATCH 09/57] fix orgSlug/user pages --- .../web/app/org/[orgSlug]/[user]/embed/page.tsx | 10 ++++++---- apps/web/app/org/[orgSlug]/[user]/page.tsx | 17 +++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/apps/web/app/org/[orgSlug]/[user]/embed/page.tsx b/apps/web/app/org/[orgSlug]/[user]/embed/page.tsx index adf85d2655c65e..d5f0d00bd12335 100644 --- a/apps/web/app/org/[orgSlug]/[user]/embed/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/embed/page.tsx @@ -1,11 +1,13 @@ -import { getServerSideProps, type PageProps } from "@pages/org/[orgSlug]/[user]"; -import Page from "@pages/org/[orgSlug]/[user]/embed"; import { withAppDirSsr } from "app/WithAppDirSsr"; import withEmbedSsrAppDir from "app/WithEmbedSSR"; import { WithLayout } from "app/layoutHOC"; -const getData = withAppDirSsr(getServerSideProps); +import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/getServerSideProps"; + +import { Page, type OrgPageProps } from "../page"; + +const getData = withAppDirSsr(getServerSideProps); const getEmbedData = withEmbedSsrAppDir(getData); -export default WithLayout({ getLayout: null, getData: getEmbedData, isBookingPage: true, Page }); +export default WithLayout({ getLayout: null, getData: getEmbedData, isBookingPage: true, ServerPage: Page }); diff --git a/apps/web/app/org/[orgSlug]/[user]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/page.tsx index 684bd2868a1f8d..85a52fb5b3de75 100644 --- a/apps/web/app/org/[orgSlug]/[user]/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/page.tsx @@ -1,5 +1,5 @@ import { withAppDirSsr } from "app/WithAppDirSsr"; -import { PageProps } from "app/_types"; +import type { PageProps } from "app/_types"; import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { cookies, headers } from "next/headers"; @@ -12,7 +12,7 @@ import TeamPage from "~/team/team-view"; import UserPage from "~/users/views/users-public-view"; import type { PageProps as UserPageProps } from "~/users/views/users-public-view"; -type OrgPageProps = UserPageProps | TeamPageProps; +export type OrgPageProps = UserPageProps | TeamPageProps; const getData = withAppDirSsr(getServerSideProps); export const generateMetadata = async ({ params, searchParams }: PageProps) => { @@ -21,8 +21,8 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { if ((props as TeamPageProps)?.team) { return await _generateMetadata( - (t) => props.team.name || t("nameless_team"), - (t) => props.team.name || t("nameless_team") + (t) => (props as TeamPageProps).team.name || t("nameless_team"), + (t) => (props as TeamPageProps).team.name || t("nameless_team") ); } return await _generateMetadata( @@ -31,14 +31,11 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { ); }; -const Page = async ({ params, searchParams }: PageProps) => { - const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); - - const props = await getData(legacyCtx); - +export const Page = async (props: OrgPageProps) => { if ((props as TeamPageProps)?.team) { return ; } return ; }; -export default WithLayout({ getLayout: null, getData, ServerPage: Page }); + +export default WithLayout({ getLayout: null, getData, ServerPage: Page, isBookingPage: true }); From 756fc52fcc1b530d3ac7c1629b898d744ecc579d Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Wed, 18 Dec 2024 00:23:02 -0500 Subject: [PATCH 10/57] fix orgSlug/user/type pages --- .../[orgSlug]/[user]/[type]/embed/page.tsx | 10 ++-- .../app/org/[orgSlug]/[user]/[type]/page.tsx | 50 +++++++++++++++++-- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx b/apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx index 6762375103a456..20e0b9a8492c95 100644 --- a/apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx @@ -1,12 +1,14 @@ -import { type PageProps } from "@pages/org/[orgSlug]/[user]/[type]"; -import Page from "@pages/org/[orgSlug]/[user]/[type]/embed"; import { withAppDirSsr } from "app/WithAppDirSsr"; import withEmbedSsrAppDir from "app/WithEmbedSSR"; import { WithLayout } from "app/layoutHOC"; import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/[type]/getServerSideProps"; -const getData = withAppDirSsr(getServerSideProps); +import { Page, type OrgTypePageProps } from "../page"; + +export { generateMetadata } from "../page"; + +const getData = withAppDirSsr(getServerSideProps); const getEmbedData = withEmbedSsrAppDir(getData); -export default WithLayout({ getLayout: null, getData: getEmbedData, isBookingPage: true, Page }); +export default WithLayout({ getLayout: null, getData: getEmbedData, isBookingPage: true, ServerPage: Page }); diff --git a/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx index b96a381cef1dde..d150e05340269e 100644 --- a/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx @@ -1,9 +1,53 @@ -import Page, { type PageProps } from "@pages/org/[orgSlug]/[user]/[type]"; import { withAppDirSsr } from "app/WithAppDirSsr"; +import type { PageProps } from "app/_types"; +import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; +import { cookies, headers } from "next/headers"; +import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; +import { EventRepository } from "@calcom/lib/server/repository/event"; + +import { buildLegacyCtx } from "@lib/buildLegacyCtx"; import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/[type]/getServerSideProps"; -const getData = withAppDirSsr(getServerSideProps); +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"; + +export type OrgTypePageProps = UserTypePageProps | TeamTypePageProps; +const getData = withAppDirSsr(getServerSideProps); + +export const generateMetadata = async ({ params, searchParams }: PageProps) => { + const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); + const props = await getData(legacyCtx); + + const { booking, user: username, slug: eventSlug } = props; + const rescheduleUid = booking?.uid; + const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req, legacyCtx.params?.orgSlug); + + const event = await EventRepository.getPublicEvent({ + username, + eventSlug, + isTeamEvent: false, + org: isValidOrgDomain ? currentOrgDomain : null, + fromRedirectOfNonOrgLink: legacyCtx.query.orgRedirection === "true", + }); + + const profileName = event?.profile?.name ?? ""; + const title = event?.title ?? ""; + + return await _generateMetadata( + (t) => `${rescheduleUid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, + (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}` + ); +}; + +export const Page = async (props: OrgTypePageProps) => { + if ((props as TeamTypePageProps)?.teamId) { + return ; + } + return ; +}; -export default WithLayout({ getLayout: null, getData, Page }); +export default WithLayout({ getLayout: null, getData, ServerPage: Page, isBookingPage: true }); From dd7198d7d7692eb7ac2bbcb53dde4f666a53452b Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Wed, 18 Dec 2024 00:28:44 -0500 Subject: [PATCH 11/57] remove generateMetadata from embed pages --- .../[orgSlug]/[user]/[type]/embed/page.tsx | 2 -- apps/web/app/org/[orgSlug]/embed/page.tsx | 13 -------- .../web/app/team/[slug]/[type]/embed/page.tsx | 30 ------------------- apps/web/app/team/[slug]/embed/page.tsx | 13 -------- 4 files changed, 58 deletions(-) diff --git a/apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx b/apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx index 20e0b9a8492c95..77a0a84f35b7cd 100644 --- a/apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/[type]/embed/page.tsx @@ -6,8 +6,6 @@ import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/[type]/getServerSi import { Page, type OrgTypePageProps } from "../page"; -export { generateMetadata } from "../page"; - const getData = withAppDirSsr(getServerSideProps); const getEmbedData = withEmbedSsrAppDir(getData); diff --git a/apps/web/app/org/[orgSlug]/embed/page.tsx b/apps/web/app/org/[orgSlug]/embed/page.tsx index cc874931185a9c..75baee4c556831 100644 --- a/apps/web/app/org/[orgSlug]/embed/page.tsx +++ b/apps/web/app/org/[orgSlug]/embed/page.tsx @@ -1,11 +1,7 @@ import { withAppDirSsr } from "app/WithAppDirSsr"; import withEmbedSsrAppDir from "app/WithEmbedSSR"; -import type { PageProps as _PageProps } from "app/_types"; -import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; -import { cookies, headers } from "next/headers"; -import { buildLegacyCtx } from "@lib/buildLegacyCtx"; import { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; import type { PageProps } from "~/team/team-view"; @@ -13,15 +9,6 @@ import TeamPage from "~/team/team-view"; const getData = withAppDirSsr(getServerSideProps); -export const generateMetadata = async ({ params, searchParams }: _PageProps) => { - const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams)); - - return await _generateMetadata( - (t) => props.team.name || t("nameless_team"), - (t) => props.team.name || t("nameless_team") - ); -}; - const getEmbedData = withEmbedSsrAppDir(getData); export default WithLayout({ diff --git a/apps/web/app/team/[slug]/[type]/embed/page.tsx b/apps/web/app/team/[slug]/[type]/embed/page.tsx index 378a528ff517dc..22f86b455988b6 100644 --- a/apps/web/app/team/[slug]/[type]/embed/page.tsx +++ b/apps/web/app/team/[slug]/[type]/embed/page.tsx @@ -1,42 +1,12 @@ import { withAppDirSsr } from "app/WithAppDirSsr"; import withEmbedSsrAppDir from "app/WithEmbedSSR"; -import type { PageProps as _PageProps } from "app/_types"; -import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; -import { cookies, headers } from "next/headers"; -import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; -import { EventRepository } from "@calcom/lib/server/repository/event"; - -import { buildLegacyCtx } from "@lib/buildLegacyCtx"; import { getServerSideProps } from "@lib/team/[slug]/[type]/getServerSideProps"; import type { PageProps } from "~/team/type-view"; import LegacyPage from "~/team/type-view"; -export const generateMetadata = async ({ params, searchParams }: _PageProps) => { - const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); - const props = await getData(legacyCtx); - const { user: username, slug: eventSlug, booking } = props; - const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req, legacyCtx.params?.orgSlug); - - const event = await EventRepository.getPublicEvent({ - username, - eventSlug, - isTeamEvent: true, - org: isValidOrgDomain ? currentOrgDomain : null, - fromRedirectOfNonOrgLink: legacyCtx.query.orgRedirection === "true", - }); - - const profileName = event?.profile?.name ?? ""; - const title = event?.title ?? ""; - - return await _generateMetadata( - (t) => `${booking?.uid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, - (t) => `${booking?.uid ? t("reschedule") : ""} ${title}` - ); -}; - const getData = withAppDirSsr(getServerSideProps); const getEmbedData = withEmbedSsrAppDir(getData); diff --git a/apps/web/app/team/[slug]/embed/page.tsx b/apps/web/app/team/[slug]/embed/page.tsx index 889732c6ca3fe4..a3c88681f4bdc8 100644 --- a/apps/web/app/team/[slug]/embed/page.tsx +++ b/apps/web/app/team/[slug]/embed/page.tsx @@ -1,25 +1,12 @@ import { withAppDirSsr } from "app/WithAppDirSsr"; import withEmbedSsrAppDir from "app/WithEmbedSSR"; -import type { PageProps as _PageProps } from "app/_types"; -import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; -import { cookies, headers } from "next/headers"; -import { buildLegacyCtx } from "@lib/buildLegacyCtx"; import { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; import type { PageProps } from "~/team/team-view"; import LegacyPage from "~/team/team-view"; -export const generateMetadata = async ({ params, searchParams }: _PageProps) => { - const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams)); - - return await _generateMetadata( - (t) => props.team.name || t("nameless_team"), - (t) => props.team.name || t("nameless_team") - ); -}; - const getData = withAppDirSsr(getServerSideProps); const getEmbedData = withEmbedSsrAppDir(getData); From 284b99ca3fd854c4c03937373518d5b78f0fd684 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Wed, 18 Dec 2024 12:21:12 -0500 Subject: [PATCH 12/57] fix --- apps/web/lib/org/[orgSlug]/[user]/getServerSideProps.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/lib/org/[orgSlug]/[user]/getServerSideProps.tsx b/apps/web/lib/org/[orgSlug]/[user]/getServerSideProps.tsx index 4fce1e1edd6774..6b5c35d4a47600 100644 --- a/apps/web/lib/org/[orgSlug]/[user]/getServerSideProps.tsx +++ b/apps/web/lib/org/[orgSlug]/[user]/getServerSideProps.tsx @@ -1,4 +1,3 @@ -import { getServerSideProps as GSSUserPage } from "@pages/[user]"; import type { GetServerSidePropsContext } from "next"; import { getSlugOrRequestedSlug } from "@calcom/features/ee/organizations/lib/orgDomains"; @@ -6,6 +5,8 @@ import prisma from "@calcom/prisma"; import { getServerSideProps as GSSTeamPage } from "@lib/team/[slug]/getServerSideProps"; +import { getServerSideProps as GSSUserPage } from "@server/lib/[user]/getServerSideProps"; + export const getServerSideProps = async (ctx: GetServerSidePropsContext) => { const team = await prisma.team.findFirst({ where: { From c67b23fa19ed4b8471ba7955d827df34d58b0126 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Wed, 18 Dec 2024 12:22:11 -0500 Subject: [PATCH 13/57] remove pages router for /user pages --- .../app/{future => }/[user]/[type]/embed/page.tsx | 0 apps/web/app/{future => }/[user]/[type]/page.tsx | 0 apps/web/app/{future => }/[user]/embed/page.tsx | 0 apps/web/app/{future => }/[user]/page.tsx | 0 apps/web/pages/[user]/[type]/embed.tsx | 7 ------- apps/web/pages/[user]/[type]/index.tsx | 12 ------------ apps/web/pages/[user]/embed.tsx | 6 ------ apps/web/pages/[user]/index.tsx | 11 ----------- 8 files changed, 36 deletions(-) rename apps/web/app/{future => }/[user]/[type]/embed/page.tsx (100%) rename apps/web/app/{future => }/[user]/[type]/page.tsx (100%) rename apps/web/app/{future => }/[user]/embed/page.tsx (100%) rename apps/web/app/{future => }/[user]/page.tsx (100%) delete mode 100644 apps/web/pages/[user]/[type]/embed.tsx delete mode 100644 apps/web/pages/[user]/[type]/index.tsx delete mode 100644 apps/web/pages/[user]/embed.tsx delete mode 100644 apps/web/pages/[user]/index.tsx diff --git a/apps/web/app/future/[user]/[type]/embed/page.tsx b/apps/web/app/[user]/[type]/embed/page.tsx similarity index 100% rename from apps/web/app/future/[user]/[type]/embed/page.tsx rename to apps/web/app/[user]/[type]/embed/page.tsx diff --git a/apps/web/app/future/[user]/[type]/page.tsx b/apps/web/app/[user]/[type]/page.tsx similarity index 100% rename from apps/web/app/future/[user]/[type]/page.tsx rename to apps/web/app/[user]/[type]/page.tsx diff --git a/apps/web/app/future/[user]/embed/page.tsx b/apps/web/app/[user]/embed/page.tsx similarity index 100% rename from apps/web/app/future/[user]/embed/page.tsx rename to apps/web/app/[user]/embed/page.tsx diff --git a/apps/web/app/future/[user]/page.tsx b/apps/web/app/[user]/page.tsx similarity index 100% rename from apps/web/app/future/[user]/page.tsx rename to apps/web/app/[user]/page.tsx diff --git a/apps/web/pages/[user]/[type]/embed.tsx b/apps/web/pages/[user]/[type]/embed.tsx deleted file mode 100644 index 5fa5747255bbe2..00000000000000 --- a/apps/web/pages/[user]/[type]/embed.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import withEmbedSsr from "@lib/withEmbedSsr"; - -import { getServerSideProps as _getServerSideProps } from "@server/lib/[user]/[type]/getServerSideProps"; - -export const getServerSideProps = withEmbedSsr(_getServerSideProps); - -export { default } from "./index"; diff --git a/apps/web/pages/[user]/[type]/index.tsx b/apps/web/pages/[user]/[type]/index.tsx deleted file mode 100644 index 4e98c0bc99198e..00000000000000 --- a/apps/web/pages/[user]/[type]/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import PageWrapper from "@components/PageWrapper"; - -import type { PageProps } from "~/users/views/users-type-public-view"; -import TypePage from "~/users/views/users-type-public-view"; - -export { getServerSideProps } from "@server/lib/[user]/[type]/getServerSideProps"; - -const Type = (props: PageProps) => ; - -Type.PageWrapper = PageWrapper; - -export default Type; diff --git a/apps/web/pages/[user]/embed.tsx b/apps/web/pages/[user]/embed.tsx deleted file mode 100644 index 066b82b7fb6d24..00000000000000 --- a/apps/web/pages/[user]/embed.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import withEmbedSsr from "@lib/withEmbedSsr"; - -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.tsx deleted file mode 100644 index e01386f25fcc64..00000000000000 --- a/apps/web/pages/[user]/index.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import PageWrapper from "@components/PageWrapper"; - -import User, { type PageProps } from "~/users/views/users-public-view"; - -export { getServerSideProps } from "@server/lib/[user]/getServerSideProps"; - -const UserPage = (props: PageProps) => ; - -UserPage.PageWrapper = PageWrapper; - -export default UserPage; From ddb0f9b04aa03cf892c7eb9d37ed718d56842231 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Wed, 18 Dec 2024 12:22:38 -0500 Subject: [PATCH 14/57] generateMetadata is not needed in embed pages --- apps/web/app/[user]/[type]/embed/page.tsx | 2 -- apps/web/app/[user]/embed/page.tsx | 2 -- 2 files changed, 4 deletions(-) diff --git a/apps/web/app/[user]/[type]/embed/page.tsx b/apps/web/app/[user]/[type]/embed/page.tsx index 3986b0b9ae544e..418c82850b43fe 100644 --- a/apps/web/app/[user]/[type]/embed/page.tsx +++ b/apps/web/app/[user]/[type]/embed/page.tsx @@ -6,8 +6,6 @@ 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(getServerSideProps); const getEmbedData = withEmbedSsrAppDir(getData); diff --git a/apps/web/app/[user]/embed/page.tsx b/apps/web/app/[user]/embed/page.tsx index 5aae7be4346f59..e27e2adbf8f135 100644 --- a/apps/web/app/[user]/embed/page.tsx +++ b/apps/web/app/[user]/embed/page.tsx @@ -7,8 +7,6 @@ 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"; -export { generateMetadata } from "../page"; - const getData = withAppDirSsr(getServerSideProps); const getEmbedData = withEmbedSsrAppDir(getData); From 73d5d75fbe7d195e9871bb33a435bbfedf6b8907 Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Sat, 21 Dec 2024 12:16:25 -0500 Subject: [PATCH 15/57] remove future/org --- apps/web/scripts/vercel-app-router-deploy.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/scripts/vercel-app-router-deploy.sh b/apps/web/scripts/vercel-app-router-deploy.sh index 97cb40373a5d2a..1d6dac92ca705c 100755 --- a/apps/web/scripts/vercel-app-router-deploy.sh +++ b/apps/web/scripts/vercel-app-router-deploy.sh @@ -27,7 +27,6 @@ checkRoute "$APP_ROUTER_BOOKINGS_STATUS_ENABLED" app/future/bookings rm -rf \ app/future/d\ app/future/enterprise\ - app/future/org\ app/future/payment\ app/future/reschedule\ app/future/routing-forms\ From e35927d6469ed3f183faa083e89ca1cbfd7f1748 Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Sat, 21 Dec 2024 12:16:36 -0500 Subject: [PATCH 16/57] no layout in [user] page --- apps/web/app/[user]/page.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/web/app/[user]/page.tsx b/apps/web/app/[user]/page.tsx index e26286d1d500f0..1a05b75cd11730 100644 --- a/apps/web/app/[user]/page.tsx +++ b/apps/web/app/[user]/page.tsx @@ -4,8 +4,6 @@ import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { headers, cookies } from "next/headers"; -import { getLayout } from "@calcom/features/MainLayoutAppDir"; - import { buildLegacyCtx } from "@lib/buildLegacyCtx"; import { getServerSideProps } from "@server/lib/[user]/getServerSideProps"; @@ -24,4 +22,4 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { }; const getData = withAppDirSsr(getServerSideProps); -export default WithLayout({ getLayout, getData, Page: LegacyPage })<"P">; +export default WithLayout({ getData, Page: LegacyPage })<"P">; From d6eb69907412832f07eb2d78d08e80da8eaa0188 Mon Sep 17 00:00:00 2001 From: Benny Joo Date: Sat, 21 Dec 2024 12:31:51 -0500 Subject: [PATCH 17/57] simplify --- apps/web/app/org/[orgSlug]/embed/page.tsx | 1 - .../team/[slug]/[type]/page.tsx | 3 +- apps/web/app/org/[orgSlug]/page.tsx | 30 +----------- .../org/[orgSlug]/team/[slug]/[type]/page.tsx | 46 +------------------ .../app/org/[orgSlug]/team/[slug]/page.tsx | 30 +----------- apps/web/app/team/[slug]/page.tsx | 1 + 6 files changed, 5 insertions(+), 106 deletions(-) diff --git a/apps/web/app/org/[orgSlug]/embed/page.tsx b/apps/web/app/org/[orgSlug]/embed/page.tsx index 75baee4c556831..efcc1bc3114ab9 100644 --- a/apps/web/app/org/[orgSlug]/embed/page.tsx +++ b/apps/web/app/org/[orgSlug]/embed/page.tsx @@ -8,7 +8,6 @@ import type { PageProps } from "~/team/team-view"; import TeamPage from "~/team/team-view"; const getData = withAppDirSsr(getServerSideProps); - const getEmbedData = withEmbedSsrAppDir(getData); export default WithLayout({ diff --git a/apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx index 2786759be38759..e3cfb08da4a58c 100644 --- a/apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx +++ b/apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx @@ -4,7 +4,6 @@ import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { headers, cookies } from "next/headers"; -import { getLayout } from "@calcom/features/MainLayoutAppDir"; import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; import { EventRepository } from "@calcom/lib/server/repository/event"; @@ -39,4 +38,4 @@ export const generateMetadata = async ({ params, searchParams }: _PageProps) => }; const getData = withAppDirSsr(getServerSideProps); -export default WithLayout({ getLayout, getData, Page })<"P">; +export default WithLayout({ getData, Page, isBookingPage: true })<"P">; diff --git a/apps/web/app/org/[orgSlug]/page.tsx b/apps/web/app/org/[orgSlug]/page.tsx index 745d7e9547e192..99b51c0aa24735 100644 --- a/apps/web/app/org/[orgSlug]/page.tsx +++ b/apps/web/app/org/[orgSlug]/page.tsx @@ -1,29 +1 @@ -import { withAppDirSsr } from "app/WithAppDirSsr"; -import type { PageProps as _PageProps } from "app/_types"; -import { _generateMetadata } from "app/_utils"; -import { WithLayout } from "app/layoutHOC"; -import { cookies, headers } from "next/headers"; - -import { buildLegacyCtx } from "@lib/buildLegacyCtx"; -import { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; - -import type { PageProps } from "~/team/team-view"; -import TeamPage from "~/team/team-view"; - -export const generateMetadata = async ({ params, searchParams }: _PageProps) => { - const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams)); - - return await _generateMetadata( - (t) => props.team.name || t("nameless_team"), - (t) => props.team.name || t("nameless_team") - ); -}; - -const getData = withAppDirSsr(getServerSideProps); - -export default WithLayout({ - Page: TeamPage, - getData, - getLayout: null, - isBookingPage: true, -})<"P">; +export { default, generateMetadata } from "app/team/[slug]/page"; diff --git a/apps/web/app/org/[orgSlug]/team/[slug]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/team/[slug]/[type]/page.tsx index ea51f5cd9b771b..ebcf985632da3a 100644 --- a/apps/web/app/org/[orgSlug]/team/[slug]/[type]/page.tsx +++ b/apps/web/app/org/[orgSlug]/team/[slug]/[type]/page.tsx @@ -1,45 +1 @@ -import { withAppDirSsr } from "app/WithAppDirSsr"; -import type { PageProps as _PageProps } from "app/_types"; -import { _generateMetadata } from "app/_utils"; -import { WithLayout } from "app/layoutHOC"; -import { cookies, headers } from "next/headers"; - -import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; -import { EventRepository } from "@calcom/lib/server/repository/event"; - -import { buildLegacyCtx } from "@lib/buildLegacyCtx"; -import { getServerSideProps } from "@lib/team/[slug]/[type]/getServerSideProps"; - -import type { PageProps } from "~/team/type-view"; -import TypePage from "~/team/type-view"; - -export const generateMetadata = async ({ params, searchParams }: _PageProps) => { - const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); - const props = await getData(legacyCtx); - const { user: username, slug: eventSlug, booking } = props; - const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req, legacyCtx.params?.orgSlug); - - const event = await EventRepository.getPublicEvent({ - username, - eventSlug, - isTeamEvent: true, - org: isValidOrgDomain ? currentOrgDomain : null, - fromRedirectOfNonOrgLink: legacyCtx.query.orgRedirection === "true", - }); - - const profileName = event?.profile?.name ?? ""; - const title = event?.title ?? ""; - - return await _generateMetadata( - (t) => `${booking?.uid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, - (t) => `${booking?.uid ? t("reschedule") : ""} ${title}` - ); -}; -const getData = withAppDirSsr(getServerSideProps); - -export default WithLayout({ - Page: TypePage, - getData, - getLayout: null, - isBookingPage: true, -})<"P">; +export { default, generateMetadata } from "app/team/[slug]/[type]/page"; diff --git a/apps/web/app/org/[orgSlug]/team/[slug]/page.tsx b/apps/web/app/org/[orgSlug]/team/[slug]/page.tsx index 745d7e9547e192..99b51c0aa24735 100644 --- a/apps/web/app/org/[orgSlug]/team/[slug]/page.tsx +++ b/apps/web/app/org/[orgSlug]/team/[slug]/page.tsx @@ -1,29 +1 @@ -import { withAppDirSsr } from "app/WithAppDirSsr"; -import type { PageProps as _PageProps } from "app/_types"; -import { _generateMetadata } from "app/_utils"; -import { WithLayout } from "app/layoutHOC"; -import { cookies, headers } from "next/headers"; - -import { buildLegacyCtx } from "@lib/buildLegacyCtx"; -import { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; - -import type { PageProps } from "~/team/team-view"; -import TeamPage from "~/team/team-view"; - -export const generateMetadata = async ({ params, searchParams }: _PageProps) => { - const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams)); - - return await _generateMetadata( - (t) => props.team.name || t("nameless_team"), - (t) => props.team.name || t("nameless_team") - ); -}; - -const getData = withAppDirSsr(getServerSideProps); - -export default WithLayout({ - Page: TeamPage, - getData, - getLayout: null, - isBookingPage: true, -})<"P">; +export { default, generateMetadata } from "app/team/[slug]/page"; diff --git a/apps/web/app/team/[slug]/page.tsx b/apps/web/app/team/[slug]/page.tsx index 8cd056fe22598f..ad3e95176f4586 100644 --- a/apps/web/app/team/[slug]/page.tsx +++ b/apps/web/app/team/[slug]/page.tsx @@ -25,4 +25,5 @@ export default WithLayout({ Page: LegacyPage, getData, getLayout: null, + isBookingPage: true, })<"P">; From 8dec06be222657c5bf19eac846231bd40cd6e5af Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sat, 21 Dec 2024 22:17:03 -0500 Subject: [PATCH 18/57] fix --- apps/web/app/_utils.tsx | 2 +- apps/web/middleware.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/web/app/_utils.tsx b/apps/web/app/_utils.tsx index 22678de8ca72a3..8b48c37fb2f4c2 100644 --- a/apps/web/app/_utils.tsx +++ b/apps/web/app/_utils.tsx @@ -74,7 +74,7 @@ export const _generateMetadata = async ( url: canonical, type: "website", siteName: APP_NAME, - title, + title: displayedTitle, images: [image], }, metadataBase, diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts index cd3ddc3adc8f2e..0f8d98fb16cac8 100644 --- a/apps/web/middleware.ts +++ b/apps/web/middleware.ts @@ -160,7 +160,6 @@ export const config = { "/upgrade/:path*", "/connect-and-join/:path*", "/insights/:path*", - "/:path*/embed", "/api/auth/signup", "/api/trpc/:path*", "/login", @@ -194,6 +193,11 @@ export const config = { "/settings/:path*", "/reschedule/:path*", "/availability/:path*", + "/org/:path*", + "/team/:path*", + "/:user/:type/", + "/:user/", + "/:path*/embed", ], }; From d7acf671dee58590ae0955bc0e9210667e9fdb7a Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sun, 22 Dec 2024 00:49:01 -0500 Subject: [PATCH 19/57] fix OG image for [user] --- apps/web/app/[user]/page.tsx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/apps/web/app/[user]/page.tsx b/apps/web/app/[user]/page.tsx index 1a05b75cd11730..ccdaf000daf450 100644 --- a/apps/web/app/[user]/page.tsx +++ b/apps/web/app/[user]/page.tsx @@ -4,6 +4,10 @@ import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { headers, cookies } from "next/headers"; +import { getServerSessionForAppDir } from "@calcom/feature-auth/lib/get-server-session-for-app-dir"; +import { constructMeetingImage } from "@calcom/lib/OgImages"; +import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; + import { buildLegacyCtx } from "@lib/buildLegacyCtx"; import { getServerSideProps } from "@server/lib/[user]/getServerSideProps"; @@ -15,10 +19,31 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams)); const { profile, markdownStrippedBio } = props; - return await _generateMetadata( + const metadata = await _generateMetadata( () => profile.name, () => markdownStrippedBio ); + const session = await getServerSessionForAppDir(); + const user = session?.user; + + const meeting = { + title: markdownStrippedBio, + profile: { name: `${profile.name}`, image: user?.avatarUrl ?? null }, + users: [ + { + username: `${profile.username ?? ""}`, + name: `${profile.name ?? ""}`, + }, + ], + }; + const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); + return { + ...metadata, + openGraph: { + ...metadata.openGraph, + images: [image], + }, + }; }; const getData = withAppDirSsr(getServerSideProps); From 8b6d226d6ae1d2c6ef7e8225a3d96df08fc0307e Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sun, 22 Dec 2024 01:04:38 -0500 Subject: [PATCH 20/57] fix OG images for org/user and team/slug --- apps/web/app/org/[orgSlug]/[user]/page.tsx | 52 ++++++++++++++++++---- apps/web/app/team/[slug]/page.tsx | 30 +++++++++++-- 2 files changed, 70 insertions(+), 12 deletions(-) diff --git a/apps/web/app/org/[orgSlug]/[user]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/page.tsx index 85a52fb5b3de75..0adbc581fed2ce 100644 --- a/apps/web/app/org/[orgSlug]/[user]/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/page.tsx @@ -4,6 +4,11 @@ import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { cookies, headers } from "next/headers"; +import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import { constructMeetingImage } from "@calcom/lib/OgImages"; +import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; +import { getOrgOrTeamAvatar } from "@calcom/lib/defaultAvatarImage"; + import { buildLegacyCtx } from "@lib/buildLegacyCtx"; import { getServerSideProps } from "@lib/org/[orgSlug]/[user]/getServerSideProps"; @@ -18,17 +23,48 @@ const getData = withAppDirSsr(getServerSideProps); export const generateMetadata = async ({ params, searchParams }: PageProps) => { const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); const props = await getData(legacyCtx); - + let metadata, meeting; if ((props as TeamPageProps)?.team) { - return await _generateMetadata( - (t) => (props as TeamPageProps).team.name || t("nameless_team"), - (t) => (props as TeamPageProps).team.name || t("nameless_team") + const { team, markdownStrippedBio } = props as TeamPageProps; + meeting = { + title: markdownStrippedBio ?? "", + profile: { + name: `${team.name}`, + image: getOrgOrTeamAvatar(team), + }, + }; + + metadata = await _generateMetadata( + (t) => team.name ?? t("nameless_team"), + (t) => team.name ?? t("nameless_team") + ); + } else { + const { profile, markdownStrippedBio } = props as UserPageProps; + metadata = await _generateMetadata( + () => profile.name, + () => markdownStrippedBio ); + const session = await getServerSessionForAppDir(); + const user = session?.user; + meeting = { + title: markdownStrippedBio, + profile: { name: `${profile.name}`, image: user?.avatarUrl ?? null }, + users: [ + { + username: `${profile.username ?? ""}`, + name: `${profile.name ?? ""}`, + }, + ], + }; } - return await _generateMetadata( - (t) => (props as UserPageProps).profile.name, - (t) => (props as UserPageProps).markdownStrippedBio - ); + const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); + return { + ...metadata, + openGraph: { + ...metadata.openGraph, + images: [image], + }, + }; }; export const Page = async (props: OrgPageProps) => { diff --git a/apps/web/app/team/[slug]/page.tsx b/apps/web/app/team/[slug]/page.tsx index ad3e95176f4586..2c8bf1ed63f60c 100644 --- a/apps/web/app/team/[slug]/page.tsx +++ b/apps/web/app/team/[slug]/page.tsx @@ -4,6 +4,10 @@ import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { cookies, headers } from "next/headers"; +import { constructMeetingImage } from "@calcom/lib/OgImages"; +import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; +import { getOrgOrTeamAvatar } from "@calcom/lib/defaultAvatarImage"; + import { buildLegacyCtx } from "@lib/buildLegacyCtx"; import { getServerSideProps } from "@lib/team/[slug]/getServerSideProps"; @@ -11,12 +15,30 @@ import type { PageProps } from "~/team/team-view"; import LegacyPage from "~/team/team-view"; export const generateMetadata = async ({ params, searchParams }: _PageProps) => { - const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams)); + const { team, markdownStrippedBio } = await getData( + buildLegacyCtx(headers(), cookies(), params, searchParams) + ); + + const meeting = { + title: markdownStrippedBio ?? "", + profile: { + name: `${team.name}`, + image: getOrgOrTeamAvatar(team), + }, + }; + const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); - return await _generateMetadata( - (t) => props.team.name || t("nameless_team"), - (t) => props.team.name || t("nameless_team") + const metadata = await _generateMetadata( + (t) => team.name || t("nameless_team"), + (t) => team.name || t("nameless_team") ); + return { + ...metadata, + openGraph: { + ...metadata.openGraph, + images: [image], + }, + }; }; const getData = withAppDirSsr(getServerSideProps); From 85d1c779b234ab0b7792c05e6e13470f0a1a2e6c Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sun, 22 Dec 2024 01:31:12 -0500 Subject: [PATCH 21/57] fix OG images for booking page --- apps/web/app/[user]/[type]/page.tsx | 23 ++++++++++++++++- .../app/org/[orgSlug]/[user]/[type]/page.tsx | 25 +++++++++++++++++-- apps/web/app/team/[slug]/[type]/page.tsx | 23 ++++++++++++++++- 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/apps/web/app/[user]/[type]/page.tsx b/apps/web/app/[user]/[type]/page.tsx index 3a61c20e5badb9..1e962c456403ea 100644 --- a/apps/web/app/[user]/[type]/page.tsx +++ b/apps/web/app/[user]/[type]/page.tsx @@ -5,6 +5,8 @@ import { WithLayout } from "app/layoutHOC"; import { headers, cookies } from "next/headers"; import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; +import { constructMeetingImage } from "@calcom/lib/OgImages"; +import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; import { EventRepository } from "@calcom/lib/server/repository/event"; import { buildLegacyCtx } from "@lib/buildLegacyCtx"; @@ -31,12 +33,31 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { }); const profileName = event?.profile?.name ?? ""; + const profileImage = event?.profile.image; const title = event?.title ?? ""; - return await _generateMetadata( + const metadata = await _generateMetadata( (t) => `${rescheduleUid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}` ); + const meeting = { + title, + profile: { name: profileName, image: profileImage }, + users: [ + ...(event?.users || []).map((user) => ({ + name: `${user.name}`, + username: `${user.username}`, + })), + ], + }; + const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); + return { + ...metadata, + openGraph: { + ...metadata.openGraph, + images: [image], + }, + }; }; const getData = withAppDirSsr(getServerSideProps); diff --git a/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx index d150e05340269e..0487c37ed65695 100644 --- a/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx @@ -5,6 +5,8 @@ import { WithLayout } from "app/layoutHOC"; import { cookies, headers } from "next/headers"; import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; +import { constructMeetingImage } from "@calcom/lib/OgImages"; +import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; import { EventRepository } from "@calcom/lib/server/repository/event"; import { buildLegacyCtx } from "@lib/buildLegacyCtx"; @@ -29,18 +31,37 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const event = await EventRepository.getPublicEvent({ username, eventSlug, - isTeamEvent: false, + isTeamEvent: !!(props as TeamTypePageProps)?.teamId, org: isValidOrgDomain ? currentOrgDomain : null, fromRedirectOfNonOrgLink: legacyCtx.query.orgRedirection === "true", }); const profileName = event?.profile?.name ?? ""; + const profileImage = event?.profile.image; const title = event?.title ?? ""; - return await _generateMetadata( + const metadata = await _generateMetadata( (t) => `${rescheduleUid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}` ); + const meeting = { + title, + profile: { name: profileName, image: profileImage }, + users: [ + ...(event?.users || []).map((user) => ({ + name: `${user.name}`, + username: `${user.username}`, + })), + ], + }; + const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); + return { + ...metadata, + openGraph: { + ...metadata.openGraph, + images: [image], + }, + }; }; export const Page = async (props: OrgTypePageProps) => { diff --git a/apps/web/app/team/[slug]/[type]/page.tsx b/apps/web/app/team/[slug]/[type]/page.tsx index debf7575b85c76..90261ae2d23036 100644 --- a/apps/web/app/team/[slug]/[type]/page.tsx +++ b/apps/web/app/team/[slug]/[type]/page.tsx @@ -5,6 +5,8 @@ import { WithLayout } from "app/layoutHOC"; import { cookies, headers } from "next/headers"; import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; +import { constructMeetingImage } from "@calcom/lib/OgImages"; +import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; import { EventRepository } from "@calcom/lib/server/repository/event"; import { buildLegacyCtx } from "@lib/buildLegacyCtx"; @@ -27,12 +29,31 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { }); const profileName = event?.profile?.name ?? ""; + const profileImage = event?.profile.image; const title = event?.title ?? ""; - return await _generateMetadata( + const metadata = await _generateMetadata( (t) => `${booking?.uid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, (t) => `${booking?.uid ? t("reschedule") : ""} ${title}` ); + const meeting = { + title, + profile: { name: profileName, image: profileImage }, + users: [ + ...(event?.users || []).map((user) => ({ + name: `${user.name}`, + username: `${user.username}`, + })), + ], + }; + const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); + return { + ...metadata, + openGraph: { + ...metadata.openGraph, + images: [image], + }, + }; }; const getData = withAppDirSsr(getServerSideProps); From ead55e0bdbc3665f4991268379db1b7917f582ed Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sun, 22 Dec 2024 14:48:19 -0500 Subject: [PATCH 22/57] fix all metadata --- apps/web/app/[user]/[type]/page.tsx | 10 +++-- apps/web/app/[user]/page.tsx | 14 ++++++- apps/web/app/_utils.tsx | 10 +++-- .../app/org/[orgSlug]/[user]/[type]/page.tsx | 4 +- apps/web/app/org/[orgSlug]/[user]/page.tsx | 37 ++++++++++++++----- apps/web/app/team/[slug]/[type]/page.tsx | 10 +++-- apps/web/app/team/[slug]/page.tsx | 9 ++++- .../modules/users/views/users-public-view.tsx | 7 +--- 8 files changed, 72 insertions(+), 29 deletions(-) diff --git a/apps/web/app/[user]/[type]/page.tsx b/apps/web/app/[user]/[type]/page.tsx index 1e962c456403ea..da866234bf601b 100644 --- a/apps/web/app/[user]/[type]/page.tsx +++ b/apps/web/app/[user]/[type]/page.tsx @@ -4,7 +4,7 @@ import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { headers, cookies } from "next/headers"; -import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; +import { getOrgFullOrigin, orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; import { constructMeetingImage } from "@calcom/lib/OgImages"; import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; import { EventRepository } from "@calcom/lib/server/repository/event"; @@ -20,7 +20,7 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); const props = await getData(legacyCtx); - const { booking, user: username, slug: eventSlug } = props; + const { booking, user: username, slug: eventSlug, isSEOIndexable, eventData } = props; const rescheduleUid = booking?.uid; const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req, legacyCtx.params?.orgSlug); @@ -38,7 +38,9 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const metadata = await _generateMetadata( (t) => `${rescheduleUid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, - (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}` + (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}`, + false, + getOrgFullOrigin(eventData?.entity.orgSlug ?? null) ); const meeting = { title, @@ -53,6 +55,8 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); return { ...metadata, + nofollow: event?.hidden || !isSEOIndexable, + noindex: event?.hidden || !isSEOIndexable, openGraph: { ...metadata.openGraph, images: [image], diff --git a/apps/web/app/[user]/page.tsx b/apps/web/app/[user]/page.tsx index ccdaf000daf450..0aa9724ffad21c 100644 --- a/apps/web/app/[user]/page.tsx +++ b/apps/web/app/[user]/page.tsx @@ -5,6 +5,7 @@ import { WithLayout } from "app/layoutHOC"; import { headers, cookies } from "next/headers"; import { getServerSessionForAppDir } from "@calcom/feature-auth/lib/get-server-session-for-app-dir"; +import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains"; import { constructMeetingImage } from "@calcom/lib/OgImages"; import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; @@ -18,10 +19,12 @@ import LegacyPage from "~/users/views/users-public-view"; export const generateMetadata = async ({ params, searchParams }: PageProps) => { const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams)); - const { profile, markdownStrippedBio } = props; + const { profile, markdownStrippedBio, isOrgSEOIndexable, entity } = props; const metadata = await _generateMetadata( () => profile.name, - () => markdownStrippedBio + () => markdownStrippedBio, + false, + getOrgFullOrigin(entity.orgSlug ?? null) ); const session = await getServerSessionForAppDir(); const user = session?.user; @@ -37,8 +40,15 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { ], }; const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); + const isOrg = !!profile?.organization; + + const allowSEOIndexing = + (!isOrg && profile.allowSEOIndexing) || (isOrg && isOrgSEOIndexable && profile.allowSEOIndexing); + return { ...metadata, + noindex: !allowSEOIndexing, + nofollow: !allowSEOIndexing, openGraph: { ...metadata.openGraph, images: [image], diff --git a/apps/web/app/_utils.tsx b/apps/web/app/_utils.tsx index 8b48c37fb2f4c2..0f175140739482 100644 --- a/apps/web/app/_utils.tsx +++ b/apps/web/app/_utils.tsx @@ -4,7 +4,8 @@ import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { headers } from "next/headers"; import { constructGenericImage } from "@calcom/lib/OgImages"; -import { IS_CALCOM, WEBAPP_URL, APP_NAME, SEO_IMG_OGIMG } from "@calcom/lib/constants"; +import { IS_CALCOM, WEBAPP_URL, APP_NAME, SEO_IMG_OGIMG, CAL_URL } from "@calcom/lib/constants"; +import { buildCanonical } from "@calcom/lib/next-seo.config"; import { truncateOnWord } from "@calcom/lib/text"; //@ts-expect-error no type definitions import config from "@calcom/web/next-i18next.config"; @@ -39,10 +40,13 @@ export const getTranslate = async () => { export const _generateMetadata = async ( getTitle: (t: TFunction) => string, getDescription: (t: TFunction) => string, - excludeAppNameFromTitle?: boolean + excludeAppNameFromTitle?: boolean, + origin?: string ) => { const h = headers(); - const canonical = h.get("x-pathname") ?? ""; + const pathname = h.get("x-pathname") ?? ""; + const canonical = buildCanonical({ path: pathname, origin: origin ?? CAL_URL }); + const locale = h.get("x-locale") ?? "en"; const t = await getFixedT(locale, "common"); diff --git a/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx index 0487c37ed65695..d78afea4a54062 100644 --- a/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx @@ -24,7 +24,7 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); const props = await getData(legacyCtx); - const { booking, user: username, slug: eventSlug } = props; + const { booking, user: username, slug: eventSlug, isSEOIndexable } = props; const rescheduleUid = booking?.uid; const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req, legacyCtx.params?.orgSlug); @@ -57,6 +57,8 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); return { ...metadata, + nofollow: event?.hidden || !isSEOIndexable, + noindex: event?.hidden || !isSEOIndexable, openGraph: { ...metadata.openGraph, images: [image], diff --git a/apps/web/app/org/[orgSlug]/[user]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/page.tsx index 0adbc581fed2ce..8e2d2b2e324b0b 100644 --- a/apps/web/app/org/[orgSlug]/[user]/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/page.tsx @@ -5,6 +5,7 @@ import { WithLayout } from "app/layoutHOC"; import { cookies, headers } from "next/headers"; import { getServerSessionForAppDir } from "@calcom/features/auth/lib/get-server-session-for-app-dir"; +import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains"; import { constructMeetingImage } from "@calcom/lib/OgImages"; import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; import { getOrgOrTeamAvatar } from "@calcom/lib/defaultAvatarImage"; @@ -25,7 +26,7 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const props = await getData(legacyCtx); let metadata, meeting; if ((props as TeamPageProps)?.team) { - const { team, markdownStrippedBio } = props as TeamPageProps; + const { team, markdownStrippedBio, isSEOIndexable, currentOrgDomain } = props as TeamPageProps; meeting = { title: markdownStrippedBio ?? "", profile: { @@ -34,16 +35,32 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { }, }; - metadata = await _generateMetadata( - (t) => team.name ?? t("nameless_team"), - (t) => team.name ?? t("nameless_team") - ); + metadata = { + ...(await _generateMetadata( + (t) => team.name ?? t("nameless_team"), + (t) => team.name ?? t("nameless_team"), + false, + getOrgFullOrigin(currentOrgDomain ?? null) + )), + noindex: !isSEOIndexable, + nofollow: !isSEOIndexable, + }; } else { - const { profile, markdownStrippedBio } = props as UserPageProps; - metadata = await _generateMetadata( - () => profile.name, - () => markdownStrippedBio - ); + const { profile, markdownStrippedBio, isOrgSEOIndexable, entity } = props as UserPageProps; + const isOrg = !!profile?.organization; + + const allowSEOIndexing = + (!isOrg && profile.allowSEOIndexing) || (isOrg && isOrgSEOIndexable && profile.allowSEOIndexing); + metadata = { + ...(await _generateMetadata( + () => profile.name, + () => markdownStrippedBio, + false, + getOrgFullOrigin(entity.orgSlug ?? null) + )), + noindex: !allowSEOIndexing, + nofollow: !allowSEOIndexing, + }; const session = await getServerSessionForAppDir(); const user = session?.user; meeting = { diff --git a/apps/web/app/team/[slug]/[type]/page.tsx b/apps/web/app/team/[slug]/[type]/page.tsx index 90261ae2d23036..529629ca559c45 100644 --- a/apps/web/app/team/[slug]/[type]/page.tsx +++ b/apps/web/app/team/[slug]/[type]/page.tsx @@ -4,7 +4,7 @@ import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { cookies, headers } from "next/headers"; -import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; +import { getOrgFullOrigin, orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; import { constructMeetingImage } from "@calcom/lib/OgImages"; import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; import { EventRepository } from "@calcom/lib/server/repository/event"; @@ -17,7 +17,7 @@ import LegacyPage, { type PageProps as LegacyPageProps } from "~/team/type-view" export const generateMetadata = async ({ params, searchParams }: PageProps) => { const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); const props = await getData(legacyCtx); - const { user: username, slug: eventSlug, booking } = props; + const { user: username, slug: eventSlug, booking, isSEOIndexable, eventData } = props; const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req, legacyCtx.params?.orgSlug); const event = await EventRepository.getPublicEvent({ @@ -34,7 +34,9 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const metadata = await _generateMetadata( (t) => `${booking?.uid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, - (t) => `${booking?.uid ? t("reschedule") : ""} ${title}` + (t) => `${booking?.uid ? t("reschedule") : ""} ${title}`, + false, + getOrgFullOrigin(eventData.entity.orgSlug ?? null) ); const meeting = { title, @@ -49,6 +51,8 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const image = SEO_IMG_OGIMG + constructMeetingImage(meeting); return { ...metadata, + nofollow: event?.hidden || !isSEOIndexable, + noindex: event?.hidden || !isSEOIndexable, openGraph: { ...metadata.openGraph, images: [image], diff --git a/apps/web/app/team/[slug]/page.tsx b/apps/web/app/team/[slug]/page.tsx index 2c8bf1ed63f60c..70598ed43573e7 100644 --- a/apps/web/app/team/[slug]/page.tsx +++ b/apps/web/app/team/[slug]/page.tsx @@ -4,6 +4,7 @@ import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { cookies, headers } from "next/headers"; +import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains"; import { constructMeetingImage } from "@calcom/lib/OgImages"; import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; import { getOrgOrTeamAvatar } from "@calcom/lib/defaultAvatarImage"; @@ -15,7 +16,7 @@ import type { PageProps } from "~/team/team-view"; import LegacyPage from "~/team/team-view"; export const generateMetadata = async ({ params, searchParams }: _PageProps) => { - const { team, markdownStrippedBio } = await getData( + const { team, markdownStrippedBio, isSEOIndexable, currentOrgDomain } = await getData( buildLegacyCtx(headers(), cookies(), params, searchParams) ); @@ -30,10 +31,14 @@ export const generateMetadata = async ({ params, searchParams }: _PageProps) => const metadata = await _generateMetadata( (t) => team.name || t("nameless_team"), - (t) => team.name || t("nameless_team") + (t) => team.name || t("nameless_team"), + false, + getOrgFullOrigin(currentOrgDomain ?? null) ); return { ...metadata, + nofollow: !isSEOIndexable, + noindex: !isSEOIndexable, openGraph: { ...metadata.openGraph, images: [image], diff --git a/apps/web/modules/users/views/users-public-view.tsx b/apps/web/modules/users/views/users-public-view.tsx index aef379fa14dd20..faf97728e5cf79 100644 --- a/apps/web/modules/users/views/users-public-view.tsx +++ b/apps/web/modules/users/views/users-public-view.tsx @@ -60,11 +60,8 @@ export function UserPage(props: PageProps) { const isEventListEmpty = eventTypes.length === 0; const isOrg = !!user?.profile?.organization; - const allowSEOIndexing = isOrg - ? isOrgSEOIndexable - ? profile.allowSEOIndexing - : false - : profile.allowSEOIndexing; + const allowSEOIndexing = + (!isOrg && profile.allowSEOIndexing) || (isOrg && isOrgSEOIndexable && profile.allowSEOIndexing); return ( <> From 29f2b135e0976943e1fc6aa4e7809d6b34dce5c3 Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sun, 22 Dec 2024 15:22:42 -0500 Subject: [PATCH 23/57] use isBrandingHidden --- apps/web/app/[user]/[type]/page.tsx | 4 ++-- apps/web/app/d/[link]/[slug]/page.tsx | 5 +++-- apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx | 8 +++++--- .../[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx | 5 +++-- apps/web/app/team/[slug]/[type]/page.tsx | 4 ++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/apps/web/app/[user]/[type]/page.tsx b/apps/web/app/[user]/[type]/page.tsx index da866234bf601b..9ddec692ab22b2 100644 --- a/apps/web/app/[user]/[type]/page.tsx +++ b/apps/web/app/[user]/[type]/page.tsx @@ -20,7 +20,7 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); const props = await getData(legacyCtx); - const { booking, user: username, slug: eventSlug, isSEOIndexable, eventData } = props; + const { booking, user: username, slug: eventSlug, isSEOIndexable, eventData, isBrandingHidden } = props; const rescheduleUid = booking?.uid; const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req, legacyCtx.params?.orgSlug); @@ -39,7 +39,7 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const metadata = await _generateMetadata( (t) => `${rescheduleUid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}`, - false, + isBrandingHidden, getOrgFullOrigin(eventData?.entity.orgSlug ?? null) ); const meeting = { diff --git a/apps/web/app/d/[link]/[slug]/page.tsx b/apps/web/app/d/[link]/[slug]/page.tsx index 0d194c685322de..73eb631fa8ad36 100644 --- a/apps/web/app/d/[link]/[slug]/page.tsx +++ b/apps/web/app/d/[link]/[slug]/page.tsx @@ -17,7 +17,7 @@ export const generateMetadata = async ({ params, searchParams }: _PageProps) => const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); const pageProps = await getData(legacyCtx); - const { booking, user: username, slug: eventSlug, isTeamEvent } = pageProps; + const { booking, user: username, slug: eventSlug, isTeamEvent, isBrandingHidden } = pageProps; const rescheduleUid = booking?.uid; const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req); const org = isValidOrgDomain ? currentOrgDomain : null; @@ -34,7 +34,8 @@ export const generateMetadata = async ({ params, searchParams }: _PageProps) => const title = event?.title ?? ""; return await _generateMetadata( (t) => `${rescheduleUid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, - (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}` + (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}`, + isBrandingHidden ); }; diff --git a/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx index d78afea4a54062..5cb6975af211cf 100644 --- a/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx +++ b/apps/web/app/org/[orgSlug]/[user]/[type]/page.tsx @@ -4,7 +4,7 @@ import { _generateMetadata } from "app/_utils"; import { WithLayout } from "app/layoutHOC"; import { cookies, headers } from "next/headers"; -import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; +import { getOrgFullOrigin, orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains"; import { constructMeetingImage } from "@calcom/lib/OgImages"; import { SEO_IMG_OGIMG } from "@calcom/lib/constants"; import { EventRepository } from "@calcom/lib/server/repository/event"; @@ -24,7 +24,7 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); const props = await getData(legacyCtx); - const { booking, user: username, slug: eventSlug, isSEOIndexable } = props; + const { booking, user: username, slug: eventSlug, isSEOIndexable, eventData, isBrandingHidden } = props; const rescheduleUid = booking?.uid; const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req, legacyCtx.params?.orgSlug); @@ -42,7 +42,9 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const metadata = await _generateMetadata( (t) => `${rescheduleUid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, - (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}` + (t) => `${rescheduleUid ? t("reschedule") : ""} ${title}`, + isBrandingHidden, + getOrgFullOrigin(eventData?.entity.orgSlug ?? null) ); const meeting = { title, diff --git a/apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx b/apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx index e3cfb08da4a58c..5626ac8c4e7f1c 100644 --- a/apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx +++ b/apps/web/app/org/[orgSlug]/instant-meeting/team/[slug]/[type]/page.tsx @@ -15,7 +15,7 @@ import Page from "~/org/[orgSlug]/instant-meeting/team/[slug]/[type]/instant-mee export const generateMetadata = async ({ params, searchParams }: _PageProps) => { const context = buildLegacyCtx(headers(), cookies(), params, searchParams); - const { slug: eventSlug, user: username } = await getData(context); + const { slug: eventSlug, user: username, isBrandingHidden } = await getData(context); const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(context.req, context.params?.orgSlug); const org = isValidOrgDomain ? currentOrgDomain : null; @@ -33,7 +33,8 @@ export const generateMetadata = async ({ params, searchParams }: _PageProps) => return await _generateMetadata( () => `${title} | ${profileName}`, - () => `${title}` + () => `${title}`, + isBrandingHidden ); }; diff --git a/apps/web/app/team/[slug]/[type]/page.tsx b/apps/web/app/team/[slug]/[type]/page.tsx index 529629ca559c45..a8658e5ef60897 100644 --- a/apps/web/app/team/[slug]/[type]/page.tsx +++ b/apps/web/app/team/[slug]/[type]/page.tsx @@ -17,7 +17,7 @@ import LegacyPage, { type PageProps as LegacyPageProps } from "~/team/type-view" export const generateMetadata = async ({ params, searchParams }: PageProps) => { const legacyCtx = buildLegacyCtx(headers(), cookies(), params, searchParams); const props = await getData(legacyCtx); - const { user: username, slug: eventSlug, booking, isSEOIndexable, eventData } = props; + const { user: username, slug: eventSlug, booking, isSEOIndexable, eventData, isBrandingHidden } = props; const { currentOrgDomain, isValidOrgDomain } = orgDomainConfig(legacyCtx.req, legacyCtx.params?.orgSlug); const event = await EventRepository.getPublicEvent({ @@ -35,7 +35,7 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => { const metadata = await _generateMetadata( (t) => `${booking?.uid && !!booking ? t("reschedule") : ""} ${title} | ${profileName}`, (t) => `${booking?.uid ? t("reschedule") : ""} ${title}`, - false, + isBrandingHidden, getOrgFullOrigin(eventData.entity.orgSlug ?? null) ); const meeting = { From bf641c214b34ab261924db638e2b1fbcf4a2ce3e Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sun, 22 Dec 2024 15:38:36 -0500 Subject: [PATCH 24/57] remove BookerSeo and its usages --- apps/web/modules/d/[link]/d-type-view.tsx | 7 -- .../[slug]/[type]/instant-meeting-view.tsx | 9 -- apps/web/modules/team/type-view.tsx | 20 ---- .../users/views/users-type-public-view.tsx | 19 ---- .../bookings/components/BookerSeo.test.tsx | 94 ------------------- .../bookings/components/BookerSeo.tsx | 88 ----------------- 6 files changed, 237 deletions(-) delete mode 100644 packages/features/bookings/components/BookerSeo.test.tsx delete mode 100644 packages/features/bookings/components/BookerSeo.tsx diff --git a/apps/web/modules/d/[link]/d-type-view.tsx b/apps/web/modules/d/[link]/d-type-view.tsx index 46f7315074293d..43f5ac1789828c 100644 --- a/apps/web/modules/d/[link]/d-type-view.tsx +++ b/apps/web/modules/d/[link]/d-type-view.tsx @@ -20,13 +20,6 @@ export default function Type({ }: PageProps) { return (
- & EmbedProps; function Type({ slug, user, booking, isEmbed, isBrandingHidden, entity, eventTypeId, duration }: PageProps) { return (
- -