From d841f65ec429eccd16dfcfbfa5e12d5be36270fa Mon Sep 17 00:00:00 2001 From: Maxime Golfier <25312957+maxgfr@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:04:21 +0200 Subject: [PATCH] =?UTF-8?q?feat(dsfr):=20ajout=20des=20premi=C3=A8res=20pa?= =?UTF-8?q?ges=20et=20composants=20en=20DSFR=20(#6078)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: dsfr * fix: dsfr * fix: dsfr * fix: tests * fix: build * fix: build * fix: build * feat(dsfr): ajout du footer (#6079) * feat: add code * fix: tests * fix: tests * fix: tests * fix: tests * fix: tests * fix: dernier titi * fix: autoclick * fix: bug * feat(css): ajout de la lib `panda-css` (zero-runtime) (#6085) * fix: pandacss * fix: build * fix: build * feat(dsfr): ajout de la page stats (#6090) * fix: pandacss * fix: build * fix: build * fix(stats): add page * fix: stats * fix: tests * fix: tests * Update packages/code-du-travail-frontend/src/modules/mentions-legales/index.tsx Co-authored-by: Martial Maillot * fix(recherche): remonter les pré-qualifiés dans la recherche (#6082) * chore(release): version 4.151.1 * fix(csp): remove reporting on sentry (#6092) * fix: config * fix: config * fix: config * empty * fix: config * empty * Update packages/code-du-travail-frontend/src/modules/mentions-legales/index.tsx Co-authored-by: Martial Maillot * Update packages/code-du-travail-frontend/src/modules/mentions-legales/index.tsx Co-authored-by: Martial Maillot * fix: config * chore(dsfr): mise à jour de la version DSFR * fix(dsfr): ignore les exceptions d'hydratation * feat(tests): ajout du module de testing (#6096) * fix: tests * fix: tests * fix: command * fix: merge date * fix: tests * fix: tests * fix: tests * fix: tests * fix(dsfr): ignore les exceptions d'hydratation * fix: readme * feat(DSFR): migration de la page article du code du travail (#6099) * feat: 6093 dsfr page politique de confidentialit (#6094) * feat: implémentation page politique confidentialité dsfr * chore: clean * fix: iframe dark mode * chore: refacto + e2e test * feat: convert a to Link * chore: review * chore: rename test --------- Co-authored-by: victor * feat(dsfr): ajout des liens d'évitement (#6120) * feat(dsfr): migration de la page plan du site (#6097) * feat(dsfr): mise à jour des snapshots * feat(dsfr): mise à jour des snapshots * chore(dsfr): mise à jour de la lib DSFR * feat(dsfr): ajout du composant "Avez-vous trouvé une réponse à votre question" (#6121) * fix: merge date * fix: satisfaction * fix: retours preavis * fix: retours preavis * fix: tests * move feedback component to the page articleCodeDuTravail.tsx * clean-up css * fix: feedback * fix: feedback * fix: tests * fix: tests * feat(dsfr): création du composant "Besoin de plus d'information" (#6135) * fix: ui * fix: composant --------- Co-authored-by: carolineBda Co-authored-by: Martial Maillot * fix: retours * fix: tests * feat: nouvelle API pour les articles du code du travail (#6132) Co-authored-by: carolineBda * fix(spec) : fix de la spec article-code-du-travail.spec.ts * fix(dsfr): ajout de la config pour supprimer le `insafe-inline` des `scripts` dans les `csp` (#6151) * feat(dsfr): ajout de matomo pour tracker les events (#6157) * fix: matomo * fix: matomo --------- Co-authored-by: Martial Maillot * fix(feedback): ajout d'une logique de caractères restants (#6156) * fix: tests * feat: limiter à 500 caractères la saisie * feat: limiter à 500 caractères la saisie --------- Co-authored-by: Martial Maillot * feat(dsfr): ajout du nouveau logo (#6159) * feat(dsfr): ajout des pages d'erreurs (404 + 500) (#6146) * fix: pages * fix: 404 * fix: tests * fix: tests * fix: tests * fix: lint * test error * fix errors * Fix spec * add button to test error page * feat: force error 500 for testing purpose * feat: revert errors --------- Co-authored-by: carolineBda Co-authored-by: Martial Maillot * feat: séparation des anciennes API et des nouvelles (#6183) * fix(article code du travail): retrait du tag Code du travail (#6182) * feat(config): correction de `husky`, ajout de `prettier` pour le formattage et de `lint-staged` pour runner le formattage au `precommit` (#6192) * fix: prettier * fix: prettier * fix: readme * fix: readme * fix: bug * fix: prettier * fix: prettier * fix: tests * fix: tests * fix: prettier * fix: prettier * fix: branch * merge dev * fix: crash lors de la sélection d'une suggestion (#6202) * fix: crash lors de la sélection d'une suggestion * Update packages/code-du-travail-frontend/src/modules/utils/events.ts Co-authored-by: Caroline <4971715+carolineBda@users.noreply.github.com> --------- Co-authored-by: Caroline <4971715+carolineBda@users.noreply.github.com> * fix: crash lors de la sélection d'une suggestion (#6209) * fix: crash lors de la sélection d'une suggestion * Update packages/code-du-travail-frontend/src/modules/utils/events.ts Co-authored-by: Caroline <4971715+carolineBda@users.noreply.github.com> --------- Co-authored-by: Martial Maillot * fix(suggestion): style + move feedback into RichComponent (#6210) * fix: format --------- Co-authored-by: Caroline <4971715+carolineBda@users.noreply.github.com> Co-authored-by: Martial Maillot Co-authored-by: Social Groovy Bot <45039513+SocialGroovyBot@users.noreply.github.com> Co-authored-by: Victor Zeinstra Co-authored-by: victor Co-authored-by: carolineBda --- .github/workflows/quality.yml | 33 +- .husky/pre-commit | 10 +- .prettierignore | 9 - README.md | 35 +- package.json | 8 +- packages/code-du-travail-frontend/.gitignore | 4 + .../code-du-travail-frontend/.prettierignore | 4 + .../code-du-travail-frontend/.prettierrc.mjs | 10 + packages/code-du-travail-frontend/README.md | 243 - .../__snapshots__/a-propos.test.tsx.snap | 182 +- .../droit-du-travail.test.js.snap | 608 +- .../fiche-ministere-travail.test.tsx.snap | 294 +- .../glossaire-[slug].test.tsx.snap | 160 +- .../__snapshots__/glossaire.test.tsx.snap | 220 +- .../mentions-legales.test.tsx.snap | 748 -- .../modeles-de-courriers-[slug].test.tsx.snap | 302 +- .../modeles-de-courriers.test.tsx.snap | 202 +- .../__snapshots__/recherche.test.js.snap | 168 +- .../__snapshots__/stats.test.tsx.snap | 689 -- .../__snapshots__/themes.test.tsx.snap | 186 +- .../__tests__/glossaire-[slug].test.tsx | 3 +- .../__tests__/stats.test.tsx | 22 - .../app/[...not-found]/page.tsx | 5 + .../app/code-du-travail/[slug]/page.tsx | 56 + .../code-du-travail-frontend/app/error.tsx | 28 + .../app/global-error.tsx | 30 + .../code-du-travail-frontend/app/globals.css | 1 + .../code-du-travail-frontend/app/layout.tsx | 61 + .../app/mentions-legales/page.tsx | 18 + .../app/not-found.tsx | 19 + .../app/plan-du-site/page.tsx | 24 + .../app/politique-confidentialite/page.tsx | 18 + .../app/stats/page.tsx | 36 + .../cypress.config.js | 12 +- .../light/article-code-du-travail.spec.ts | 22 + .../light/contributions/contributions.spec.ts | 17 +- .../cypress/integration/light/header.spec.ts | 19 + .../integration/light/landing-pages.spec.ts | 33 +- .../integration/light/not-found.spec.ts | 9 +- .../light/outils/dossier-licenciement.spec.ts | 4 +- .../light/outils/preavis-retraite.spec.ts | 4 +- .../outils/trouver-sa-cc-je-la-saisis.spec.ts | 8 +- ...trouver-sa-cc-recherche-entreprise.spec.ts | 4 +- .../light/plan-du-site/plan-du-site.spec.ts | 12 + .../light/politique-confidentialite.spec.ts | 13 + .../integration/light/redirects.spec.ts | 2 - .../cypress/support/commands.ts | 2 + .../cypress/support/errors.ts | 15 + .../cypress/support/index.ts | 2 + .../cypress/tsconfig.json | 2 +- .../code-du-travail-frontend/jest.config.js | 6 +- .../lint-staged.config.js | 7 +- .../code-du-travail-frontend/middleware.ts | 57 + .../code-du-travail-frontend/next-env.d.ts | 3 +- .../code-du-travail-frontend/next.config.mjs | 14 +- .../code-du-travail-frontend/package.json | 28 +- .../code-du-travail-frontend/pages/404.tsx | 76 - .../code-du-travail-frontend/pages/_app.tsx | 9 +- .../pages/_document.tsx | 1 + .../pages/code-du-travail/[slug].tsx | 73 - .../pages/droit-du-travail.tsx | 18 +- .../code-du-travail-frontend/pages/index.tsx | 3 +- .../pages/integration/[slug].tsx | 5 +- .../pages/mentions-legales.tsx | 119 - .../pages/modeles-de-courriers/[slug].tsx | 4 +- .../pages/plan-du-site.tsx | 220 - .../pages/politique-confidentialite.tsx | 209 - .../code-du-travail-frontend/pages/stats.tsx | 112 - .../code-du-travail-frontend/panda.config.ts | 12 + .../postcss.config.cjs | 5 + .../public/static/assets/img/logo.svg | 8 + .../public/static/assets/img/ovoid.svg | 19 + .../public/static/assets/img/srdt.svg | 25 + .../static/assets/img/technical-error.svg | 61 + .../scripts/data/documents_data.json | 226 + ...idcc.test.ts.snap => idcc.es.test.ts.snap} | 18 +- ...t.test.ts.snap => suggest.es.test.ts.snap} | 0 .../{idcc.test.ts => idcc.es.test.ts} | 0 .../{suggest.test.ts => suggest.es.test.ts} | 0 .../{utils.test.ts => utils.es.test.ts} | 0 ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 .../src/api/modules/agreements/queries.ts | 2 +- ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 .../src/api/modules/enterprises/controller.ts | 2 +- ...es.test.ts => fetchEnterprises.es.test.ts} | 0 ....test.ts => populateAgreements.es.test.ts} | 0 ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 .../src/api/modules/glossary/queries.ts | 4 +- .../src/api/modules/glossary/service.ts | 2 +- ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 .../src/api/modules/highlights/queries.ts | 4 +- ...e.test.ts.snap => service.es.test.ts.snap} | 6 +- .../{service.test.ts => service.es.test.ts} | 0 .../src/api/modules/index.ts | 1 - ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 .../src/api/modules/items/service.ts | 6 +- ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 ...e.test.ts.snap => service.es.test.ts.snap} | 10 +- .../{service.test.ts => service.es.test.ts} | 0 .../src/api/modules/search/service/search.ts | 6 +- ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 .../modules/sitemap/__tests__/service.test.ts | 156 - .../src/api/modules/sitemap/index.ts | 1 - .../src/api/modules/sitemap/service.ts | 47 - ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 ...e.test.ts.snap => service.es.test.ts.snap} | 0 .../{service.test.ts => service.es.test.ts} | 0 .../src/api/modules/tools/queries.ts | 5 +- .../__snapshots__/Feedback.test.js.snap | 88 +- .../src/common/Metas.tsx | 4 +- .../__snapshots__/ReferenceList.test.js.snap | 32 +- .../ReferencesJuridiques.test.js.snap | 42 +- .../src/common/Share.tsx | 12 +- .../src/common/__tests__/Answer.test.js | 10 +- .../AccessibilityModal.test.js.snap | 22 +- .../__snapshots__/Answer.test.js.snap | 1301 ++- .../__snapshots__/Article.test.js.snap | 56 +- .../__snapshots__/Breadcrumbs.test.js.snap | 22 +- .../__snapshots__/ContactModal.test.js.snap | 20 +- .../__tests__/__snapshots__/Html.test.js.snap | 2 +- .../__snapshots__/RelatedItems.test.js.snap | 42 +- .../ServiceRenseignement.test.js.snap | 28 +- .../ServiceRenseignementModal.test.js.snap | 38 +- .../__snapshots__/Share.test.js.snap | 28 +- .../__snapshots__/Custom.test.js.snap | 18 +- .../code-du-travail-frontend/src/config.ts | 8 +- .../DisplayContentContribution.test.tsx | 233 +- .../__tests__/ReferencesJuridique.test.tsx | 112 +- .../DisplayContentContribution.test.tsx.snap | 425 +- .../ReferencesJuridique.test.tsx.snap | 113 + .../conventions/Convention/Contributions.tsx | 4 +- .../__snapshots__/index.test.js.snap | 822 +- .../Search/__tests__/Search.test.js | 42 +- .../__snapshots__/Search.test.js.snap | 118 +- .../api/__mocks__/agreements.service.ts | 9 +- .../Search/api/__tests__/agreement.mock.js | 3 +- .../Search/api/agreements.service.ts | 4 +- .../Search/api/enterprises.service.ts | 8 +- .../src/conventions/SearchModal.tsx | 2 +- .../__snapshots__/SearchModal.test.js.snap | 20 +- .../FicheServicePublic.test.js.snap | 324 +- .../__tests__/ficheData.mock.json | 7012 ++++++++--------- .../components/__tests__/Accordion.test.js | 4 +- .../__tests__/ElementBuilder.test.js | 70 +- .../components/__tests__/LienExterne.test.js | 2 +- .../components/__tests__/Table.test.js | 2 +- .../__snapshots__/Accordion.test.js.snap | 100 +- .../__snapshots__/ElementBuilder.test.js.snap | 67 + .../FragmentConditionne.test.tsx.snap | 38 +- .../__snapshots__/Image.test.tsx.snap | 18 +- .../__tests__/__snapshots__/List.test.js.snap | 6 +- .../__snapshots__/OuSAdresser.test.js.snap | 10 +- .../__snapshots__/ServiceEnLigne.test.js.snap | 12 +- .../__snapshots__/Table.test.js.snap | 2 +- .../__snapshots__/Tabulator.test.js.snap | 66 +- .../__snapshots__/Title.test.js.snap | 4 +- .../__tests__/mocks/accordionData.json | 176 +- .../mocks/lienExterneCommenteData.json | 80 +- .../__tests__/mocks/lienExterneData.json | 14 +- .../components/__tests__/mocks/listData.json | 48 +- .../mocks/ouSAdresserClassicData.json | 38 +- .../__tests__/mocks/ouSAdresserWebData.json | 64 +- .../__tests__/mocks/serviceEnLigneData.json | 38 +- .../components/__tests__/mocks/tableData.json | 1934 ++--- .../__tests__/mocks/tabulatorData.json | 116 +- .../src/home/HomeSlice.tsx | 6 +- .../src/home/Tools.tsx | 6 +- .../integration/Components/Integration.tsx | 4 +- .../src/layout/Header/BurgerNav.tsx | 42 +- .../code-du-travail-frontend/src/lib/date.ts | 1 - ...ArticlesRefs.js => replaceArticlesRefs.ts} | 0 .../src/lib/useLocalStorage.ts | 2 +- .../__tests__/service.es.test.ts | 18 + .../code-du-travail/articleCodeDuTravail.tsx | 53 + .../src/modules/code-du-travail/index.ts | 3 + .../src/modules/code-du-travail/queries.ts | 23 + .../src/modules/code-du-travail/type.ts | 8 + .../src/modules/common/Html.tsx | 21 + .../src/modules/common/ListWithArrow.tsx | 33 + .../src/modules/common/RelatedItems.tsx | 52 + .../src/modules/common/Share.tsx | 133 + .../modules/common/__tests__/Html.test.tsx} | 6 +- .../common/__tests__/RelatedItems.test.tsx | 90 + .../modules/common/__tests__/Share.test.tsx | 51 + .../__snapshots__/Html.test.tsx.snap | 12 + .../__snapshots__/RelatedItems.test.tsx.snap | 108 + .../__snapshots__/Share.test.tsx.snap | 80 + .../modules/common/__tests__/metas.test.tsx | 38 + .../src/modules/common/metas.tsx | 32 + .../src/modules/common/tracking.ts | 40 + .../src/modules/config/MatomoAnalytics.tsx | 31 + .../src/modules/config/StartDsfr.tsx | 17 + .../src/modules/config/defaultColorScheme.ts | 3 + .../__tests__/queries.es.test.ts | 45 + .../src/modules/contributions/index.ts | 1 + .../src/modules/contributions/queries.ts | 29 + .../__tests__/queries.es.test.ts | 35 + .../modules/convention-collective/index.ts | 1 + .../modules/convention-collective/queries.ts | 32 + .../documents/__tests__/service.es.test.ts | 49 + .../src/modules/documents/fetch-document.ts | 22 + .../modules/documents/fetch-related-items.ts | 93 + .../src/modules/documents/index.ts | 3 + .../src/modules/documents/type.ts | 20 + .../src/modules/error/IconError.tsx | 33 + .../src/modules/error/NotFound.tsx | 59 + .../src/modules/error/UnexpectedError.tsx | 43 + .../modules/error/__tests__/NotFound.test.tsx | 10 + .../error/__tests__/UnexpectedError.test.tsx | 10 + .../__snapshots__/NotFound.test.tsx.snap | 85 + .../UnexpectedError.test.tsx.snap | 69 + .../informations/__tests__/queries.es.test.ts | 22 + .../src/modules/informations/index.ts | 1 + .../src/modules/informations/queries.ts | 35 + .../src/modules/layout/BrandTop.tsx | 7 + .../src/modules/layout/Container.tsx | 17 + .../src/modules/layout/ContainerRich.tsx | 40 + .../src/modules/layout/Footer.tsx | 180 + .../src/modules/layout/SkipLinks.tsx | 24 + .../layout/__tests__/BrandTop.test.tsx | 10 + .../modules/layout/__tests__/Footer.test.tsx | 10 + .../layout/__tests__/SkipLinks.test.tsx | 10 + .../__snapshots__/BrandTop.test.tsx.snap | 9 + .../__snapshots__/Footer.test.tsx.snap | 403 + .../__snapshots__/SkipLinks.test.tsx.snap | 53 + .../src/modules/layout/common.ts | 4 + .../layout/feedback/FeedbackAnswered.tsx | 12 + .../layout/feedback/FeedbackContent.tsx | 148 + .../layout/feedback/FeedbackDefault.tsx | 32 + .../__tests__/FeedbackAnswered.test.tsx | 11 + .../__tests__/FeedbackContent.test.tsx | 20 + .../__tests__/FeedbackDefault.test.tsx | 13 + .../FeedbackAnswered.test.tsx.snap | 14 + .../FeedbackContent.test.tsx.snap | 164 + .../FeedbackDefault.test.tsx.snap | 35 + .../src/modules/layout/feedback/index.tsx | 53 + .../src/modules/layout/feedback/tracking.ts | 72 + .../src/modules/layout/header/SearchInput.tsx | 92 + .../header/__tests__/HeaderDsfr.test.tsx | 11 + .../header/__tests__/SearchInput.test.tsx | 66 + .../__snapshots__/HeaderDsfr.test.tsx.snap | 436 + .../__tests__/fetchSuggestResults.test.ts | 30 + .../layout/header/fetchSuggestResults.ts | 19 + .../src/modules/layout/header/index.tsx | 75 + .../src/modules/layout/index.tsx | 21 + .../src/modules/layout/infos/PopupContent.tsx | 109 + .../infos/__tests__/PopupContent.test.tsx | 10 + .../__snapshots__/PopupContent.test.tsx.snap | 87 + .../__snapshots__/index.test.tsx.snap | 183 + .../layout/infos/__tests__/index.test.tsx | 10 + .../src/modules/layout/infos/index.tsx | 72 + .../src/modules/layout/infos/tracking.ts | 35 + .../src/modules/layout/tracking.ts | 28 + .../__tests__/MentionsLegales.test.tsx | 10 + .../MentionsLegales.test.tsx.snap | 123 + .../src/modules/mentions-legales/index.tsx | 91 + .../__tests__/queries.es.test.ts | 23 + .../src/modules/modeles-de-courriers/index.ts | 1 + .../modules/modeles-de-courriers/queries.ts | 33 + .../outils/__tests__/queries.es.test.ts | 26 + .../src/modules/outils/index.ts | 1 + .../src/modules/outils/queries.ts | 55 + .../src/modules/plan-du-site/SiteMap.tsx | 126 + .../__tests__/PlanDuSite.test.tsx | 38 + .../__snapshots__/PlanDuSite.test.tsx.snap | 269 + .../plan-du-site/__tests__/queries.es.test.ts | 98 + .../src/modules/plan-du-site/index.tsx | 2 + .../src/modules/plan-du-site/queries.ts | 116 + .../modules/privacy-policy/TrackApproval.tsx | 16 + .../src/modules/privacy-policy/index.tsx | 152 + .../src/modules/stats/StatsDisplay.tsx | 34 + .../modules/stats/__tests__/Stats.test.tsx | 17 + .../stats/__tests__/StatsDisplay.test.tsx | 12 + .../__snapshots__/Stats.test.tsx.snap | 128 + .../__snapshots__/StatsDisplay.test.tsx.snap | 31 + .../src/modules/stats/index.tsx | 26 + .../themes/__tests__/queries.es.test.ts | 59 + .../src/modules/themes/index.ts | 1 + .../src/modules/themes/queries.ts | 27 + .../modules/utils/__tests__/events.test.ts | 63 + .../src/modules/utils/events.ts | 38 + .../src/modules/utils/index.ts | 2 + .../src/modules/utils/sort.ts | 8 + .../Component.tsx | 5 +- .../Informations.tsx | 16 +- .../1516-organismes-formation/Component.tsx | 5 +- .../Informations.tsx | 16 +- .../agreements/1527-immobilier/Component.tsx | 5 +- .../1527-immobilier/Informations.tsx | 5 +- .../16-transports-routiers/Component.tsx | 5 +- .../16-transports-routiers/Informations.tsx | 5 +- .../1672-societes-assurances/Component.tsx | 5 +- .../1672-societes-assurances/Informations.tsx | 16 +- .../Component.tsx | 5 +- .../Informations.tsx | 16 +- .../Component.tsx | 5 +- .../Informations.tsx | 16 +- .../agreements/2120-banques/Informations.tsx | 14 +- .../2148-telecommunications/Component.tsx | 5 +- .../2148-telecommunications/Informations.tsx | 16 +- .../agreements/2596-coiffure/Component.tsx | 5 +- .../agreements/2596-coiffure/Informations.tsx | 16 +- .../2609-batiment-etam/Component.tsx | 5 +- .../2609-batiment-etam/Informations.tsx | 5 +- .../2614-travaux-public/Component.tsx | 5 +- .../2614-travaux-public/Informations.tsx | 5 +- .../44-industries-chimiques/Component.tsx | 5 +- .../44-industries-chimiques/Informations.tsx | 26 +- .../common/usecase/computeSalaryPeriods.ts | 4 +- .../steps/Agreement/store/validator.ts | 10 +- .../components/SectionTitleWithTooltip.tsx | 21 +- .../SectionTitleWithTooltip.test.tsx | 4 +- .../store/__tests__/validator.test.ts | 9 +- .../steps/Anciennete/store/store.ts | 4 +- .../steps/ContratTravail/store/store.ts | 4 +- .../steps/Informations/store/store.ts | 4 +- .../steps/Resultat/store/store.ts | 20 +- .../Salaires/components/SalaireTempsPlein.tsx | 4 +- .../__tests__/TempsPartiel.test.tsx | 8 +- .../steps/Salaires/store/store.ts | 4 +- .../steps/Salaires/store/validator.ts | 26 +- .../src/outils/CommonIndemniteDepart/store.ts | 2 +- .../CommonIndemniteDepart/utils/question.ts | 16 +- .../Components/Agreements/ShowAgreements.tsx | 4 +- .../src/outils/ConventionCollective/index.tsx | 8 +- .../steps/AgreementSelection.tsx | 4 +- .../__snapshots__/index.test.tsx.snap | 48 +- .../__tests__/information-error.test.tsx | 1 - .../__tests__/stepReducer.test.ts | 5 +- .../__tests__/success.test.tsx | 1 - .../DureePreavisDemission/steps/Result.tsx | 2 +- .../steps/__tests__/Agreement.test.tsx | 4 +- .../__snapshots__/Result.test.tsx.snap | 38 +- .../__snapshots__/index.test.tsx.snap | 52 +- .../__tests__/information-error.test.tsx | 1 - .../__tests__/stepReducer.test.ts | 5 +- .../steps/Result/Components/DisplayResult.tsx | 4 +- .../__snapshots__/Result.test.js.snap | 176 +- .../__snapshots__/Status.test.js.snap | 118 +- .../__snapshots__/index.test.tsx.snap | 52 +- .../__tests__/stepReducer.test.ts | 5 +- .../HeuresRechercheEmploi/steps/Result.tsx | 2 +- .../__snapshots__/Result.test.tsx.snap | 56 +- .../absence-date-onchange-motif.test.tsx | 6 +- .../absence-date-with-agreement.test.tsx | 6 +- .../absence-date-without-agreement.test.tsx | 6 +- .../__tests__/cc1527.test.tsx | 26 +- .../__tests__/no-agreement-result.test.tsx | 2 +- .../__tests__/notification.test.tsx | 6 +- .../__tests__/salary-validation.test.tsx | 1 - .../agreements/ui-customizations/messages.ts | 4 +- .../steps/Resultat/Eligible.tsx | 2 +- .../__snapshots__/index.test.tsx.snap | 52 +- .../__tests__/stepReducer.test.js | 5 +- .../__snapshots__/Salaires.test.js.snap | 62 +- .../__snapshots__/TypeContrat.test.js.snap | 18 +- .../TypeRemuneration.test.js.snap | 18 +- .../__tests__/__snapshots__/CDD.test.js.snap | 80 +- .../__tests__/__snapshots__/CTT.test.js.snap | 80 +- .../__snapshots__/Indemnite.test.js.snap | 140 +- .../__snapshots__/InfosGenerales.test.js.snap | 180 +- .../__snapshots__/Remuneration.test.js.snap | 96 +- .../steps/Agreement/store/validator.ts | 10 +- .../steps/Result/components/Warning.tsx | 16 +- .../src/outils/PreavisRetraite/steps/store.ts | 2 +- .../__tests__/anciennete.test.tsx | 8 +- .../__tests__/legal.test.tsx | 4 +- .../steps/Resultat/Eligible.tsx | 2 +- .../steps/Resultat/utils.ts | 2 +- .../src/outils/api/index.ts | 2 +- .../AgreementInput/AgreementTile.tsx | 4 +- .../EnterpriseSearch/Location/Search.tsx | 7 +- .../src/outils/common/Condition.js | 4 +- .../Feedback/__tests__/feedback.test.tsx | 18 +- .../outils/common/__tests__/Condition.test.js | 11 +- .../__snapshots__/SelectQuestion.test.js.snap | 28 +- .../StepInformations.test.tsx.snap | 2 +- .../__snapshots__/StepList.test.js.snap | 22 +- .../__snapshots__/Wizard.test.tsx.snap | 174 +- .../__snapshots__/YesNoQuestion.test.js.snap | 20 +- .../publicodes/indemnite-licenciement.ts | 41 +- .../data/questionnaire.data.json | 1430 ++-- .../src/search/SearchBar/index.tsx | 8 +- .../src/search/SearchResults/Law.js | 4 +- .../src/search/SearchResults/Results.tsx | 12 +- .../src/search/SearchResults/Themes.js | 4 +- .../src/search/__tests__/ListLink.test.js | 8 + .../__snapshots__/SearchResults.test.js.snap | 174 +- .../__snapshots__/search.service.test.js.snap | 13 - .../search/__tests__/search.service.test.js | 43 - .../src/search/search.service.js | 31 - .../src/search/utils.js | 4 +- .../test/jest.setup.js | 18 +- .../code-du-travail-frontend/tsconfig.json | 9 +- .../code-du-travail-modeles/.prettierignore | 3 + .../code-du-travail-modeles/.prettierrc.mjs | 10 + packages/code-du-travail-modeles/README.md | 16 - packages/code-du-travail-modeles/package.json | 12 +- .../src/modeles/common/types/salary.ts | 68 +- .../src/modeles/common/types/seniority.ts | 16 +- ...e_avec_explanations_dupliqu\303\251s.yaml" | 2 +- .../__tests__/data/formule_flag_$formule.yaml | 2 +- .../formule_plusieurs_regles_desactivees.yaml | 2 +- .../__tests__/split-by-seniority-year.test.ts | 39 +- .../missing-args.spec.ts | 1 - .../preavis-retraite.yaml | 1 - .../1486_bureaux_etudes_techniques/salary.ts | 4 +- .../preavis-retraite.yaml | 1 - .../conventions/1527_immobilier/salary.ts | 4 +- .../indemnite-licenciement/formule.spec.ts | 1 - .../missing-args.spec.ts | 1 - .../missing-args.spec.ts | 1 - .../16_transports_routiers/salary.ts | 4 +- .../conventions/2596_coiffure/salary.ts | 4 +- .../indemnite-licenciement/indemnite.spec.ts | 2 +- .../indemnite-licenciement/references.spec.ts | 14 +- .../salary.ts | 4 +- .../missing-args.spec.ts | 1 - .../missing-args.spec.ts | 1 - .../indemnite-licenciement/anciennete.spec.ts | 330 +- .../missing-args.spec.ts | 1 - .../preavis-retraite.yaml | 1 - .../src/publicodes/types.ts | 8 +- .../code-du-travail-utils/.prettierignore | 2 + .../code-du-travail-utils/.prettierrc.mjs | 10 + .../code-du-travail-utils/eslint.config.mjs | 7 + packages/code-du-travail-utils/package.json | 19 +- packages/react-ui/.stylelintrc.json | 10 - packages/react-ui/package.json | 17 +- yarn.lock | 2516 +++++- 442 files changed, 19427 insertions(+), 13591 deletions(-) delete mode 100644 .prettierignore create mode 100644 packages/code-du-travail-frontend/.prettierignore create mode 100644 packages/code-du-travail-frontend/.prettierrc.mjs delete mode 100755 packages/code-du-travail-frontend/README.md delete mode 100644 packages/code-du-travail-frontend/__tests__/__snapshots__/mentions-legales.test.tsx.snap delete mode 100644 packages/code-du-travail-frontend/__tests__/__snapshots__/stats.test.tsx.snap delete mode 100644 packages/code-du-travail-frontend/__tests__/stats.test.tsx create mode 100644 packages/code-du-travail-frontend/app/[...not-found]/page.tsx create mode 100644 packages/code-du-travail-frontend/app/code-du-travail/[slug]/page.tsx create mode 100644 packages/code-du-travail-frontend/app/error.tsx create mode 100644 packages/code-du-travail-frontend/app/global-error.tsx create mode 100644 packages/code-du-travail-frontend/app/globals.css create mode 100644 packages/code-du-travail-frontend/app/layout.tsx create mode 100644 packages/code-du-travail-frontend/app/mentions-legales/page.tsx create mode 100644 packages/code-du-travail-frontend/app/not-found.tsx create mode 100644 packages/code-du-travail-frontend/app/plan-du-site/page.tsx create mode 100644 packages/code-du-travail-frontend/app/politique-confidentialite/page.tsx create mode 100644 packages/code-du-travail-frontend/app/stats/page.tsx create mode 100644 packages/code-du-travail-frontend/cypress/integration/light/article-code-du-travail.spec.ts create mode 100644 packages/code-du-travail-frontend/cypress/integration/light/header.spec.ts create mode 100644 packages/code-du-travail-frontend/cypress/integration/light/plan-du-site/plan-du-site.spec.ts create mode 100644 packages/code-du-travail-frontend/cypress/integration/light/politique-confidentialite.spec.ts create mode 100644 packages/code-du-travail-frontend/cypress/support/errors.ts create mode 100644 packages/code-du-travail-frontend/middleware.ts delete mode 100644 packages/code-du-travail-frontend/pages/404.tsx delete mode 100644 packages/code-du-travail-frontend/pages/code-du-travail/[slug].tsx delete mode 100644 packages/code-du-travail-frontend/pages/mentions-legales.tsx delete mode 100644 packages/code-du-travail-frontend/pages/plan-du-site.tsx delete mode 100644 packages/code-du-travail-frontend/pages/politique-confidentialite.tsx delete mode 100644 packages/code-du-travail-frontend/pages/stats.tsx create mode 100644 packages/code-du-travail-frontend/panda.config.ts create mode 100644 packages/code-du-travail-frontend/postcss.config.cjs create mode 100644 packages/code-du-travail-frontend/public/static/assets/img/logo.svg create mode 100644 packages/code-du-travail-frontend/public/static/assets/img/ovoid.svg create mode 100644 packages/code-du-travail-frontend/public/static/assets/img/srdt.svg create mode 100644 packages/code-du-travail-frontend/public/static/assets/img/technical-error.svg rename packages/code-du-travail-frontend/src/api/__tests__/__snapshots__/{idcc.test.ts.snap => idcc.es.test.ts.snap} (95%) rename packages/code-du-travail-frontend/src/api/__tests__/__snapshots__/{suggest.test.ts.snap => suggest.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/__tests__/{idcc.test.ts => idcc.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/__tests__/{suggest.test.ts => suggest.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/__tests__/{utils.test.ts => utils.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/agreements/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/agreements/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/contributions/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/contributions/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/dossiers/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/dossiers/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/enterprises/service/__tests__/{fetchEnterprises.test.ts => fetchEnterprises.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/enterprises/service/__tests__/{populateAgreements.test.ts => populateAgreements.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/glossary/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/glossary/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/highlights/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/highlights/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/idcc/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (94%) rename packages/code-du-travail-frontend/src/api/modules/idcc/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/items/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/items/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/modeles/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/modeles/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/search/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (98%) rename packages/code-du-travail-frontend/src/api/modules/search/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/sheets-mt/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/sheets-mt/__tests__/{service.test.ts => service.es.test.ts} (100%) delete mode 100644 packages/code-du-travail-frontend/src/api/modules/sitemap/__tests__/service.test.ts delete mode 100644 packages/code-du-travail-frontend/src/api/modules/sitemap/index.ts delete mode 100644 packages/code-du-travail-frontend/src/api/modules/sitemap/service.ts rename packages/code-du-travail-frontend/src/api/modules/suggest/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/suggest/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/themes/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/themes/__tests__/{service.test.ts => service.es.test.ts} (100%) rename packages/code-du-travail-frontend/src/api/modules/tools/__tests__/__snapshots__/{service.test.ts.snap => service.es.test.ts.snap} (100%) rename packages/code-du-travail-frontend/src/api/modules/tools/__tests__/{service.test.ts => service.es.test.ts} (100%) create mode 100644 packages/code-du-travail-frontend/src/contributions/__tests__/__snapshots__/ReferencesJuridique.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/fiche-service-public/components/__tests__/__snapshots__/ElementBuilder.test.js.snap rename packages/code-du-travail-frontend/src/lib/{replaceArticlesRefs.js => replaceArticlesRefs.ts} (100%) create mode 100644 packages/code-du-travail-frontend/src/modules/code-du-travail/__tests__/service.es.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/code-du-travail/articleCodeDuTravail.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/code-du-travail/index.ts create mode 100644 packages/code-du-travail-frontend/src/modules/code-du-travail/queries.ts create mode 100644 packages/code-du-travail-frontend/src/modules/code-du-travail/type.ts create mode 100644 packages/code-du-travail-frontend/src/modules/common/Html.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/common/ListWithArrow.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/common/RelatedItems.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/common/Share.tsx rename packages/code-du-travail-frontend/{__tests__/mentions-legales.test.tsx => src/modules/common/__tests__/Html.test.tsx} (51%) create mode 100644 packages/code-du-travail-frontend/src/modules/common/__tests__/RelatedItems.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/common/__tests__/Share.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/Html.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/RelatedItems.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/common/__tests__/__snapshots__/Share.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/common/__tests__/metas.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/common/metas.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/common/tracking.ts create mode 100644 packages/code-du-travail-frontend/src/modules/config/MatomoAnalytics.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/config/StartDsfr.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/config/defaultColorScheme.ts create mode 100644 packages/code-du-travail-frontend/src/modules/contributions/__tests__/queries.es.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/contributions/index.ts create mode 100644 packages/code-du-travail-frontend/src/modules/contributions/queries.ts create mode 100644 packages/code-du-travail-frontend/src/modules/convention-collective/__tests__/queries.es.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/convention-collective/index.ts create mode 100644 packages/code-du-travail-frontend/src/modules/convention-collective/queries.ts create mode 100644 packages/code-du-travail-frontend/src/modules/documents/__tests__/service.es.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/documents/fetch-document.ts create mode 100644 packages/code-du-travail-frontend/src/modules/documents/fetch-related-items.ts create mode 100644 packages/code-du-travail-frontend/src/modules/documents/index.ts create mode 100644 packages/code-du-travail-frontend/src/modules/documents/type.ts create mode 100644 packages/code-du-travail-frontend/src/modules/error/IconError.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/error/NotFound.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/error/UnexpectedError.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/error/__tests__/NotFound.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/error/__tests__/UnexpectedError.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/error/__tests__/__snapshots__/NotFound.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/error/__tests__/__snapshots__/UnexpectedError.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/informations/__tests__/queries.es.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/informations/index.ts create mode 100644 packages/code-du-travail-frontend/src/modules/informations/queries.ts create mode 100644 packages/code-du-travail-frontend/src/modules/layout/BrandTop.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/Container.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/ContainerRich.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/Footer.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/SkipLinks.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/__tests__/BrandTop.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/__tests__/Footer.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/__tests__/SkipLinks.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/__tests__/__snapshots__/BrandTop.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/layout/__tests__/__snapshots__/Footer.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/layout/__tests__/__snapshots__/SkipLinks.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/layout/common.ts create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/FeedbackAnswered.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/FeedbackContent.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/FeedbackDefault.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/__tests__/FeedbackAnswered.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/__tests__/FeedbackContent.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/__tests__/FeedbackDefault.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/__tests__/__snapshots__/FeedbackAnswered.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/__tests__/__snapshots__/FeedbackContent.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/__tests__/__snapshots__/FeedbackDefault.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/index.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/feedback/tracking.ts create mode 100644 packages/code-du-travail-frontend/src/modules/layout/header/SearchInput.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/header/__tests__/HeaderDsfr.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/header/__tests__/SearchInput.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/header/__tests__/__snapshots__/HeaderDsfr.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/layout/header/__tests__/fetchSuggestResults.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/layout/header/fetchSuggestResults.ts create mode 100644 packages/code-du-travail-frontend/src/modules/layout/header/index.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/index.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/infos/PopupContent.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/infos/__tests__/PopupContent.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/infos/__tests__/__snapshots__/PopupContent.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/layout/infos/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/layout/infos/__tests__/index.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/infos/index.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/layout/infos/tracking.ts create mode 100644 packages/code-du-travail-frontend/src/modules/layout/tracking.ts create mode 100644 packages/code-du-travail-frontend/src/modules/mentions-legales/__tests__/MentionsLegales.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/mentions-legales/__tests__/__snapshots__/MentionsLegales.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/mentions-legales/index.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/modeles-de-courriers/__tests__/queries.es.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/modeles-de-courriers/index.ts create mode 100644 packages/code-du-travail-frontend/src/modules/modeles-de-courriers/queries.ts create mode 100644 packages/code-du-travail-frontend/src/modules/outils/__tests__/queries.es.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/outils/index.ts create mode 100644 packages/code-du-travail-frontend/src/modules/outils/queries.ts create mode 100644 packages/code-du-travail-frontend/src/modules/plan-du-site/SiteMap.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/plan-du-site/__tests__/PlanDuSite.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/plan-du-site/__tests__/__snapshots__/PlanDuSite.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/plan-du-site/__tests__/queries.es.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/plan-du-site/index.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/plan-du-site/queries.ts create mode 100644 packages/code-du-travail-frontend/src/modules/privacy-policy/TrackApproval.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/privacy-policy/index.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/stats/StatsDisplay.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/stats/__tests__/Stats.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/stats/__tests__/StatsDisplay.test.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/stats/__tests__/__snapshots__/Stats.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/stats/__tests__/__snapshots__/StatsDisplay.test.tsx.snap create mode 100644 packages/code-du-travail-frontend/src/modules/stats/index.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/themes/__tests__/queries.es.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/themes/index.ts create mode 100644 packages/code-du-travail-frontend/src/modules/themes/queries.ts create mode 100644 packages/code-du-travail-frontend/src/modules/utils/__tests__/events.test.ts create mode 100644 packages/code-du-travail-frontend/src/modules/utils/events.ts create mode 100644 packages/code-du-travail-frontend/src/modules/utils/index.ts create mode 100644 packages/code-du-travail-frontend/src/modules/utils/sort.ts delete mode 100644 packages/code-du-travail-frontend/src/search/__tests__/__snapshots__/search.service.test.js.snap delete mode 100644 packages/code-du-travail-frontend/src/search/__tests__/search.service.test.js delete mode 100644 packages/code-du-travail-frontend/src/search/search.service.js create mode 100644 packages/code-du-travail-modeles/.prettierignore create mode 100644 packages/code-du-travail-modeles/.prettierrc.mjs delete mode 100644 packages/code-du-travail-modeles/README.md create mode 100644 packages/code-du-travail-utils/.prettierignore create mode 100644 packages/code-du-travail-utils/.prettierrc.mjs create mode 100644 packages/code-du-travail-utils/eslint.config.mjs delete mode 100644 packages/react-ui/.stylelintrc.json diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 97e68aa675..f829351a4a 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -29,6 +29,10 @@ jobs: - name: Build code run: | yarn build + env: + NEXT_PUBLIC_ES_INDEX_PREFIX: ${{ secrets.NEXT_PUBLIC_ES_INDEX_PREFIX }} + ELASTICSEARCH_TOKEN_API: ${{ secrets.ELASTICSEARCH_TOKEN_API }} + ELASTICSEARCH_URL: ${{ secrets.ELASTICSEARCH_URL }} - name: Cache build uses: actions/cache@v4 with: @@ -43,7 +47,11 @@ jobs: fail-fast: false matrix: repositories: - ["@socialgouv/cdtn-ui", "@cdt/frontend", "@socialgouv/modeles-social"] + [ + "@cdt/frontend", + "@socialgouv/modeles-social", + "@socialgouv/cdtn-utils", + ] steps: - uses: actions/cache@v4 name: Restore build @@ -54,6 +62,29 @@ jobs: run: | yarn workspace ${{ matrix.repositories }} lint --quiet + format: + name: Code formatter checker + runs-on: ubuntu-latest + needs: [build] + strategy: + fail-fast: false + matrix: + repositories: + [ + "@cdt/frontend", + "@socialgouv/modeles-social", + "@socialgouv/cdtn-utils", + ] + steps: + - uses: actions/cache@v4 + name: Restore build + with: + path: ./* + key: ${{ github.sha }} + - name: Code formatter checker for ${{ matrix.repositories }} + run: | + yarn workspace ${{ matrix.repositories }} format:check + build-storybook: name: Build Storybook runs-on: ubuntu-latest diff --git a/.husky/pre-commit b/.husky/pre-commit index 544c847103..6b00462eb8 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,9 +1 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -yarn lerna run \ - --exclude-dependents \ - --parallel 1 \ - --since HEAD \ - --stream \ - ; +yarn precommit diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index cf3383f081..0000000000 --- a/.prettierignore +++ /dev/null @@ -1,9 +0,0 @@ -packages/code-du-travail-frontend/public/static -.next -.out -build/ -dist/ -node_modules/ -package-lock.json -yarn.lock -package.json \ No newline at end of file diff --git a/README.md b/README.md index d1c11a0d06..aa76877c0e 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,23 @@ yarn yarn build ``` -### Packages +### Testing + +```sh +yarn test:frontend # To run frontend tests +TEST_MODE=heavy-and-light yarn test:e2e # To run e2e test without any UI +TEST_MODE=heavy-and-light yarn test:e2e:ui # To run e2e test with Cypress UI +# TEST_MODE can be : light, heavy, heavy-and-light or html-validation +``` + +## Packages | Package | description | | --------------------------------------------------------------- | ---------------------------------------------------------------------------- | | [code-du-travail-frontend](./packages/code-du-travail-frontend) | Application Next.js | | [code-du-travail-modeles](./packages/code-du-travail-modeles) | Implémentation [publicodes](https://publi.codes) des conventions collectives | -| [react-ui](./packages/react-ui) | Librairie de composant | -### Frontend +### code-du-travail-frontend Pour lancer l'application en se basant sur l'API de pre-production : @@ -40,13 +48,22 @@ yarn dev:frontend Notre bibliothèque de composants UI est disponible en démo [ici](https://socialgouv.github.io/code-du-travail-numerique/). -### Testing +### code-du-travail-modeles -```sh -TEST_MODE=heavy-and-light yarn test:e2e # To run e2e test without any UI -TEST_MODE=heavy-and-light yarn test:e2e:ui # To run e2e test with Cypress UI -# TEST_MODE can be light, heavy, heavy-and-light or html-validation -``` +Ce package contient les modèles [publicodes](https://publi.codes/) pour les simulateurs du code du travail numérique. + +#### Organisation + +Le package contient les modèles publicodes dans le dossier 'src/modeles' dans le format YAML. +Le découpage des modèles n'est pas encore finalisé. +A l'heure actuelle, on place les informations du code du travail dans le fichier `contrat-salarie.yaml` +puis les informations de chaque convention collective dans le dossier `src/modeles/conventions` +où chaque convention possède son fichier. + +Une classe `MergeModele` dans le dossier `src/utils` permet de fusionner l'ensemble des fichiers YAML présent dans le dossier `modeles` pour alimenter le moteur de publicodes. + +Enfin le dossier `src/__test__` contient les tests permettant de valider les règles dans le modèle YAML. +Le but étant de pouvoir fonctionner en mode TDD pour rédiger nos règles. ## License diff --git a/package.json b/package.json index 22484b43f9..1603400e64 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "description": "Code du travail", "homepage": "https://github.com/SocialGouv/code-du-travail-numerique#readme", "scripts": { + "prepare": "husky", "build": "lerna run build --scope=@socialgouv/cdtn-utils --scope=@socialgouv/cdtn-ui --scope=@socialgouv/modeles-social --scope=@cdt/frontend --stream", "build:npm": "lerna run build --scope=@socialgouv/cdtn-utils --scope=@socialgouv/cdtn-ui --scope=@socialgouv/modeles-social --stream", "clean": "lerna clean", @@ -32,7 +33,9 @@ "test:update": "lerna run test:update --scope=@socialgouv/cdtn-ui --scope=@cdt/frontend --stream", "test:update:frontend": "lerna run test:update --scope=@cdt/frontend --stream", "test:update:api": "lerna run test:api:update --scope=@cdt/frontend --stream", - "prepare": "is-ci || husky install" + "format": "lerna run format --stream", + "format:check": "lerna run format:check --stream", + "precommit": "lerna run precommit --stream" }, "repository": { "type": "git", @@ -42,8 +45,7 @@ "url": "https://github.com/SocialGouv/code-du-travail-numerique/issues" }, "devDependencies": { - "husky": "^9.0.0", - "is-ci": "^3.0.0", + "husky": "^9.1.6", "lerna": "^5.0.0" }, "workspaces": [ diff --git a/packages/code-du-travail-frontend/.gitignore b/packages/code-du-travail-frontend/.gitignore index f38e9c2c83..0ed2068218 100644 --- a/packages/code-du-travail-frontend/.gitignore +++ b/packages/code-du-travail-frontend/.gitignore @@ -8,3 +8,7 @@ cypress/screenshots cypress/downloads .env .env.* + +## Panda +styled-system +styled-system-studio \ No newline at end of file diff --git a/packages/code-du-travail-frontend/.prettierignore b/packages/code-du-travail-frontend/.prettierignore new file mode 100644 index 0000000000..2ff512a818 --- /dev/null +++ b/packages/code-du-travail-frontend/.prettierignore @@ -0,0 +1,4 @@ +node_modules/ +.next/ +.swc/ +styled-system/ diff --git a/packages/code-du-travail-frontend/.prettierrc.mjs b/packages/code-du-travail-frontend/.prettierrc.mjs new file mode 100644 index 0000000000..9433203127 --- /dev/null +++ b/packages/code-du-travail-frontend/.prettierrc.mjs @@ -0,0 +1,10 @@ +export default { + printWidth: 80, // Maximum line length (80 characters) + tabWidth: 2, // Number of spaces per indentation level + useTabs: false, // Use spaces instead of tabs + semi: true, // End statements with a semicolon + singleQuote: false, // Use double quotes in strings + trailingComma: "es5", // Add trailing commas in objects, arrays, etc., per ES5 + bracketSpacing: true, // Add spaces inside object literals: { foo: bar } + arrowParens: "always", // Always include parens for arrow functions: (x) => x +}; diff --git a/packages/code-du-travail-frontend/README.md b/packages/code-du-travail-frontend/README.md deleted file mode 100755 index 9292bbedea..0000000000 --- a/packages/code-du-travail-frontend/README.md +++ /dev/null @@ -1,243 +0,0 @@ -# Code-du-travail - Frontend (@cdt/frontend) - -## Ajouter une convention collective pour l'indemnité de licenciement - -### 1. Ajouter le salaire de référence (`code-du-travail-modeles`) - -Dans le folder `plugins/salaire-reference`, ajouter la convention collective pour l'indemnité de licenciement en créant un fichier. - -Il faut ajouter le type d'entrée de l'input aussi tout en rajoutant les TUs. - -Puis dans `types`, rajouter le type de votre convention collective - -```ts -export type ReferenceSalaryProps = - T extends SupportedCc.IDCC1516 - ? CC1516ReferenceSalaryProps - T extends SupportedCc.IDCCXXX - ? IDCCXXXReferenceSalaryProps - : LegalReferenceSalaryProps; -``` - -### 2. Ajouter l'ancienneté (`code-du-travail-modeles`) - -Dans le folder `plugins/anciennete`, ajouter la convention collective pour l'indemnité de licenciement en créant un fichier. - -Techniquement, on peut implémenter l'interface `ISeniority` pour ajouter une fonction qui override la fonction de `compute` ou alors juste modifier les motifs en mettant les bon paramètres qu'on souhaite. - -Ensuite, dans `index.ts`, on peut ajouter la classe qui va process l'ancienneté avec comme paramètre les bons motifs. - -```ts -switch (idcc) { - case SupportedCc.IDCC2511: - return new SeniorityLegal(getMotifs(SupportedCc.IDCC2511)) as ISeniority; - case SupportedCc.default: - default: - return new SeniorityLegal(getMotifs(SupportedCc.default)) as ISeniority; -} -``` - -Enfin si on souhaite pimper les types, on peut le faire dans `types`. - -```ts -export type SeniorityProps = T extends SupportedCc.IDCC2511 - ? LegalSeniorityProps - : LegalSeniorityProps; -``` - -### 3. Ajouter la formule de calcul (`code-du-travail-modeles`) - -Dans le folder `plugins/formule`, ajouter la convention collective pour l'indemnité de licenciement en créant un fichier. - -Le principe est le même que l'`ancienneté` et le `salaire de référence`. - -On peut créer une classe qui va implémenter l'interface `IFormula` - -```ts -export class Formula1516 - implements IFormula -``` - -Ensuite, on peut modifier la fonction `computeFormula`, on ajoutant les bonnes `explanations`, comme on le voit ci-dessous : - -```ts -... -formula = `(1 / 5 * Sref * A1) + (1 / 10 * Sref * A2)`; -const anWithout = round(seniority - 15) < 2 ? "an" : "ans"; -explanations.push(`A1 : Ancienneté totale (${round(seniority)} ans)`); -explanations.push( - `A2 : Années de présence au delà de 15 ans (${round( - seniority - 15 - )} ${anWithout})` -); -... -``` - -Après dans l'`index.ts`, on peut ajouter la classe : - -```ts -switch (idcc) { - case SupportedCc.IDCC1516: - return new Formula1516() as IFormula; - case SupportedCc.default: - default: - return new FormulaLegal() as IFormula; -} -``` - -Enfin si on souhaite pimper les types, on peut le faire dans `types`. - -```ts -export type FormulaProps = T extends SupportedCc.default - ? LegalFormulaProps - : DefaultFormulaProps; -``` - -### 4. Ajouter le calcul de l'indemnité avec publicodes (`code-du-travail-modeles`) - -Il faut créer un folder pour la convention collective et créer un fichier `indemnite-licenciement.yaml`. - -Afin que la Convention collective soit considéré comme traité, il faut ajouter à `common.yaml`, le `indemnite-licenciement: true` : - -```yaml -contrat salarié . convention collective . hospitalisation privées: - description: Convention collective nationale de l'hospitalisation privée du 18 avril 2002. - applicable si: convention collective = 'IDCC2264' - valeur: oui - cdtn: - idcc: 2264 - préavis-retraite: true - indemnité-licenciement: true -``` - -Publicodes, en plus du calcul de l'indemnité s'occupe également des références juridiques. - -Le but de la règle est de remplacer la règle : `contrat salarié . indemnité de licenciement . résultat conventionnel`, comme dans l'example ci-dessous : - -```yml -contrat salarié . convention collective . sport . indemnité de licenciement: - valeur: oui - -contrat salarié . convention collective . sport . indemnité de licenciement . jusqu'à dix ans ou moins: - valeur: - le minimum de: - - contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année - - 10 an - -contrat salarié . convention collective . sport . indemnité de licenciement . au dela de dix ans: - somme: - - contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année - - (- 10 an) - plancher: 0 an - -contrat salarié . convention collective . sport . indemnité de licenciement . dix ans ou moins: - valeur: - produit: - assiette: jusqu'à dix ans ou moins * contrat salarié . indemnité de licenciement . salaire de référence conventionnel - facteur: 1 / 4 - unité: € - -contrat salarié . convention collective . sport . indemnité de licenciement . plus de dix ans: - valeur: - produit: - assiette: au dela de dix ans * contrat salarié . indemnité de licenciement . salaire de référence conventionnel - facteur: 1 / 3 - unité: € - -# (1/4*Sref*A1) + (1/3*Sref*A2) -# A1 : Ancienneté de 10 ans ou moins -# A2 : Ancienneté au delà de 10 ans -contrat salarié . convention collective . sport . indemnité de licenciement . résultat conventionnel: - remplace: contrat salarié . indemnité de licenciement . résultat conventionnel - variations: - - si: contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année > (7 mois / 12) - alors: - somme: - - dix ans ou moins - - plus de dix ans - - sinon: 0 - unité: € - arrondi: 2 décimales - références: - Article 4.4.3.3: https://www.legifrance.gouv.fr/conv_coll/article/KALIARTI000042110557?idConteneur=KALICONT000017577652 - Article 7.1.2: https://www.legifrance.gouv.fr/conv_coll/id/KALIARTI000042110596/?idConteneur=KALICONT000017577652&origin=list -``` - -NOTE: La convention collective `2264` montre une implémentation complexe qui s'occupe de plusieurs cas complexes. - -:warning: N'oublions pas d'écrire les tests pour cette partie. - -### 5. Si la convention dispose d'un salaire de référence conventionnel (`code-du-travail-frontend`) - -Il faut ajouter dans le dossier `src/outils/IndemniteLicenciement/agreements`, un dossier avec le nom de la convention collective. - -Celui-ci est composé d'un `Component.tsx` qui fonctionne comme une étape avec son propre `store`. - -Ce `store` est retrouvable dans un dossier, dans le quel, on ajoute un `validator.ts` qui est activable à chaque suivant, et un `store.ts` pour sauvegarder les informations saisies par l'utilisateur. - -On peut rajouter une méthode d'override du calcul du salaire de reference conventionnel dans un fichier `computeReferenceSalary.ts`. Celui-ci sera activé au niveau du suivant, et par conséquent lorsque les informations sont validées par le validator. - -Après, dans `src/outils/IndemniteLicenciement/types.ts` : - -```ts -export type AgreementStoreInput = - | Agreement1516StoreInput - | MaConventionCollectiveInput; - -export type AgreementStoreError = - | Agreement1516StoreError - | MaConventionCollectiveError; - -export type AgreementStoreSlice = - | Agreement1516StoreSlice - | MaConventionCollectiveSlice; - -export const createRootAgreementsStore = ( - set: StoreApi["setState"], - get: StoreApi["getState"] -) => ({ - ...createAgreement1516StoreSalaires(set, get), - ...createMaCCStore(set, get), -}); -``` - -Puis, il faut ajouter le validator dans `src/outils/IndemniteLicenciement/validator.ts` a la racine : - -```ts -export const validateAgreement = ( - idcc: SupportedCc, - step: IndemniteLicenciementStepName, - get: StoreApi["getState"], - set: StoreApi["setState"] -): boolean => { - switch (true) { - case SupportedCc.IDCC1516 === idcc && - step === IndemniteLicenciementStepName.Salaires: - return validateAgreement1516(get, set); - case SupportedCc.MA_CC === idcc && - step === IndemniteLicenciementStepName.Salaires: - return validateMaCc(get, set); - default: - return true; - } -}; -``` - -Enfin, il suffit de rajouter le composant d'injection dans `src/outils/IndemniteLicenciement/AgreementsInjector.tsx` : - -```ts -export default function AgreementsInjector(props: Props) { - switch (true) { - case SupportedCc.IDCC1516 === props.idcc && - props.step === IndemniteLicenciementStepName.Salaires: - return ; - case SupportedCc.MA_CC === props.idcc && - props.step === IndemniteLicenciementStepName.Salaires: - return ; - default: - return <>; - } -} -``` - -That's all folks ! diff --git a/packages/code-du-travail-frontend/__tests__/__snapshots__/a-propos.test.tsx.snap b/packages/code-du-travail-frontend/__tests__/__snapshots__/a-propos.test.tsx.snap index ae0f7c67a5..cd366aa83c 100644 --- a/packages/code-du-travail-frontend/__tests__/__snapshots__/a-propos.test.tsx.snap +++ b/packages/code-du-travail-frontend/__tests__/__snapshots__/a-propos.test.tsx.snap @@ -3,38 +3,38 @@ exports[` should render 1`] = `
le 04/01/2020, 00:00:00
République française, site officiel du gouvernement. Liberté, égalité, fraternité should render 1`] = `

À propos

Apprenez-en plus sur notre histoire, notre équipe et nos méthodes

Qu’est-ce que le Code du travail numérique ?

@@ -240,7 +240,7 @@ exports[` should render 1`] = ` janvier 2020.

Pourquoi le Code du travail numérique ?

@@ -258,7 +258,7 @@ exports[` should render 1`] = `

À qui ce service s’adresse-t-il ?

@@ -273,7 +273,7 @@ exports[` should render 1`] = `

Que peut-on trouver sur le site ?

@@ -298,19 +298,19 @@ exports[` should render 1`] = `

Qui sommes-nous ?

Notre équipe

@@ -346,7 +346,7 @@ exports[` should render 1`] = ` .

Nos méthodes

@@ -370,45 +370,45 @@ exports[` should render 1`] = `