From d26db43e38e35df97f27f9054454f7f1dac13086 Mon Sep 17 00:00:00 2001 From: Caroline <4971715+carolineBda@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:53:10 +0100 Subject: [PATCH 1/4] =?UTF-8?q?fix(contributions):=20modification=20des=20?= =?UTF-8?q?events=20sur=20les=20contribs=20generiques=20pour=20=C3=AAtre?= =?UTF-8?q?=20ISO=20avec=20ce=20qu'on=20avait=20avant=20le=20passage=20au?= =?UTF-8?q?=20DSFR=20(#6443)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../convention-collective/convention/page.tsx | 2 - .../src/modules/common/BlueCard.tsx | 24 ++ .../src/modules/common/useLocalStorage.ts | 10 - .../ContributionAgreemeentSelect.tsx | 54 ---- .../contributions/ContributionAgreement.tsx | 60 ++++ .../contributions/ContributionGeneric.tsx | 105 ++++++ .../ContributionGenericAgreementSearch.tsx | 25 +- .../ContributionGenericContent.tsx | 30 +- .../contributions/ContributionLayout.tsx | 125 +------- .../contribution-generic.tracking.test.tsx | 303 ++++++++++++++++++ .../__tests__/contributions.test.tsx | 14 +- .../src/modules/contributions/__tests__/ui.ts | 16 + .../AgreementSearch/AgreementSearch.tsx | 6 +- .../AgreementSearch/AgreementSearchForm.tsx | 20 +- .../AgreementSearch/AgreementSearchInput.tsx | 9 +- .../AgreementSearch/index.ts | 1 - .../Agreements/AgreementsIntro.tsx | 19 +- .../__tests__/AgreementSearchForm.test.tsx | 30 +- .../modules/convention-collective/index.ts | 1 - .../modules/convention-collective/tracking.ts | 8 +- .../EnterpriseAgreementSearch.tsx | 2 + .../EnterpriseAgreementSearchInput.tsx | 22 +- .../EnterpriseAgreementSelectionForm.tsx | 7 +- .../EnterpriseAgreementSelectionLink.tsx | 51 ++- .../__tests__/AgreementSelection.test.tsx | 13 +- .../EnterpriseAgreementSearchInput.test.tsx | 6 +- .../EnterpriseAgreementSearch/tracking.ts | 24 +- 27 files changed, 674 insertions(+), 313 deletions(-) create mode 100644 packages/code-du-travail-frontend/src/modules/common/BlueCard.tsx delete mode 100644 packages/code-du-travail-frontend/src/modules/contributions/ContributionAgreemeentSelect.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/contributions/ContributionAgreement.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/contributions/ContributionGeneric.tsx create mode 100644 packages/code-du-travail-frontend/src/modules/contributions/__tests__/contribution-generic.tracking.test.tsx diff --git a/packages/code-du-travail-frontend/app/outils/convention-collective/convention/page.tsx b/packages/code-du-travail-frontend/app/outils/convention-collective/convention/page.tsx index 3968d5086f..652172cbb1 100644 --- a/packages/code-du-travail-frontend/app/outils/convention-collective/convention/page.tsx +++ b/packages/code-du-travail-frontend/app/outils/convention-collective/convention/page.tsx @@ -1,9 +1,7 @@ import { DsfrLayout } from "../../../../src/modules/layout"; -import { DocumentElasticResult } from "../../../../src/modules/documents"; import { fetchTool, FindAgreementLayout } from "../../../../src/modules/outils"; import { notFound } from "next/navigation"; import { generateDefaultMetadata } from "../../../../src/modules/common/metas"; -import { ElasticTool } from "../../../../src/modules/outils/type"; import { AgreementSearch } from "../../../../src/modules/convention-collective"; import { agreementRelatedItems } from "../../../../src/modules/convention-collective/agreementRelatedItems"; import { SITE_URL } from "../../../../src/config"; diff --git a/packages/code-du-travail-frontend/src/modules/common/BlueCard.tsx b/packages/code-du-travail-frontend/src/modules/common/BlueCard.tsx new file mode 100644 index 0000000000..ba85e0d4d4 --- /dev/null +++ b/packages/code-du-travail-frontend/src/modules/common/BlueCard.tsx @@ -0,0 +1,24 @@ +import React from "react"; +import { css } from "@styled-system/css"; +import { fr } from "@codegouvfr/react-dsfr"; + +type Props = { + children: React.ReactNode; +}; + +const BlueCard = ({ children, ...props }: Props): JSX.Element => { + return ( +
Votre convention collective
-+ Votre convention collective +
+@@ -94,14 +96,15 @@ export function ContributionGenericAgreementSearch({
@@ -81,83 +48,15 @@ export function ContributionLayout({ contribution }: Props) { )}
{isGeneric ? ( -- - Cette réponse correspond à ce que prévoit le code du - travail, elle ne tient pas compte des spécificités de la{" "} - {selectedAgreement.shortTitle} - -
- ) - } - /> - )} - {!isGeneric && ( -hello generic
", + source: "contributions", + linkedContent: [], + references: [], + idcc: "0000", + title: "Ma contrib", + slug: "my-contrib", + breadcrumbs: [], + metas: { + title: "SEO Title", + description: "SEO Description", + }, + } as Partial