From bb74d4c873f70b2843598a44b3eca0df24d178ae Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Wed, 1 Feb 2023 15:00:05 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20iframe=20int=C3=A9gration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/source/iframe-integration-script.js | 16 +++------------- .../cout-creation-entreprise/_config.ts | 5 ++--- yarn.lock | 6 +++--- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/site/source/iframe-integration-script.js b/site/source/iframe-integration-script.js index f03022df3..d2950802e 100644 --- a/site/source/iframe-integration-script.js +++ b/site/source/iframe-integration-script.js @@ -1,18 +1,8 @@ import { hexToHSL } from './hexToHSL' -import getSimulationData from './pages/Simulateurs/metadata-src' -import { absoluteSitePaths } from './sitePaths' - -const simulationData = getSimulationData( - (_, text) => text, - absoluteSitePaths.fr -) const script = document.currentScript const moduleName = script.dataset.module || 'simulateur-embauche' -const moduleData = simulationData[moduleName] - -const moduleIframeTitle = moduleData?.title || '' const couleur = script.dataset.couleur && @@ -24,8 +14,8 @@ const src = new URL( (lang === 'fr' ? import.meta.env.VITE_FR_BASE_URL : import.meta.env.VITE_EN_BASE_URL) + - '/iframes/' + - moduleName + '/iframes/' + + moduleName ) src.searchParams.set('iframe', true) @@ -40,6 +30,7 @@ if (couleur) { const iframe = document.createElement('iframe') const iframeAttributes = { + title: 'Simulateur', id: 'simulateurEmbauche', src: src.toString(), style: 'border: none; width: 100%; display: block; height: 700px', @@ -47,7 +38,6 @@ const iframeAttributes = { allowfullscreen: true, webkitallowfullscreen: true, mozallowfullscreen: true, - title: moduleIframeTitle, } for (var key in iframeAttributes) { iframe.setAttribute(key, iframeAttributes[key]) diff --git a/site/source/pages/Simulateurs/cout-creation-entreprise/_config.ts b/site/source/pages/Simulateurs/cout-creation-entreprise/_config.ts index 757c52f2a..a96f2e7e6 100644 --- a/site/source/pages/Simulateurs/cout-creation-entreprise/_config.ts +++ b/site/source/pages/Simulateurs/cout-creation-entreprise/_config.ts @@ -1,5 +1,4 @@ -import { lazy } from 'react' - +import CoutCreationEntreprise from '.' import { PageConfig } from '../configs/types' import { SimulatorsDataParams } from '../metadata' @@ -46,7 +45,7 @@ export const configCoûtCréationEntreprise = function < }, situation: {}, }, - lazyComponent: lazy(async () => await import('.')), + component: CoutCreationEntreprise, // Remove this "as const" when we upgrade to typescript v5: } as const, diff --git a/yarn.lock b/yarn.lock index 24601a0ac..3d902edf5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25642,8 +25642,8 @@ __metadata: linkType: hard "rollup@npm:^3.7.2": - version: 3.12.0 - resolution: "rollup@npm:3.12.0" + version: 3.12.1 + resolution: "rollup@npm:3.12.1" dependencies: fsevents: ~2.3.2 dependenciesMeta: @@ -25651,7 +25651,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 66182947ea74bd4777e1a02514124f49eacc6b123e23738cf31342f8e73b79e43da05671aebe6d5f55b5830ebf3dd11f2eaba1b98b8fc6a9e6d96fd4c3ecc534 + checksum: b6b3aa4bcc13b1f15c1945201f3837be07b249854ed8a73bd67411ffe56f691b808d5b563246b78ecea4110afdb9e9e6cc7d5a3f82965a5592187dbb10d3671f languageName: node linkType: hard