From 1b77a99ae67251661ea8f4104a95af8c0001f092 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Mon, 26 Feb 2024 22:25:44 +0100 Subject: [PATCH 1/2] fix(header): fix exception with neutral theme --- report/www/package.json | 2 +- report/www/pages/_app.tsx | 26 ++++++++++++++------------ report/www/pages/tag/[tag].tsx | 8 +++++--- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/report/www/package.json b/report/www/package.json index ee9c8185..19c0cebd 100644 --- a/report/www/package.json +++ b/report/www/package.json @@ -14,7 +14,7 @@ "prebuild": "only-include-used-icons" }, "dependencies": { - "@codegouvfr/react-dsfr": "^1.2.2", + "@codegouvfr/react-dsfr": "^1.7.2", "@emotion/react": "^11.11.3", "@emotion/server": "^11.11.0", "@emotion/styled": "^11.11.0", diff --git a/report/www/pages/_app.tsx b/report/www/pages/_app.tsx index 5d1e1b13..c5e67424 100644 --- a/report/www/pages/_app.tsx +++ b/report/www/pages/_app.tsx @@ -36,18 +36,20 @@ const { withDsfr, dsfrDocumentApi } = createNextDsfrIntegrationApi({ const { locale = "fr" } = useRouter(); return locale; }, - preloadFonts: !!dashlordConfig.marianne && [ - //"Marianne-Light", - //"Marianne-Light_Italic", - "Marianne-Regular", - //"Marianne-Regular_Italic", - "Marianne-Medium", - //"Marianne-Medium_Italic", - "Marianne-Bold", - //"Marianne-Bold_Italic", - //"Spectral-Regular", - //"Spectral-ExtraBold" - ], + preloadFonts: + (!!dashlordConfig.marianne && [ + //"Marianne-Light", + //"Marianne-Light_Italic", + "Marianne-Regular", + //"Marianne-Regular_Italic", + "Marianne-Medium", + //"Marianne-Medium_Italic", + "Marianne-Bold", + //"Marianne-Bold_Italic", + //"Spectral-Regular", + //"Spectral-ExtraBold" + ]) || + [], }); export { dsfrDocumentApi }; diff --git a/report/www/pages/tag/[tag].tsx b/report/www/pages/tag/[tag].tsx index 707540a8..ef3cc1e1 100644 --- a/report/www/pages/tag/[tag].tsx +++ b/report/www/pages/tag/[tag].tsx @@ -3,14 +3,16 @@ import Head from "next/head"; import uniq from "lodash.uniq"; import { Dashboard } from "../../src/components/Dashboard"; -import dashlordConfig from '@/config.json'; +import dashlordConfig from "@/config.json"; const report: DashLordReport = require("../../src/report.json"); const Tag = ({ report, tag }: { report: DashLordReport; tag: string }) => { return ( <> - Tag {tag} - {dashlordConfig.title} + + Tag {tag} - {dashlordConfig.title} + @@ -30,7 +32,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => { // return list of urls to generate export const getStaticPaths: GetStaticPaths = async () => ({ - paths: uniq(report.flatMap((u: UrlReport) => u.tags)).map( + paths: uniq(report.flatMap((u: UrlReport) => u.tags).filter(Boolean)).map( (tag) => `/tag/${tag}` ), fallback: false, From 24ae961760676321e9ed5e5642ddf06464c66902 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Mon, 26 Feb 2024 22:30:10 +0100 Subject: [PATCH 2/2] snap --- .../__snapshots__/Header.test.tsx.snap | 17 ++++++----------- report/www/yarn.lock | 14 ++++++++++---- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/report/www/src/__tests__/__snapshots__/Header.test.tsx.snap b/report/www/src/__tests__/__snapshots__/Header.test.tsx.snap index b395fc8a..2679102e 100644 --- a/report/www/src/__tests__/__snapshots__/Header.test.tsx.snap +++ b/report/www/src/__tests__/__snapshots__/Header.test.tsx.snap @@ -237,17 +237,12 @@ exports[`Should render HeaderSite 1`] = `
- - Logo Fabrique des ministères sociaux - + Logo Fabrique des ministères sociaux