From eff64c21b4281568148372607f7d35692e4137aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 23 Dec 2024 12:06:28 +0100 Subject: [PATCH] feat: delete actions/plus pages --- next.config.js | 1 - .../actionsContent/AllerPlusLoin.tsx | 19 +------ .../actions/plus/[...dottedName]/page.tsx | 52 ------------------ .../plus/_components/ActionPlusList.tsx | 53 ------------------- .../(large-layout)/actions/plus/page.tsx | 46 ---------------- .../(large-layout)/plan-du-site/page.tsx | 4 -- src/app/sitemap.ts | 17 +----- src/constants/tracking/pages/actions.ts | 8 --- 8 files changed, 2 insertions(+), 198 deletions(-) delete mode 100644 src/app/(simulation)/(large-layout)/actions/plus/[...dottedName]/page.tsx delete mode 100644 src/app/(simulation)/(large-layout)/actions/plus/_components/ActionPlusList.tsx delete mode 100644 src/app/(simulation)/(large-layout)/actions/plus/page.tsx diff --git a/next.config.js b/next.config.js index b1fd08e7c..7721ce8f0 100644 --- a/next.config.js +++ b/next.config.js @@ -71,7 +71,6 @@ const nextConfig = { '*': ['.next/cache/webpack', '.git/**/*', 'cypress/**/*'], '/blog': ['public/NGC_Kit.diffusion.zip'], '/nouveautes': ['public/images/blog', 'public/NGC_Kit.diffusion.zip'], - '/actions/plus': ['public/images/blog', 'public/NGC_Kit.diffusion.zip'], '/sitemap.xml': ['public/images/blog', 'public/NGC_Kit.diffusion.zip'], }, optimizePackageImports: ['@incubateur-ademe/nosgestesclimat'], diff --git a/src/app/(simulation)/(large-layout)/actions/_components/actionsContent/AllerPlusLoin.tsx b/src/app/(simulation)/(large-layout)/actions/_components/actionsContent/AllerPlusLoin.tsx index 5b1fe7139..dec8b85c6 100644 --- a/src/app/(simulation)/(large-layout)/actions/_components/actionsContent/AllerPlusLoin.tsx +++ b/src/app/(simulation)/(large-layout)/actions/_components/actionsContent/AllerPlusLoin.tsx @@ -3,10 +3,7 @@ import Link from '@/components/Link' import BookClosedIcon from '@/components/icons/BookClosedIcon' import Trans from '@/components/translation/Trans' -import { - actionsClickActionsPlus, - actionsClickAdeme, -} from '@/constants/tracking/pages/actions' +import { actionsClickAdeme } from '@/constants/tracking/pages/actions' import Card from '@/design-system/layout/Card' import { useClientTranslation } from '@/hooks/useClientTranslation' import { trackEvent } from '@/utils/matomo/trackEvent' @@ -25,21 +22,7 @@ export default function AllerPlusLoin() {
-

- Au-delà d'un simple chiffre, découvrez les enjeux qui se cachent - derrière chaque action : -

-
- ) -} diff --git a/src/app/(simulation)/(large-layout)/actions/plus/_components/ActionPlusList.tsx b/src/app/(simulation)/(large-layout)/actions/plus/_components/ActionPlusList.tsx deleted file mode 100644 index dbeb04349..000000000 --- a/src/app/(simulation)/(large-layout)/actions/plus/_components/ActionPlusList.tsx +++ /dev/null @@ -1,53 +0,0 @@ -'use client' - -import Link from '@/components/Link' -import Card from '@/design-system/layout/Card' -import { getRuleTitle } from '@/helpers/publicodes/getRuleTitle' -import { useTempEngine } from '@/publicodes-state' - -import type { Post } from '@/types/posts' -import { encodeRuleName } from '@/utils/publicodes/encodeRuleName' -import type { - DottedName, - NGCRule, - NGCRules, -} from '@incubateur-ademe/nosgestesclimat' - -type Props = { - actions: Post[] -} -export default function ActionPlusList({ actions }: Props) { - const { rules } = useTempEngine() - - if (!rules) return null - - const plusListe = Object.entries(rules as NGCRules) - .map(([dottedName, rule]) => ({ ...rule, dottedName })) - .map((rule) => { - const plus = actions.find( - (action) => action.slug === rule.dottedName - )?.content - return { ...rule, plus } - }) - .filter((r) => r.plus) - - return ( - - ) -} diff --git a/src/app/(simulation)/(large-layout)/actions/plus/page.tsx b/src/app/(simulation)/(large-layout)/actions/plus/page.tsx deleted file mode 100644 index ee77abe34..000000000 --- a/src/app/(simulation)/(large-layout)/actions/plus/page.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import Trans from '@/components/translation/Trans' -import { getServerTranslation } from '@/helpers/getServerTranslation' -import { getPosts } from '@/helpers/markdown/getPosts' -import { getMetadataObject } from '@/helpers/metadata/getMetadataObject' -import Image from 'next/image' -import ActionPlusList from './_components/ActionPlusList' - -export async function generateMetadata() { - const { t } = await getServerTranslation() - - return getMetadataObject({ - title: t('Actions, la liste - Nos Gestes Climat'), - description: t( - 'Découvrez les actions que vous pouvez mettre en place pour réduire votre empreinte carbone.' - ), - }) -} - -export default async function ActionList() { - const actions = await getPosts(`src/locales/actions-plus/fr/`) - - return ( -
-

- Nos explications complètes{' '} - beta -

- -

- - - Découvrez les enjeux qui se cachent derrière chaque action. - - -

- - -
- ) -} diff --git a/src/app/(simulation)/(large-layout)/plan-du-site/page.tsx b/src/app/(simulation)/(large-layout)/plan-du-site/page.tsx index e29ba9fcc..f2ee75cac 100644 --- a/src/app/(simulation)/(large-layout)/plan-du-site/page.tsx +++ b/src/app/(simulation)/(large-layout)/plan-du-site/page.tsx @@ -36,10 +36,6 @@ export default async function PlanDuSitePage() { title: t('Nos actions pour réduire votre empreinte'), href: '/actions', }, - actionsPlus: { - title: t('Les actions phares'), - href: '/actions/plus', - }, }, 'Comparez votre empreinte': { organisation: { diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index 125a0011c..89862762f 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -1,5 +1,4 @@ import { getPosts } from '@/helpers/markdown/getPosts' -import { encodeRuleName } from '@/utils/publicodes/encodeRuleName' import rules from '@incubateur-ademe/nosgestesclimat/public/co2-model.FR-lang.fr-opti.json' import type { MetadataRoute } from 'next' import { utils } from 'publicodes' @@ -8,7 +7,6 @@ export default async function sitemap(): Promise { const staticPages = [ '', 'personas', - 'actions/plus', 'nouveautes', 'a-propos', 'contact', @@ -50,18 +48,5 @@ export default async function sitemap(): Promise { priority: 0.6, })) - const actionPosts = await getPosts(`src/locales/actions-plus/fr/`) - const actionUrls = actionPosts.map((post) => ({ - url: `https://nosgestesclimat.fr/actions/plus/${encodeRuleName(post?.slug ?? '')}`, - lastModified: new Date(), - priority: 0.8, - })) - - return [ - ...staticUrls, - ...blogUrls, - ...actionUrls, - ...releaseUrls, - ...documentationUrls, - ] + return [...staticUrls, ...blogUrls, ...releaseUrls, ...documentationUrls] } diff --git a/src/constants/tracking/pages/actions.ts b/src/constants/tracking/pages/actions.ts index e686b590c..cce470abc 100644 --- a/src/constants/tracking/pages/actions.ts +++ b/src/constants/tracking/pages/actions.ts @@ -46,14 +46,6 @@ export const actionsOpenAction = (action: DottedName) => [ `Open Action ${action}`, ] -// Figma comment #114 -export const actionsClickActionsPlus = [ - 'trackEvent', - 'Actions', - 'Click More infos', - 'Click Actions Plus', -] - // Figma comment #114 export const actionsClickAdeme = [ 'trackEvent',