diff --git a/.infra/local/Dockerfile b/.infra/local/Dockerfile new file mode 100644 index 0000000..34cb7fa --- /dev/null +++ b/.infra/local/Dockerfile @@ -0,0 +1,8 @@ +FROM mongo:7 +COPY ./mongo_keyfile /tmp/mongo_keyfile +COPY ./mongod.conf /etc/mongod.conf +RUN chown mongodb:mongodb /etc/mongod.conf +RUN chown mongodb:mongodb /tmp/mongo_keyfile +RUN chmod 400 /tmp/mongo_keyfile + +CMD ["mongod", "--config", "/etc/mongod.conf"] diff --git a/docker-compose.yml b/docker-compose.yml index b9b154d..a13514b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,12 @@ services: mongodb: - image: mongo:7 + build: ./.infra/local/ restart: unless-stopped hostname: mongodb ports: - "127.0.0.1:27017:27017" - command: ["-f", "/etc/mongod.conf"] volumes: - tpml_mongodb_data:/data - - ./.infra/local/mongo_keyfile:/tmp/mongo_keyfile - - ./.infra/local/mongod.conf:/etc/mongod.conf:ro healthcheck: test: ["CMD", "mongosh", "--eval", '''db.runCommand("ping").ok''', "--quiet"] interval: 10s diff --git a/ui/app/StartDsfr.tsx b/ui/app/StartDsfr.tsx index 9a4a77c..da7f8b7 100644 --- a/ui/app/StartDsfr.tsx +++ b/ui/app/StartDsfr.tsx @@ -3,13 +3,15 @@ import { startReactDsfr } from "@codegouvfr/react-dsfr/next-appdir"; import Link from "next/link"; +import { defaultColorScheme } from "@/theme/defaultColorScheme"; + declare module "@codegouvfr/react-dsfr/next-appdir" { interface RegisterLink { Link: typeof Link; } } -startReactDsfr({ defaultColorScheme: "light", Link }); +startReactDsfr({ defaultColorScheme, Link }); export function StartDsfr() { //Yes, leave null here. diff --git a/ui/app/admin/utilisateurs/[id]/page.tsx b/ui/app/admin/utilisateurs/[id]/page.tsx index 788ae45..a0eb39e 100644 --- a/ui/app/admin/utilisateurs/[id]/page.tsx +++ b/ui/app/admin/utilisateurs/[id]/page.tsx @@ -3,10 +3,11 @@ import { apiGet } from "@/utils/api.utils"; import UserView from "./components/UserView"; interface Props { - params: { id: string }; + params: Promise<{ id: string }>; } -const AdminUserViewPage = async ({ params }: Props) => { +const AdminUserViewPage = async (props: Props) => { + const params = await props.params; //@ts-expect-error: TODO fix this const user = await apiGet(`/admin/users/:id`, { params }); diff --git a/ui/app/doc/[[...slug]]/page.tsx b/ui/app/doc/[[...slug]]/page.tsx index 28f573c..a60ba3a 100644 --- a/ui/app/doc/[[...slug]]/page.tsx +++ b/ui/app/doc/[[...slug]]/page.tsx @@ -5,13 +5,13 @@ import NotFoundPage from "@/app/not-found"; export const revalidate = 3_600; type DocPageProps = { - params: { + params: Promise<{ slug: string[]; - }; + }>; }; export default async function DocPage(props: DocPageProps) { - const path = `/doc/${props.params.slug.join("/")}`; + const path = `/doc/${(await props.params).slug.join("/")}`; const page = Object.values(NOTION_PAGES).find((p) => { return p.path === path; }); diff --git a/ui/app/notion/[id]/page.tsx b/ui/app/notion/[id]/page.tsx index 44bb520..4b69f50 100644 --- a/ui/app/notion/[id]/page.tsx +++ b/ui/app/notion/[id]/page.tsx @@ -2,6 +2,10 @@ import NotionPage from "@/app/components/notion/NotionPage"; export const revalidate = 300; -export default async function Page({ params: { id } }: { params: { id: string } }) { +export default async function Page(props: { params: Promise<{ id: string }> }) { + const params = await props.params; + + const { id } = params; + return ; } diff --git a/ui/app/template.tsx b/ui/app/template.tsx index 0ab9364..fd073e5 100644 --- a/ui/app/template.tsx +++ b/ui/app/template.tsx @@ -31,7 +31,7 @@ const RootTemplate: FC = ({ children }) => { {children} -