diff --git a/package.json b/package.json index 6216ee675..4b699d360 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "focus-trap-react": "^3.1.2", "fuse.js": "^3.4.2", "i18next": "^14.1.1", - "iframe-resizer": "^3.6.2", + "iframe-resizer": "^4.1.1", "js-yaml": "^3.13.1", "nearley": "^2.16.0", "ramda": "^0.25.0", @@ -147,15 +147,15 @@ "ramda-fantasy": "^0.8.0", "raw-loader": "^0.5.1", "react-hot-loader": "^4.11.0", - "serve": "^11.0.0", - "serve-handler": "^5.0.5", + "serve": "^11.1.0", + "serve-handler": "^6.1.1", "sinon": "^4.5.0", "sinon-chai": "^3.0.0", "source-map-support": "^0.5.4", "style-loader": "^0.23.1", "styled-components": "^4.2.0", "url-loader": "^1.0.1", - "webpack": "^4.26.0", + "webpack": "^4.39.3", "webpack-cli": "^3.1.2", "webpack-dev-middleware": "^3.4.0", "webpack-hot-middleware": "^2.24.2", diff --git a/source/sites/mon-entreprise.fr/iframe-integration-script.js b/source/sites/mon-entreprise.fr/iframe-integration-script.js index c47d69511..9ba530daa 100644 --- a/source/sites/mon-entreprise.fr/iframe-integration-script.js +++ b/source/sites/mon-entreprise.fr/iframe-integration-script.js @@ -1,16 +1,20 @@ -import { iframeResizer } from 'iframe-resizer'; -let script = document.getElementById('script-simulateur-embauche'), +import { iframeResizer } from 'iframe-resizer' +let script = + document.getElementById('script-monentreprise') || + document.getElementById('script-simulateur-embauche'), + moduleName = script.dataset.module || 'simulateur-embauche', couleur = script.dataset.couleur, lang = script.dataset.lang, baseUrl = script.dataset.iframeUrl || (lang === 'en' ? process.env.EN_SITE : process.env.FR_SITE).replace( '${path}', - '/iframes/simulateur-embauche' + '/iframes/' + moduleName ), integratorUrl = encodeURIComponent(window.location.href.toString()), src = - baseUrl + (baseUrl.indexOf('?') !== -1 ? '&' : '?') + + baseUrl + + (baseUrl.indexOf('?') !== -1 ? '&' : '?') + `couleur=${couleur}&iframe&integratorUrl=${integratorUrl}&lang=${lang}` const iframe = document.createElement('iframe') diff --git a/source/sites/mon-entreprise.fr/layout/Footer/Integration.css b/source/sites/mon-entreprise.fr/layout/Footer/Integration.css index b86f88457..75b241716 100644 --- a/source/sites/mon-entreprise.fr/layout/Footer/Integration.css +++ b/source/sites/mon-entreprise.fr/layout/Footer/Integration.css @@ -1,41 +1,3 @@ -#integration p { - margin-top: 3em; - vertical-align: top; -} -#integration i { - margin-right: 0.6em; - color: #3c4963; -} -#integration code { - display: inline-block; - font-size: 80%; - width: 90%; - padding: 1em; - background: #f8f8f8; - margin: auto; - margin-bottom: 1em; - overflow: auto; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05), -1px 1px 1px rgba(0, 0, 0, 0.02); -} - -#integration code em { - font-weight: 300; - color: black; -} - -#integration code:before { - content: ''; - position: absolute; - top: 0; - right: 0; - border-width: 0 16px 16px 0; - border-style: solid; - border-color: #e8e8e8 white; -} - -#scriptColor { - color: #2975d1; -} section#integrations a { text-decoration: none; diff --git a/source/sites/mon-entreprise.fr/layout/Footer/Integration.js b/source/sites/mon-entreprise.fr/layout/Footer/Integration.js index b607d8c5a..4511d8e5e 100644 --- a/source/sites/mon-entreprise.fr/layout/Footer/Integration.js +++ b/source/sites/mon-entreprise.fr/layout/Footer/Integration.js @@ -8,6 +8,7 @@ import cciLogo from './images/cci.png' import minTraLogo from './images/min-tra.jpg' import poleEmploiLogo from './images/pole-emploi.png' import './Integration.css' +import { IntegrationCode } from '../../pages/Dev/IntegrationTest' export default function Integration() { const [opened, setOpened] = useState(false) @@ -23,21 +24,7 @@ export default function Integration() {
En ajoutant une ligne à votre page Web :
-
- {'<'}
-
- script
-
- id
-
- ="script-simulateur-embauche" data-couleur="
- #2975D1" src
- ="https://mon-entreprise.fr/simulateur-iframe-integration.js">
- {'<'}
- /
- script
- >
-
+ Vous pouvez{' '} choisir la couleur principale du module pour le diff --git a/source/sites/mon-entreprise.fr/pages/Dev/IntegrationTest.js b/source/sites/mon-entreprise.fr/pages/Dev/IntegrationTest.js index b6353ca54..047463284 100644 --- a/source/sites/mon-entreprise.fr/pages/Dev/IntegrationTest.js +++ b/source/sites/mon-entreprise.fr/pages/Dev/IntegrationTest.js @@ -1,21 +1,118 @@ -import React, { Component } from 'react' -import { withRouter } from 'react-router' +import React, { Suspense } from 'react' +let LazyColorPicker = React.lazy(() => import('./ColorPicker')) -export default withRouter( - class IntegrationTest extends Component { - componentDidMount() { - const script = document.createElement('script') - script.id = 'script-simulateur-embauche' - script.src = window.location.origin + '/simulateur-iframe-integration.js' - script.dataset.couleur = '#005aa1' - this.DOMNode.appendChild(script) - } - render() { - return ( -
+ Les 4 simulateurs mon-entreprise.fr sont disponibles à l'intégration sur + un site tiers. Ils sont hébergés chez nous, et il suffit de placer un + simple bout de code Javascript dans votre code HTML. +
+Choisissez d'abord le module et la couleur qui vous conviennent.
+Code d'intégration
+
+ {'<'}
+
+ script
+
+ id
+
+ ="script-simulateur-embauche"
+ data-module="
+ {module}"data-couleur="
+ {colour}" src
+ ="https://mon-entreprise.fr/simulateur-iframe-integration.js">
+ {'<'}
+ /
+ script
+ >
+
)
diff --git a/source/sites/mon-entreprise.fr/pages/Iframes/index.js b/source/sites/mon-entreprise.fr/pages/Iframes/index.js
index 2c194a5ff..f66b939fa 100644
--- a/source/sites/mon-entreprise.fr/pages/Iframes/index.js
+++ b/source/sites/mon-entreprise.fr/pages/Iframes/index.js
@@ -1,6 +1,9 @@
import { IsEmbeddedContext } from 'Components/utils/embeddedContext'
import React from 'react'
import { Route } from 'react-router'
+import SimulateurAssimiléSalarié from '../SocialSecurity/AssimiléSalarié'
+import SimulateurAutoEntrepreneur from '../SocialSecurity/AutoEntrepreneur'
+import SimulateurIndépendant from '../SocialSecurity/Indépendant'
import IframeFooter from './IframeFooter'
import SimulateurEmbauche from './SimulateurEmbauche'
@@ -12,6 +15,18 @@ export default function Iframes() {
path="/iframes/simulateur-embauche"
component={SimulateurEmbauche}
/>
+