diff --git a/__tests__/components/ab-testing/give-access-to-resources.test.js b/__tests__/components/ab-testing/give-access-to-resources.test.js deleted file mode 100644 index 184f9263..00000000 --- a/__tests__/components/ab-testing/give-access-to-resources.test.js +++ /dev/null @@ -1,32 +0,0 @@ -import { fireEvent, render, screen } from "@testing-library/react" -import { GiveAccessToResources } from "../../../src/components/ab-testing/resources/GiveAccessToResources" -import { STORAGE_TEST_ABC } from "../../../src/constants/constants" -import * as AbTestingUtils from "../../../src/utils/ab-testing/ab-testing.utils" - -describe("UI de GiveAccessToResources", () => { - describe("TEST A/B/C/D", () => { - const mailBtnText = "Je souhaite recevoir les ressources par mail" - - test("Should return modal with email when test is A", async () => { - localStorage.setItem(STORAGE_TEST_ABC, AbTestingUtils.TEST.A) - render() - - const button = screen.getByRole("button", { name: mailBtnText }) - expect(button).toBeInTheDocument() - - fireEvent.click(button) - expect(await screen.queryByText("Fermer")).toBeInTheDocument() - }) - - test("Should return modal with email when test is B", async () => { - localStorage.setItem(STORAGE_TEST_ABC, AbTestingUtils.TEST.B) - render() - - const button = screen.getByRole("button", { name: mailBtnText }) - expect(button).toBeInTheDocument() - - fireEvent.click(button) - expect(await screen.queryByText("Fermer")).toBeInTheDocument() - }) - }) -}) diff --git a/__tests__/pages/contact/to-be-contacted.test.js b/__tests__/pages/contact/to-be-contacted.test.js index 738cea80..bad1d5d0 100644 --- a/__tests__/pages/contact/to-be-contacted.test.js +++ b/__tests__/pages/contact/to-be-contacted.test.js @@ -6,11 +6,6 @@ import { RequestContact } from "../../../src/constants/constants" describe("Demande de contact", () => { describe("Validité des choix seléctionnés", () => { - test("Sélection du type Chat => choix valide", () => { - const result = isValidButtonEnabled(RequestContact.type.chat, undefined) - expect(result).toEqual(true) - }) - test("Sélection du type RDV => choix valide", () => { const result = isValidButtonEnabled( RequestContact.type.rendezvous, @@ -19,11 +14,6 @@ describe("Demande de contact", () => { expect(result).toEqual(true) }) - test("Sélection du type Email => choix valide", () => { - const result = isValidButtonEnabled(RequestContact.type.email, undefined) - expect(result).toEqual(true) - }) - test("Sélection du type SMS sans horaire => choix invalide", () => { const result = isValidButtonEnabled(RequestContact.type.sms, undefined) expect(result).toEqual(false) diff --git a/__tests__/utils/contact.utils.test.js b/__tests__/utils/contact.utils.test.js index 4e4d772b..d8c1f53f 100644 --- a/__tests__/utils/contact.utils.test.js +++ b/__tests__/utils/contact.utils.test.js @@ -7,24 +7,10 @@ import * as TrackerUtils from "../../src/utils/tracker.utils" * @param {*} label */ const sendTrackerContactConfirmed = (contactType) => { - if (contactType === "chat") { - TrackerUtils.trackerForContact(`Ouverture ${contactType}`) - } else { - TrackerUtils.trackerForContact(`Confirmation ${contactType}`) - } + TrackerUtils.trackerForContact(`Confirmation ${contactType}`) } describe("Contact Utils", () => { - describe("trackerContactName", () => { - test("Should return confirmation mail if email type is selected", () => { - expect(ContactUtils.trackerContactName("email")).toEqual( - "Confirmation email" - ) - }) - test("Should return confirmation mail if chat type is selected", () => { - expect(ContactUtils.trackerContactName("chat")).toEqual("Ouverture chat") - }) - }) describe("sendTrackerContactConfirmed", () => { let trackerSpy localStorage.setItem(STORAGE_SOURCE, "1000-premiers-jours") @@ -36,21 +22,10 @@ describe("Contact Utils", () => { jest.restoreAllMocks() }) - test("Should send tracker with email confirmation", () => { - sendTrackerContactConfirmed(RequestContact.type.email) - expect(trackerSpy).toHaveBeenCalledWith("Confirmation email") - }) - test("Should send tracker with sms confirmation", () => { sendTrackerContactConfirmed(RequestContact.type.sms) expect(trackerSpy).toHaveBeenCalledWith(`Confirmation sms`) }) - - test("Should send tracker with chat opening", () => { - sendTrackerContactConfirmed(RequestContact.type.chat) - expect(trackerSpy).toHaveBeenCalled() - expect(trackerSpy).toHaveBeenCalledWith("Ouverture chat") - }) }) describe("isMamanBluesAvailableHours", () => { diff --git a/apollo-client.js b/apollo-client.js index 1bb1cdfa..5426a428 100644 --- a/apollo-client.js +++ b/apollo-client.js @@ -9,6 +9,36 @@ export const client = new ApolloClient({ link: new HttpLink({ uri: `${API_URL}/graphql?nocache`, fetch }), }) +export const GET_INFORMATION_PRO_SANTE = gql` + query annuaire1000JBlues { + annuaire1000JBlues { + type + prenom + nom + profession + telephone1 + telephone2 + adresse + ville + code_postal + region + departement + longitude + latitude + tarif + conventionne_securite_sociale + } + } +` + +export const GET_ACTIVATION_TILE_STATUS = gql` + query activationTile { + activationTile { + activation_tile + } + } +` + export const EPDS_ADD_SURVEY_RESULTS = gql` mutation ( $genre: ENUM_REPONSESEPDS_GENRE! @@ -78,18 +108,6 @@ export const EPDS_CONTACT_INFORMATION = gql` } ` -export const GET_ACTIVATION_CHAT_STATUS = gql` - query activationChat { - activationChat { - activation_chat - matin_de - matin_a - apres_midi_de - apres_midi_a - } - } -` - export const GET_TEMOIGNAGES_CHIFFRES = gql` query temoignages { temoignages { diff --git a/next.config.js b/next.config.js index 4f8a687e..1e45d980 100644 --- a/next.config.js +++ b/next.config.js @@ -1,5 +1,8 @@ -module.exports = { +const withTM = require("next-transpile-modules")(["@codegouvfr/react-dsfr"]) + +module.exports = withTM({ reactStrictMode: true, + swcMinify: true, i18n: { locales: ["fr-FR"], defaultLocale: "fr-FR", @@ -21,4 +24,5 @@ module.exports = { return config }, -} + transpilePackages: ["@codegouvfr/react-dsfr"], +}) diff --git a/package.json b/package.json index 3f7e49bd..ad5ef4c5 100644 --- a/package.json +++ b/package.json @@ -10,24 +10,28 @@ }, "dependencies": { "@apollo/client": "^3.5.7", + "@codegouvfr/react-dsfr": "^0.46.4", "@dataesr/react-dsfr": "^3.3.5", - "@gouvfr/dsfr": "^1.8.1", "@socialgouv/matomo-next": "^1.4.0", "@socialgouv/nos1000jours-lib": "^1.7.0", "bootstrap": "^5.1.3", "crisp-sdk-web": "^1.0.5", "cross-fetch": "^3.1.4", + "framer-motion": "^10.11.4", "graphql": "^16.2.0", "html-react-parser": "^3.0.4", "jspdf": "^2.5.1", "moment": "^2.29.1", "next": "12.2.6", + "next-transpile-modules": "^10.0.0", "papaparse": "^5.3.2", "react": "17.0.2", "react-bootstrap": "^2.1.0", "react-bootstrap-icons": "^1.7.2", "react-calendly": "^4.1.1", "react-dom": "17.0.2", + "react-router-dom": "^6.10.0", + "remixicon": "^3.2.0", "sass": "^1.48.0", "swr": "^1.3.0" }, diff --git a/pages/_app.js b/pages/_app.js index f438f0a7..49f332d1 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,5 +1,6 @@ import "bootstrap/dist/css/bootstrap.css" import "../styles/index.scss" +import "remixicon/fonts/remixicon.css" import "@gouvfr/dsfr/dist/dsfr/dsfr.min.css" import { init } from "@socialgouv/matomo-next" diff --git a/pages/article-dpp.js b/pages/article-dpp.js new file mode 100644 index 00000000..d3c0fecf --- /dev/null +++ b/pages/article-dpp.js @@ -0,0 +1,218 @@ +import { ContentLayout } from "../src/components/Layout" +import { WidgetHeader } from "../src/components/WidgetHeader" +import { BeBetter } from "../src/components/results/BeBetter" +import { STORAGE_SCORE } from "../src/constants/constants" +import { Icon, MediaVideo } from "@dataesr/react-dsfr" +import * as StorageUtils from "../src/utils/storage.utils" + +const Callout = ({ title, description, theme }) => { + return ( +
+
+ +
{title}
+
+

{description}

+
+ ) +} + +export default function ArticleDpp() { + const localeSelected = StorageUtils.getLocaleInLocalStorage() + const scoreValue = StorageUtils.getInLocalStorage(STORAGE_SCORE) + const score = parseInt(scoreValue) + + return ( + + +

+ L’arrivée d’un bébé est un grand bouleversement dans la vie des parents, + pour la mère et aussi pour le père.
Parfois les émotions + négatives prennent le dessus : fatigue, déprime, tristesse, voire + anxiété, culpabilité… Il est important de mieux connaitre le baby blues + et la dépression post-partum, pour savoir comment réagir. +

+ +