remove header from integrations

pull/746/head
Johan Girod 2019-10-24 14:56:57 +02:00
parent 7c7ae476fc
commit 58e13df9bb
7 changed files with 73 additions and 70 deletions

View File

@ -31,8 +31,9 @@ describe('Simulateurs', function () {
it.only('should allow to change period', function () {
cy.contains('année').click()
cy.wait(200)
cy.get(inputSelector).first().type('{selectall}12000')
cy.wait(500)
cy.wait(600)
cy.contains('mois').click()
cy.get(inputSelector).first().invoke('val').should('match', /1[\s]000/)
})

View File

@ -26,17 +26,17 @@ function Controls({
...controls,
...(inversionFail
? [
{
message: t([
'simulateurs.inversionFail',
'Le montant saisi est trop faible ou aboutit à une situation impossible, essayez en un autre'
]),
level: 'avertissement'
}
]
{
message: t([
'simulateurs.inversionFail',
'Le montant saisi est trop faible ou aboutit à une situation impossible, essayez en un autre'
]),
level: 'avertissement'
}
]
: [])
]
if (!messages?.length) return null
if (!messages ?.length) return null
return (
<div id="controlsBlock">
@ -51,8 +51,8 @@ function Controls({
{message ? (
<Markdown source={message} />
) : (
<span id="controlExplanation">{makeJsx(evaluated)}</span>
)}
<span id="controlExplanation">{makeJsx(evaluated)}</span>
)}
{solution && !foldedSteps.includes(solution.cible) && (
<div>
@ -84,8 +84,8 @@ export default compose(
connect(
(state, props) => ({
foldedSteps: state.conversationSteps.foldedSteps,
controls: analysisWithDefaultsSelector(state)?.controls,
inversionFail: analysisWithDefaultsSelector(state)?.cache?.inversionFail,
controls: analysisWithDefaultsSelector(state) ?.controls,
inversionFail: analysisWithDefaultsSelector(state) ?.cache ?.inversionFail,
key: props.language,
hiddenControls: state.simulation.hiddenControls
}),

View File

@ -67,7 +67,7 @@ blockquote {
flex-wrap: wrap;
}
.ui__ .hide {
.ui__.hide {
display: none;
}
@media (max-width: 850px) {

View File

@ -8,7 +8,7 @@ import Raven from 'raven-js'
import React, { useEffect } from 'react'
import { Helmet } from 'react-helmet'
import { useTranslation } from 'react-i18next'
import { Redirect, Route, Switch } from 'react-router-dom'
import { Route, Switch } from 'react-router-dom'
import 'Ui/index.css'
import Provider from '../../Provider'
import { persistEverything, retrievePersistedState } from '../../storage/persistEverything'
@ -82,7 +82,7 @@ function InFranceRoute({ basename, language }) {
let RouterSwitch = () => {
return (
<>
<Header />
{!inIframe() && <Header />}
<Switch>
<Route exact path="/" component={Landing} />
<Route path="/iframes" component={Iframes} />
@ -103,7 +103,6 @@ const App = compose(withSitePaths)(({ sitePaths }) => {
<div className="ui__ container" style={{ flexGrow: 1, flexShrink: 0 }}>
<Switch>
{redirects}
<Redirect from="/zoub/*" to="/zab/*" />
<Route path={sitePaths.créer.index} component={Créer} />
<Route
path={sitePaths.gérer.index}

View File

@ -1,13 +1,19 @@
import { iframeResizer } from 'iframe-resizer'
import logoEnSvg from 'Images/logo-mycompany.svg'
import logoFrSvg from 'Images/logo.svg'
import marianneSvg from 'Images/marianne.svg'
import urssafSvg from 'Images/urssaf.svg'
let script =
document.getElementById('script-monentreprise') ||
document.getElementById('script-simulateur-embauche'),
document.getElementById('script-monentreprise') ||
document.getElementById('script-simulateur-embauche'),
moduleName = script.dataset.module || 'simulateur-embauche',
couleur = encodeURIComponent(script.dataset.couleur),
lang = script.dataset.lang,
lang = script.dataset.lang || 'fr',
fr = lang === 'fr',
baseUrl =
script.dataset.iframeUrl ||
(lang === 'en' ? process.env.EN_SITE : process.env.FR_SITE).replace(
(fr ? process.env.FR_SITE : process.env.EN_SITE).replace(
'${path}',
'/iframes/' + moduleName
),
@ -38,4 +44,41 @@ iframeResizer(
},
iframe
)
const links = document.createElement('div')
const moduleToSitePath = {
'simulateur-embauche': '/simulateurs/salarié',
'simulateur-autoentrepreneur': '/simulateurs/auto-entrepreneur',
'simulateur-independant': '/simulateurs/indépendant',
'simulateur-assimilesalarie': '/simulateurs/assimilé-salarié',
}
const simulateurLink = (fr ? process.env.FR_SITE : process.env.EN_SITE).replace('${path}', moduleToSitePath[moduleName])
links.innerHTML = `
<div style="text-align: center; margin-bottom: 2rem">
<a href="${simulateurLink}" target="_blank">
<img
style="height: 2.5rem; margin-right: 1rem"
src="${process.env.FR_SITE.replace('${path}', '/' + (lang === 'fr' ? logoFrSvg : logoEnSvg))}"
alt="mon-entreprise.fr : l'assistant officiel du créateur d'entreprise"
/>
</a>
<a href="https://www.urssaf.fr" target="_blank">
<img
style="height: 2.5rem; margin-right: 1rem"
src="${process.env.FR_SITE.replace('${path}', '/' + urssafSvg)}"
alt="un service fourni par l'Urssaf"
/>
</a>
<a href="https://beta.gouv.fr" target="_blank">
<img
style="height: 2.5rem"
src="${process.env.FR_SITE.replace('${path}', '/' + marianneSvg)}"
alt="incubé par beta.gouv.fr (direction du numérique)"
/>
</a>
</div>
`
script.parentNode.insertBefore(iframe, script)
script.parentNode.insertBefore(links, script)

View File

@ -1,7 +1,5 @@
import LangSwitcher from 'Components/LangSwitcher'
import NewsletterRegister from 'Components/NewsletterRegister'
import marianneSvg from 'Images/marianne.svg'
import urssafSvg from 'Images/urssaf.svg'
import React, { useEffect, useState } from 'react'
import emoji from 'react-easy-emoji'
import { Trans } from 'react-i18next'
@ -9,6 +7,7 @@ import screenfull from 'screenfull'
import { isIE } from '../../../../utils'
import Privacy from '../../layout/Footer/Privacy'
export default function IframeFooter() {
const [isFullscreen, setIsFullscreen] = useState(screenfull.isFullscreen)
useEffect(() => {
@ -19,26 +18,6 @@ export default function IframeFooter() {
return (
<>
<NewsletterRegister />
<div
style={{
textAlign: 'center',
margin: '2rem 0'
}}>
<a href="https://www.urssaf.fr" target="_blank">
<img
style={{ height: '2.5rem', marginRight: '1rem' }}
src={urssafSvg}
alt="un service fourni par l'Urssaf"
/>
</a>
<a href="https://beta.gouv.fr" target="_blank">
<img
style={{ height: '2.5rem' }}
src={marianneSvg}
alt="un service de lEtat français incubé par beta.gouv.fr"
/>
</a>
</div>
<div
className="ui__ container"
style={{

View File

@ -1,35 +1,16 @@
import Banner from 'Components/Banner'
import withSitePaths from 'Components/utils/withSitePaths'
import { compose } from 'ramda'
import React from 'react'
import { Helmet } from 'react-helmet'
import { connect } from 'react-redux'
import { SalarySimulation } from '../Simulateurs/Salarié'
import { SitePathsContext } from 'Components/utils/withSitePaths';
import React, { useContext } from 'react';
import { Helmet } from 'react-helmet';
import { SalarySimulation } from '../Simulateurs/Salarié';
export default compose(
withSitePaths,
connect(state => ({
showMonEntrepriseLink: !state.conversationSteps.foldedSteps.length
}))
)(function IframeSimulateurEmbauche({ showMonEntrepriseLink, sitePaths }) {
export default function IframeSimulateurEmbauche() {
const sitePaths = useContext(SitePathsContext);
return (
<>
<Helmet>
<link rel="canonical" href={sitePaths.simulateurs.salarié} />
</Helmet>
{showMonEntrepriseLink && (
<Banner icon="✨">
Dirigeants de société, travailleurs indépendants, ou
auto-entrepreneurs : calculez vos revenus à l'euro près avec les
nouveaux simulateurs officiels sur{' '}
<strong>
<a target="_parent" href="https://mon-entreprise.fr">
mon-entreprise.fr
</a>
</strong>
</Banner>
)}
<SalarySimulation />
</>
)
})
}