diff --git a/backend/config/index.ts b/backend/config/index.ts index 7551376143..7fedd647d5 100644 --- a/backend/config/index.ts +++ b/backend/config/index.ts @@ -15,7 +15,7 @@ const isProduction = process.env.NODE_ENV == "production" * - OPENFISCA_PUBLIC_ROOT_URL */ -const contextName = process.env.CONTEXT_NAME || "1jeune1solution" +const contextName = process.env.CONTEXT_NAME || "mes-aides.org" const config: Configuration = { env: process.env.NODE_ENV || "development", diff --git a/backend/lib/mes-aides/emails/email-render.ts b/backend/lib/mes-aides/emails/email-render.ts index 8db84b10ae..1d4a1adce3 100644 --- a/backend/lib/mes-aides/emails/email-render.ts +++ b/backend/lib/mes-aides/emails/email-render.ts @@ -1,4 +1,5 @@ import fs from "fs" +import yaml from "js-yaml" import path from "path" import consolidate from "consolidate" import { fileURLToPath } from "url" @@ -20,7 +21,8 @@ function readFile(filePath) { const emailTemplate = readFile("templates/email.mjml") const footerTemplate = readFile("templates/footer.mjml") -const headerTemplate = readFile("templates/header.mjml") +const headerTemplate = readFile(`templates/${config.contextName}/header.mjml`) +const style = yaml.load(readFile(`templates/${config.contextName}/style.yaml`)) const simulationResultsTemplate = readFile("templates/simulation-results.mjml") const simulationUsefulnessTemplate = readFile( "templates/simulation-usefulness.mjml", @@ -57,6 +59,7 @@ const dataTemplateBuilder = ( returnURL: `${config.baseURL}${followup.returnPath}`, wasUsefulLinkYes: `${config.baseURL}${followup.wasUsefulPath}`, wasUsefulLinkNo: `${config.baseURL}${followup.wasNotUsefulPath}`, + style, partials: { header: headerTemplate, content: emailTemplates[emailType], diff --git a/backend/lib/mes-aides/emails/templates/header.mjml b/backend/lib/mes-aides/emails/templates/1jeune1solution/header.mjml similarity index 100% rename from backend/lib/mes-aides/emails/templates/header.mjml rename to backend/lib/mes-aides/emails/templates/1jeune1solution/header.mjml diff --git a/backend/lib/mes-aides/emails/templates/1jeune1solution/style.yaml b/backend/lib/mes-aides/emails/templates/1jeune1solution/style.yaml new file mode 100644 index 0000000000..55be8132c6 --- /dev/null +++ b/backend/lib/mes-aides/emails/templates/1jeune1solution/style.yaml @@ -0,0 +1 @@ +ctaBackgroundColor: "#2aa28bff" diff --git a/backend/lib/mes-aides/emails/templates/mes-aides.org/header.mjml b/backend/lib/mes-aides/emails/templates/mes-aides.org/header.mjml new file mode 100644 index 0000000000..3041b5c5e8 --- /dev/null +++ b/backend/lib/mes-aides/emails/templates/mes-aides.org/header.mjml @@ -0,0 +1,9 @@ + + + + +

mes-aides.org

+
+
+
+
diff --git a/backend/lib/mes-aides/emails/templates/mes-aides.org/style.yaml b/backend/lib/mes-aides/emails/templates/mes-aides.org/style.yaml new file mode 100644 index 0000000000..55be8132c6 --- /dev/null +++ b/backend/lib/mes-aides/emails/templates/mes-aides.org/style.yaml @@ -0,0 +1 @@ +ctaBackgroundColor: "#2aa28bff" diff --git a/backend/lib/mes-aides/emails/templates/simulation-results.mjml b/backend/lib/mes-aides/emails/templates/simulation-results.mjml index 941e4b9ae2..6a47cdfbb1 100644 --- a/backend/lib/mes-aides/emails/templates/simulation-results.mjml +++ b/backend/lib/mes-aides/emails/templates/simulation-results.mjml @@ -66,7 +66,7 @@ @@ -41,7 +41,7 @@ diff --git a/backend/lib/stats/funnel-service.ts b/backend/lib/stats/funnel-service.ts index 5c2ca12f78..f4740404a7 100644 --- a/backend/lib/stats/funnel-service.ts +++ b/backend/lib/stats/funnel-service.ts @@ -251,12 +251,14 @@ const getMatomoEventsData = async ( const matomoEventData = await callMatomoAPI(piwikParameters) const dateKey = beginRange.format("YYYY-MM") return { - showAccompanimentCount: matomoEventData[dateKey].find( - (d) => d.label === "show-accompaniment-link", - )["nb_events"], - clickAccompanimentCount: matomoEventData[dateKey].find( - (d) => d.label === "click-accompaniment-link", - )["nb_events"], + showAccompanimentCount: + matomoEventData[dateKey].find( + (d) => d.label === "show-accompaniment-link", + )?.["nb_events"] || 0, + clickAccompanimentCount: + matomoEventData[dateKey].find( + (d) => d.label === "click-accompaniment-link", + )?.["nb_events"] || 0, } } diff --git a/lib/enums/themes.ts b/lib/enums/themes.ts index 0f0ad00768..c010c80ecc 100644 --- a/lib/enums/themes.ts +++ b/lib/enums/themes.ts @@ -3,6 +3,8 @@ export enum Theme { LightBlue = "light-blue", BordeauxMetropole = "bordeaux-metropole", Soliguide = "soliguide", + MesAidesOrg = "mes-aides-org", + ArcEnCiel = "arc-en-ciel", } export enum ThemeLabel { @@ -10,4 +12,6 @@ export enum ThemeLabel { LightBlue = "Thème bleu clair", BordeauxMetropole = "Thème Bordeaux Métropole", Soliguide = "Thème Soliguide", + MesAidesOrg = "mes-aides.org", + ArcEnCiel = "Thème arc enciel", } diff --git a/openfisca/requirements.txt b/openfisca/requirements.txt index 74681f493f..6281d0bd0f 100644 --- a/openfisca/requirements.txt +++ b/openfisca/requirements.txt @@ -1,7 +1,7 @@ gunicorn>=21.2.0 pytest==8.3.3 Openfisca-France==172.0.6 -Openfisca-Core[web-api]==43.3.7 +Openfisca-Core[web-api]==43.3.10 OpenFisca-France-Local[excel-reader]==6.17.7 Openfisca-Paris==5.5.12 typing_extensions==4.12.2 diff --git a/package.json b/package.json index e5c0f1bd2c..0780e72ad3 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "serve": "nodemon --exec 'node --loader ts-node/esm backend/dev.ts'", "build": "concurrently 'npm run build:server' && concurrently 'npm run build:iframes' 'npm run build:front' && npm run copy:templates", "clean:dist-server": "rm -fR dist-server", - "copy:templates": "mkdir -p dist-server/backend/lib/mes-aides/emails/templates && cp backend/lib/mes-aides/emails/templates/* dist-server/backend/lib/mes-aides/emails/templates", + "copy:templates": "mkdir -p dist-server/backend/lib/mes-aides/emails/templates && cp -r backend/lib/mes-aides/emails/templates/* dist-server/backend/lib/mes-aides/emails/templates", "build:iframes": "NODE_OPTIONS='--loader ts-node/esm' webpack --config iframes/iframes.config.ts", "build:front": "vite build", "build:server": "tsc -p tsconfig.server.json", diff --git a/public/img/mes-aides.org/Twitter_1024x512.png b/public/img/mes-aides.org/Twitter_1024x512.png new file mode 100644 index 0000000000..ebe00d4e97 Binary files /dev/null and b/public/img/mes-aides.org/Twitter_1024x512.png differ diff --git a/public/img/mes-aides.org/favicon/android-chrome-192x192.png b/public/img/mes-aides.org/favicon/android-chrome-192x192.png new file mode 100644 index 0000000000..2da3397823 Binary files /dev/null and b/public/img/mes-aides.org/favicon/android-chrome-192x192.png differ diff --git a/public/img/mes-aides.org/favicon/favicon-16x16.png b/public/img/mes-aides.org/favicon/favicon-16x16.png new file mode 100644 index 0000000000..da8fd5a181 Binary files /dev/null and b/public/img/mes-aides.org/favicon/favicon-16x16.png differ diff --git a/public/img/mes-aides.org/illustration.svg b/public/img/mes-aides.org/illustration.svg new file mode 100644 index 0000000000..b356668cdc --- /dev/null +++ b/public/img/mes-aides.org/illustration.svg @@ -0,0 +1,728 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/components/mes-aides.org/header.vue b/src/components/mes-aides.org/header.vue new file mode 100644 index 0000000000..88e4a36c4b --- /dev/null +++ b/src/components/mes-aides.org/header.vue @@ -0,0 +1,44 @@ + diff --git a/src/components/mes-aides.org/hero-section.vue b/src/components/mes-aides.org/hero-section.vue new file mode 100644 index 0000000000..16ed06ecb2 --- /dev/null +++ b/src/components/mes-aides.org/hero-section.vue @@ -0,0 +1,113 @@ + + + diff --git a/src/components/mes-aides.org/home.vue b/src/components/mes-aides.org/home.vue new file mode 100644 index 0000000000..228f13c6a6 --- /dev/null +++ b/src/components/mes-aides.org/home.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/components/mes-aides.org/layout.vue b/src/components/mes-aides.org/layout.vue new file mode 100644 index 0000000000..6881e18944 --- /dev/null +++ b/src/components/mes-aides.org/layout.vue @@ -0,0 +1,61 @@ + + + diff --git a/src/components/mes-aides.org/navigation.vue b/src/components/mes-aides.org/navigation.vue new file mode 100644 index 0000000000..24ff1ba7e5 --- /dev/null +++ b/src/components/mes-aides.org/navigation.vue @@ -0,0 +1,21 @@ + diff --git a/src/components/mes-aides.org/simulation.vue b/src/components/mes-aides.org/simulation.vue new file mode 100644 index 0000000000..5d8ef9fe0b --- /dev/null +++ b/src/components/mes-aides.org/simulation.vue @@ -0,0 +1,136 @@ + + + diff --git a/src/context/index.ts b/src/context/index.ts index ff4f10da2b..9f04340839 100644 --- a/src/context/index.ts +++ b/src/context/index.ts @@ -1,9 +1,11 @@ import baseContext from "./base.js" import mesAidesContext from "./mes-aides.js" +import mesAidesOrgContext from "./mes-aides-org.js" const contexts = { [baseContext.name]: baseContext, [mesAidesContext.name]: mesAidesContext, + [mesAidesOrgContext.name]: mesAidesOrgContext, } const context = contexts[process.env.VITE_CONTEXT_NAME] diff --git a/src/context/mes-aides-org.ts b/src/context/mes-aides-org.ts new file mode 100644 index 0000000000..b06d51690d --- /dev/null +++ b/src/context/mes-aides-org.ts @@ -0,0 +1,25 @@ +import MesAidesLayout from "@/components/mes-aides.org/layout.vue" +import Home from "@/components/mes-aides.org/home.vue" +import Simulation from "@/components/mes-aides.org/simulation.vue" + +export default { + Home, + routes: [ + { + path: "/iframe", + name: "iframe", + component: () => import("@/views/iframe.vue"), + }, + { + path: "/mentions-legales", + name: "mentions-legales", + component: () => import("@/views/mes-aides.org/mentions-legales.vue"), + meta: { + headTitle: `Mentions légales - Simulateur d'aides ${name}`, + }, + }, + ], + name: "mes-aides.org", + Layout: MesAidesLayout, + Simulation, +} diff --git a/src/context/mes-aides.ts b/src/context/mes-aides.ts index 9b8e4b49b1..9608706208 100644 --- a/src/context/mes-aides.ts +++ b/src/context/mes-aides.ts @@ -4,7 +4,16 @@ import Simulation from "@/views/simulation.vue" export default { Home, - routes: [], + routes: [ + { + path: "/questions-frequentes", + name: "questions-frequentes", + component: () => import("@/views/mes-aides.org/questions-frequentes.vue"), + meta: { + headTitle: `Questions fréquentes - Simulateur d'aides ${name}`, + }, + }, + ], name: "mes-aides", Layout: MesAidesLayout, Simulation, diff --git a/src/plugins/theme-service.ts b/src/plugins/theme-service.ts index 73c59805bb..72b1eec368 100644 --- a/src/plugins/theme-service.ts +++ b/src/plugins/theme-service.ts @@ -2,10 +2,17 @@ import BordeauxMetropole from "@/styles/themes/bordeaux-metropole.css?inline" import LightBlue from "@/styles/themes/light-blue.css?inline" import DefaultDsfr from "@/styles/themes/default-dsfr.css?inline" import Soliguide from "@/styles/themes/soliguide.css?inline" +import MesAidesOrg from "@/styles/themes/mes-aides-org.css?inline" +import ArcEnCiel from "@/styles/themes/arc-en-ciel.css?inline" import * as Sentry from "@sentry/vue" import { Theme, ThemeLabel } from "@/../lib/enums/themes.js" const options = [ + { + title: ThemeLabel.MesAidesOrg, + label: Theme.MesAidesOrg, + value: MesAidesOrg, + }, { title: ThemeLabel.Default, label: Theme.Default, @@ -26,16 +33,21 @@ const options = [ label: Theme.Soliguide, value: Soliguide, }, + { + title: ThemeLabel.ArcEnCiel, + label: Theme.ArcEnCiel, + value: ArcEnCiel, + }, ] export default { install: (app) => { const styleElement = document.createElement("style") - styleElement.textContent = DefaultDsfr + styleElement.textContent = options[0].value document.head.appendChild(styleElement) app.config.globalProperties.$theme = { - current: Theme.Default, + current: options[0].label, options, update(newThemeLabel) { const match = options.find((option) => option.label === newThemeLabel) diff --git a/src/styles/themes/arc-en-ciel.css b/src/styles/themes/arc-en-ciel.css new file mode 100644 index 0000000000..6bd1f90600 --- /dev/null +++ b/src/styles/themes/arc-en-ciel.css @@ -0,0 +1,29 @@ +:root { + /* input focus */ + --input-outline: red; + + /* buttons */ + --main-color: pink; + --main-color-hover: green; + --main-color-active: green; + --main-btn-text-color: green; + --border-radius: 0.1rem; + + /* + progress bar + home colored background + home main text + */ + --secondary-color: green; + + /* en savoir plus text */ + --info-main-color: green; + + /* en savoir plus background */ + --info-secondary-color: green; + --info-secondary-color-hover: green; + --info-secondary-color-active: green; + + /* Font */ + --font-family: sans; +} diff --git a/src/styles/themes/mes-aides-org.css b/src/styles/themes/mes-aides-org.css new file mode 100644 index 0000000000..1166917c75 --- /dev/null +++ b/src/styles/themes/mes-aides-org.css @@ -0,0 +1,45 @@ +:root { + /* input focus */ + --input-outline: #40ceb3; + + /* buttons */ + --main-color: #2aa28bff; + --main-color-hover: #2aa28bff; + --main-color-active: #2aa28bff; + --main-btn-text-color: #fff; + --border-radius: 0.1rem; + + /* + progress bar + home colored background + home main text + */ + --secondary-color: #8ee2d2; + + /* en savoir plus text */ + --info-main-color: #322e5a; + + /* en savoir plus background */ + --info-secondary-color: #f2f5f9; + --info-secondary-color-hover: #f2f5f9; + --info-secondary-color-active: #f2f5f9; + + /* Font */ + --font-family: sans; +} + + +.mao-hero-image { + height: 300px; +} + +.mao-hero-highlight { + background-image: linear-gradient( + hsla(0, 0%, 100%, 0), + hsla(0, 0%, 100%, 0) 56%, + rgba(43, 182, 115, 0.1) 0, + rgba(43, 182, 115, 0.1) 100%, + hsla(0, 0%, 100%, 0) 0 + ); + padding: 0 0.25rem; +} \ No newline at end of file diff --git a/src/views/mes-aides.org/mentions-legales.vue b/src/views/mes-aides.org/mentions-legales.vue new file mode 100644 index 0000000000..e844571b4a --- /dev/null +++ b/src/views/mes-aides.org/mentions-legales.vue @@ -0,0 +1,188 @@ + + + diff --git a/src/views/mes-aides.org/questions-frequentes.vue b/src/views/mes-aides.org/questions-frequentes.vue new file mode 100644 index 0000000000..1dad3b1bee --- /dev/null +++ b/src/views/mes-aides.org/questions-frequentes.vue @@ -0,0 +1,132 @@ +