forked from calcom/cal.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Revert - chore: app router - all sub-pages in
/apps
calcom#16976…
… (calcom#18702) * revert * add incomplete-booking
- Loading branch information
1 parent
2e1c68f
commit 5167f55
Showing
69 changed files
with
567 additions
and
555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Prisma } from "@prisma/client"; | ||
import { withAppDirSsg } from "app/WithAppDirSsg"; | ||
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 { AppRepository } from "@calcom/lib/server/repository/app"; | ||
|
||
import { getStaticProps } from "@lib/apps/[slug]/getStaticProps"; | ||
import { buildLegacyCtx } from "@lib/buildLegacyCtx"; | ||
|
||
import type { PageProps } from "~/apps/[slug]/slug-view"; | ||
import Page from "~/apps/[slug]/slug-view"; | ||
|
||
const getData = withAppDirSsg<PageProps>(getStaticProps, "future/apps/[slug]"); | ||
|
||
export const generateMetadata = async ({ params, searchParams }: _PageProps) => { | ||
const legacyContext = buildLegacyCtx(headers(), cookies(), params, searchParams); | ||
const res = await getData(legacyContext); | ||
|
||
return await _generateMetadata( | ||
() => res?.data.name ?? "", | ||
() => res?.data.description ?? "" | ||
); | ||
}; | ||
|
||
export const generateStaticParams = async () => { | ||
try { | ||
const appStore = await AppRepository.findAppStore(); | ||
return appStore.map(({ slug }) => ({ slug })); | ||
} catch (e: unknown) { | ||
if (e instanceof Prisma.PrismaClientInitializationError) { | ||
// Database is not available at build time, but that's ok – we fall back to resolving paths on demand | ||
} else { | ||
throw e; | ||
} | ||
} | ||
|
||
return []; | ||
}; | ||
|
||
export default WithLayout({ getLayout: null, Page, getData }); | ||
|
||
export const dynamic = "force-static"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { withAppDirSsg } from "app/WithAppDirSsg"; | ||
import { _generateMetadata } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
|
||
import { AppCategories } from "@calcom/prisma/enums"; | ||
import { isPrismaAvailableCheck } from "@calcom/prisma/is-prisma-available-check"; | ||
|
||
import { getStaticProps } from "@lib/apps/categories/[category]/getStaticProps"; | ||
|
||
import CategoryPage, { type PageProps } from "~/apps/categories/[category]/category-view"; | ||
|
||
export const generateMetadata = async () => { | ||
return await _generateMetadata( | ||
(t) => t("app_store"), | ||
(t) => t("app_store_description") | ||
); | ||
}; | ||
|
||
export const generateStaticParams = async () => { | ||
const paths = Object.keys(AppCategories); | ||
const isPrismaAvailable = await isPrismaAvailableCheck(); | ||
|
||
if (!isPrismaAvailable) { | ||
// Database is not available at build time. Make sure we fall back to building these pages on demand | ||
return []; | ||
} | ||
|
||
return paths.map((category) => ({ category })); | ||
}; | ||
|
||
const getData = withAppDirSsg<PageProps>(getStaticProps, "future/apps/categories/[category]"); | ||
|
||
export default WithLayout({ getData, Page: CategoryPage, getLayout: null })<"P">; | ||
export const dynamic = "force-static"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { withAppDirSsr } from "app/WithAppDirSsr"; | ||
import { _generateMetadata } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
|
||
import { getServerSidePropsAppDir } from "@lib/apps/installed/[category]/getServerSideProps"; | ||
|
||
import Page from "~/apps/installed/[category]/installed-category-view"; | ||
|
||
export const generateMetadata = async () => { | ||
return await _generateMetadata( | ||
(t) => t("installed_apps"), | ||
(t) => t("manage_your_connected_apps") | ||
); | ||
}; | ||
|
||
const getData = withAppDirSsr(getServerSidePropsAppDir); | ||
|
||
export default WithLayout({ getLayout: null, getData, Page }); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.