From 04d3fbe4d71d0f9a12e8366af3ab1c32b1f2a795 Mon Sep 17 00:00:00 2001 From: Maxime Golfier <25312957+maxgfr@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:44:41 +0100 Subject: [PATCH] =?UTF-8?q?fix(meta):=20retours=20sur=20les=20changements?= =?UTF-8?q?=20apport=C3=A9s=20par=20la=20nouvelle=20convention=20collectiv?= =?UTF-8?q?e=203248=20(#5521)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: retours * fix: retours * fix: retours --- .../cypress/integration/conventions-collectives.spec.ts | 2 +- .../src/api/__tests__/enterprise.test.ts | 2 +- .../src/api/modules/enterprises/service/populateAgreements.ts | 2 +- .../code-du-travail-frontend/src/api/modules/home/service.ts | 2 +- .../src/contributions/ContributionGeneric.tsx | 4 +++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/code-du-travail-frontend/cypress/integration/conventions-collectives.spec.ts b/packages/code-du-travail-frontend/cypress/integration/conventions-collectives.spec.ts index bfc88006f6..6e13713e5a 100644 --- a/packages/code-du-travail-frontend/cypress/integration/conventions-collectives.spec.ts +++ b/packages/code-du-travail-frontend/cypress/integration/conventions-collectives.spec.ts @@ -9,7 +9,7 @@ describe("Conventions collectives", () => { "contain", "Retrouvez les questions/réponses fréquentes organisées par thème" ); - cy.get("#content li").should("have.length", 126); + cy.get("#content li").should("have.length", 49); cy.get("#content li").first().click(); cy.url().should( "include", diff --git a/packages/code-du-travail-frontend/src/api/__tests__/enterprise.test.ts b/packages/code-du-travail-frontend/src/api/__tests__/enterprise.test.ts index a44ea7b814..6ee6d38bdf 100644 --- a/packages/code-du-travail-frontend/src/api/__tests__/enterprise.test.ts +++ b/packages/code-du-travail-frontend/src/api/__tests__/enterprise.test.ts @@ -327,7 +327,7 @@ describe("Test enterprise endpoint", () => { { headers: { referer: "cdtn-api" } } ); - expect(response.body.entreprises).toHaveLength(1); + expect(response.body.entreprises).toHaveLength(2); response.body.entreprises.forEach((enterprise) => { expect(enterprise.conventions).toHaveLength(1); expect(enterprise.conventions[0].num).toEqual(1090); diff --git a/packages/code-du-travail-frontend/src/api/modules/enterprises/service/populateAgreements.ts b/packages/code-du-travail-frontend/src/api/modules/enterprises/service/populateAgreements.ts index e1e7d299e8..cc71ddfb4d 100644 --- a/packages/code-du-travail-frontend/src/api/modules/enterprises/service/populateAgreements.ts +++ b/packages/code-du-travail-frontend/src/api/modules/enterprises/service/populateAgreements.ts @@ -60,7 +60,7 @@ export const populateAgreements = async ( } ); const entreprises = entreprisePromises - ? await Promise.all(entreprisePromises?.slice(0, 1)) + ? await Promise.all(entreprisePromises) : []; return { ...enterpriseApiResponse, diff --git a/packages/code-du-travail-frontend/src/api/modules/home/service.ts b/packages/code-du-travail-frontend/src/api/modules/home/service.ts index e843b683a2..d9d05231ca 100644 --- a/packages/code-du-travail-frontend/src/api/modules/home/service.ts +++ b/packages/code-du-travail-frontend/src/api/modules/home/service.ts @@ -39,7 +39,7 @@ export const getHomeData = async (): Promise => { const agreements = await getByIdsAgreements([ "39ac98db5d", // 573-commerces-de-gros "81c96604dc", // 2609-batiment-etam - "be72a669a7", // 650-metallurgie-ingenieurs-et-cadres + "2f57b6af7c", // 3248-metallurgie "d825ef1df2", // 3239-particuliers-employeurs-et-emploi-a-domicile ]); const response = { diff --git a/packages/code-du-travail-frontend/src/contributions/ContributionGeneric.tsx b/packages/code-du-travail-frontend/src/contributions/ContributionGeneric.tsx index 50e09c1878..5eb0e42f86 100644 --- a/packages/code-du-travail-frontend/src/contributions/ContributionGeneric.tsx +++ b/packages/code-du-travail-frontend/src/contributions/ContributionGeneric.tsx @@ -93,6 +93,8 @@ const ContributionGeneric = ({ contribution }: Props) => { const isNoCDT = () => contribution && contribution.type === "generic-no-cdt"; const showButtonToDisplayCDTContent = () => !isNoCDT() && (!showAnswer || convention); + const showGeneralInformationButton = () => + !isNoCDT() && !showAnswer && !convention; const onSelectAgreement = ( agreement: Agreement | null, @@ -309,7 +311,7 @@ const ContributionGeneric = ({ contribution }: Props) => { - {showButtonToDisplayCDTContent() && ( + {showGeneralInformationButton() && (