diff --git a/circle.yml b/circle.yml index 012c33ac7..a9ab5e674 100644 --- a/circle.yml +++ b/circle.yml @@ -21,7 +21,7 @@ commands: default: fr integration_folder: type: enum - enum: [mon-entreprise, external, embauche] + enum: [mon-entreprise, external] default: mon-entreprise base_url: type: string @@ -56,9 +56,6 @@ jobs: - cypress: base_url: http://localhost:5001 language: en - - cypress: - base_url: http://localhost:5002 - integration_folder: embauche production-end-to-end-test: docker: @@ -75,9 +72,6 @@ jobs: - cypress: base_url: https://mycompanyinfrance.fr language: en - - cypress: - base_url: https://embauche.beta.gouv.fr - integration_folder: embauche - cypress: integration_folder: external - run: diff --git a/cypress/integration/embauche/embauche.js b/cypress/integration/embauche/embauche.js deleted file mode 100644 index 4fca964c6..000000000 --- a/cypress/integration/embauche/embauche.js +++ /dev/null @@ -1,44 +0,0 @@ -const salaryInput = inputTitle => { - const inputContainer = cy - .contains(inputTitle) - .closest('.main') - .find('.targetInputOrValue') - inputContainer.click() - return inputContainer.find('input') -} - -describe('Landing basic test', function() { - it('should display the simulateur after loading', function() { - cy.visit('/') - cy.contains('Versé sur son compte bancaire') - }) - it('should display cotisation repartition when entering net salary', function() { - cy.visit('/') - salaryInput('Salaire net').type('2000') - cy.get('.distribution-chart__container') - }) - it('should allow to navigate to a documentation page', function() { - cy.visit('/') - salaryInput('Salaire net').type('2000') - cy.contains('Total chargé').click() - cy.contains( - `C'est le total que l'employeur doit verser pour employer un salarié` - ) - }) -}) - -describe('Simulation saving test', function() { - it('should save the current simulation', function() { - cy.visit('/') - salaryInput('Salaire net').type('5471') - cy.wait(1000) - cy.contains('CDD').click() - cy.contains('passer').click() - cy.contains('passer').click() - // Wanted to use cypress.clock(), but can't because of piwik changing Date prototype (!) - cy.wait(1100) - cy.visit('/') - cy.contains('Retrouver ma simulation').click() - salaryInput('Salaire net').should('have.value', '5471') - }) -}) diff --git a/cypress/integration/embauche/iframe.js b/cypress/integration/mon-entreprise/iframe.js similarity index 85% rename from cypress/integration/embauche/iframe.js rename to cypress/integration/mon-entreprise/iframe.js index 6e795688d..d434096fb 100644 --- a/cypress/integration/embauche/iframe.js +++ b/cypress/integration/mon-entreprise/iframe.js @@ -1,6 +1,6 @@ describe('Iframe integration test', function() { it('should display an iframe of the simulateur', function() { - cy.visit('/integration-test') + cy.visit('/dev/integration-test') cy.get('#simulateurEmbauche') .iframe() .contains('Versé sur son compte bancaire') diff --git a/cypress/integration/mon-entreprise/simulateur-salarié.js b/cypress/integration/mon-entreprise/simulateur-salarié.js new file mode 100644 index 000000000..001b90ad2 --- /dev/null +++ b/cypress/integration/mon-entreprise/simulateur-salarié.js @@ -0,0 +1,46 @@ +const salaryInput = inputTitle => { + const inputContainer = cy + .contains(inputTitle) + .closest('.main') + .find('.targetInputOrValue') + inputContainer.click() + return inputContainer.find('input') +} + +const fr = Cypress.env('language') === 'fr' +if (fr) { + beforeEach(() => { + cy.visit('/sécurité-sociale/salarié') + }) + describe('Basic test', function() { + it('should display the simulateur after loading', function() { + cy.contains('Versé sur son compte bancaire') + }) + it('should display cotisation repartition when entering net salary', function() { + salaryInput('Salaire net').type('2000') + cy.get('.distribution-chart__container') + }) + it('should allow to navigate to a documentation page', function() { + salaryInput('Salaire net').type('2000') + cy.contains('Total chargé').click() + cy.contains( + `C'est le total que l'employeur doit verser pour employer un salarié` + ) + }) + }) + + describe('Simulation saving test', function() { + it('should save the current simulation', function() { + salaryInput('Salaire net').type('5471') + cy.wait(1000) + cy.contains('CDD').click() + cy.contains('passer').click() + cy.contains('passer').click() + // Wanted to use cypress.clock(), but can't because of piwik changing Date prototype (!) + cy.wait(1100) + cy.visit('/sécurité-sociale/salarié') + cy.contains('Retrouver ma simulation').click() + salaryInput('Salaire net').should('have.value', '5471') + }) + }) +} diff --git a/cypress/integration/mon-entreprise/status.js b/cypress/integration/mon-entreprise/status.js index 16740374c..2baa35893 100644 --- a/cypress/integration/mon-entreprise/status.js +++ b/cypress/integration/mon-entreprise/status.js @@ -32,7 +32,7 @@ describe('Status guide', function() { .contains(fr ? 'Société' : 'Limited liability company') .click() cy.get('.ui__.answer-group') - .contains(fr ? 'Assimilé salarié' : 'Salaried') + .contains(fr ? 'Assimilé salarié' : 'Assimilated salaried') .click() cy.contains(fr ? 'Créer une SASU' : 'Create a SASU').click() }) diff --git a/example-integration.html b/example-integration.html deleted file mode 100644 index 217007d9b..000000000 --- a/example-integration.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - Intégrateur numéro 10 - - - - -
-

Ma page Web

-

Calculez votre salaire !

-

Ce simulateur calcule vos cotisations sociales pour vous permettre de jongler entre les différents types de salaire en France.

-
-
- -
- - diff --git a/netlify.toml b/netlify.toml index 1e7ffd119..ef94b071c 100644 --- a/netlify.toml +++ b/netlify.toml @@ -17,14 +17,20 @@ from = "https://mycompanyinfrance.fr/sitemap.txt" to = "/sitemap.infrance.en.txt" status = 200 +## Redirection pour les pages prérendues [[redirects]] from = "https://mycompanyinfrance.fr" to = "/prerender/infrance/index.html" status = 200 [[redirects]] -from = "https://mycompanyinfrance.fr/social-security" -to = "/prerender/infrance/social-security/index.html" +from = "https://mycompanyinfrance.fr/social-security/salaried" +to = "/prerender/infrance/social-security/salaried/index.html" +status = 200 + +[[redirects]] +from = "https://mycompanyinfrance.fr/iframes/simulateur-embauche" +to = "/prerender/infrance/iframes/simulateur-embauche/index.html" status = 200 [[redirects]] @@ -49,62 +55,53 @@ from = "https://mon-entreprise.fr/sitemap.txt" to = "/sitemap.infrance.fr.txt" status = 200 + +## Redirection pour les pages prérendues [[redirects]] from = "https://mon-entreprise.fr" to = "/prerender/mon-entreprise/index.html" status = 200 +[[redirects]] +from = "https://mon-entreprise.fr/sécurité-sociale/salarié" +to = "/prerender/mon-entreprise/sécurité-sociale/salarié/index.html" +status = 200 + +[[redirects]] +from = "https://mon-entreprise.fr/iframes/simulateur-embauche" +to = "/prerender/mon-entreprise/iframes/simulateur-embauche/index.html" +status = 200 + [[redirects]] from = "https://mon-entreprise.fr/*" to = "/mon-entreprise.html" status = 200 -# Embauche PRODUCTION settings -[[redirects]] -from = "https://embauche.beta.gouv.fr/stats" -to = "https://rough-college.glitch.me/" -status = 200 +# Embauche redirection settings -[[redirects]] -from = "https://embauche.beta.gouv.fr/modules/v2/*" -to = "/:splat" - -[[redirects]] -from = "https://embauche.beta.gouv.fr/robots.txt" -to = "/robots.embauche.txt" -status = 200 - -# When in iframe, we don't prerender the page [[redirects]] from = "https://embauche.beta.gouv.fr/" -query = {iframe=":iframe", s=":e", couleur=":couleur", integratorUrl=":integratorUrl", lang=":lang"} -to = "/embauche.html?iframe=:iframe&s=:e&couleur=:couleur&integratorUrl=:integratorUrl&lang=:lang" -status = 200 - -# Otherwise, we redirect to a prerendered version for the home -[[redirects]] -from = "https://embauche.beta.gouv.fr/" -to = "/prerender/embauche/index.html" -status = 200 +to = "https://mon-entreprise.fr/sécurité-sociale/salarié" +status = 301 [[redirects]] -from = "https://embauche.beta.gouv.fr/*" -to = "/embauche.html" -status = 200 +from = "https://embauche.beta.gouv.fr/documentation/*" +to = "https://mon-entreprise.fr/documentation/:splat" +status = 301 -# Redirect for embauche in staging and development settings +## Old iframe adresse [[redirects]] -from = "/" -query = {s = "e"} -to = "/prerender/embauche/index.html" -status = 200 +from = "https://embauche.beta.gouv.fr/modules/v2/dist/simulateur.js" +to = "https://mon-entreprise.fr/simulateur-iframe-integration-script.js" +status = 301 [[redirects]] -from = "/*" -query = {s = "e"} -to = "/embauche.html" -status = 200 +from = "https://embauche.beta.gouv.fr/dist/simulateur.js" +to = "https://mon-entreprise.fr/simulateur-iframe-integration-script.js" +status = 301 + + # Redirect to mycompanyinfrance in staging and development settings [[redirects]] @@ -125,6 +122,17 @@ status = 200 from = "/" to = "/prerender/mon-entreprise/index.html" status = 200 + +[[redirects]] +from = "/sécurité-sociale/salarié" +to = "/prerender/mon-entreprise/sécurité-sociale/salarié/index.html" +status = 200 + +[[redirects]] +from = "/iframes/simulateur-embauche" +to = "/prerender/mon-entreprise/iframes/simulateur-embauche/index.html" +status = 200 + [[redirects]] from = "/*" to = "/mon-entreprise.html" @@ -140,6 +148,11 @@ status = 200 FR_SITE = "https://mon-entreprise.fr${path}" MASTER = 'true' -[context."demo"] +[context."demo".environment] EN_SITE = "https://demo.mon-entreprise.fr${path}?s=m" FR_SITE = "https://demo.mon-entreprise.fr${path}" + +# TEMP Just for testing the iframe when migrating from embauche to mon-entreprise +[context."migration-embauche".environment] + EN_SITE = "https://deploy-preview-520--syso.netlify.com${path}?s=m" + FR_SITE = "https://deploy-preview-520--syso.netlify.com${path}" \ No newline at end of file diff --git a/package.json b/package.json index eba151a07..c648a51e2 100644 --- a/package.json +++ b/package.json @@ -82,13 +82,11 @@ "test-expressions": "yarn test-common --grep 'Suite expressions'", "compile-lib": "yarn webpack --config source/webpack.lib.js", "compile-dev": "FR_SITE='http://localhost:5000${path}' EN_SITE='http://localhost:5001${path}' yarn run compile", - "mon-entreprise:serve": "PORT=5000 serve --config serve.mon-entreprise.json", + "mon-entreprise:serve": "PORT=5000 serve --config serve.mon-entreprise.json --no-clipboard", "mon-entreprise:test": "cypress open", - "mycompanyinfrance:serve": "PORT=5001 serve --config serve.infrance.json", + "mycompanyinfrance:serve": "PORT=5001 serve --config serve.infrance.json --no-clipboard", "mycompanyinfrance:test": "cypress open --env language=en --config baseUrl=http://localhost:8080/infrance", - "embauche:serve": "cp dist/embauche.html dist/index.html && PORT=5002 serve -s dist", - "embauche:test": "cypress open --config baseUrl=http://localhost:8080/embauche,integrationFolder=cypress/integration/embauche", - "serve-dev": "yarn run mon-entreprise:serve & yarn run mycompanyinfrance:serve & yarn run embauche:serve" + "serve-dev": "yarn run mon-entreprise:serve & yarn run mycompanyinfrance:serve" }, "devDependencies": { "@babel/core": "^7.1.0", @@ -144,7 +142,7 @@ "ramda-fantasy": "^0.8.0", "raw-loader": "^0.5.1", "react-hot-loader": "^4.7.1", - "serve": "^10.0.2", + "serve": "^11.0.0", "serve-handler": "^5.0.5", "sinon": "^4.5.0", "sinon-chai": "^3.0.0", diff --git a/source/components/AnswerList.js b/source/components/AnswerList.js index 9d3d81330..5241a2758 100644 --- a/source/components/AnswerList.js +++ b/source/components/AnswerList.js @@ -49,12 +49,12 @@ const AnswerList = ({

{emoji('🗑')}{' '}

diff --git a/source/components/Banner.css b/source/components/Banner.css index c55b1878e..59007bf86 100644 --- a/source/components/Banner.css +++ b/source/components/Banner.css @@ -1,30 +1,15 @@ -.banner { +.ui__.banner { display: flex; align-items: center; - margin: 0 auto; + margin: 1rem auto; max-width: 100%; - margin-top: 1em; - width: 40em; + color: var(--lighterInverseTextColour); + width: 45rem; justify-content: center; - animation: fade-in 1s; -} -.banner p { - text-align: center; - color: #4b4b66; } -.banner i { - margin-right: 1em; -} - -@keyframes fade-in { - from { - opacity: 0; - } - 50% { - opacity: 0; - } - to { - opacity: 1; - } +.ui__.banner img { + margin-right: 1rem !important; + font-size: 2rem; + margin-bottom: 0.6rem !important; } diff --git a/source/components/Banner.js b/source/components/Banner.js index 587dafd67..d3f7c9ab6 100644 --- a/source/components/Banner.js +++ b/source/components/Banner.js @@ -1,21 +1,26 @@ /* @flow */ import React from 'react' +import emoji from 'react-easy-emoji' import { connect } from 'react-redux' +import Animate from 'Ui/animate' import './Banner.css' import type { Node } from 'react' import type { State } from 'Types/State' - type PropTypes = { hidden: boolean, - children: Node + children: Node, + icon?: String } -let Banner = ({ hidden = false, children }: PropTypes) => +let Banner = ({ hidden = false, children, icon }: PropTypes) => !hidden ? ( -
-

{children}

-
+ +
+ {icon && emoji(icon)} +

{children}

+
+
) : null export default (connect( diff --git a/source/components/Controls.js b/source/components/Controls.js index 3c2a75f90..4f1247f61 100644 --- a/source/components/Controls.js +++ b/source/components/Controls.js @@ -40,35 +40,37 @@ function Controls({ diff --git a/source/components/Feedback/Feedback.css b/source/components/Feedback/Feedback.css index e379e7d8c..27ec52a9f 100644 --- a/source/components/Feedback/Feedback.css +++ b/source/components/Feedback/Feedback.css @@ -1,11 +1,13 @@ .feedback-page { display: flex; - justify-content: flex-end; + justify-content: center; + flex-wrap: wrap; padding-top: 0.6rem; padding-bottom: 0.6rem; background: var(--lighterColour); border-radius: 0.9rem; - padding: 0.6em 1em; + padding: 0.6rem 1rem; + margin: 1rem 0; } .feedback-page.stickToFooter { margin-bottom: 0; @@ -13,7 +15,7 @@ border-bottom-right-radius: 0; } .feedback-page button.link-button { - margin: 0 0.6em; + margin: 0 0.6rem; } @media (min-width: 1200px) { diff --git a/source/components/Feedback/PageFeedback.js b/source/components/Feedback/PageFeedback.js index ed26919bc..29f7ee76e 100644 --- a/source/components/Feedback/PageFeedback.js +++ b/source/components/Feedback/PageFeedback.js @@ -1,5 +1,6 @@ /* @flow */ +import classNames from 'classnames' import withTracker from 'Components/utils/withTracker' import React, { Component } from 'react' import { Trans, withTranslation } from 'react-i18next' @@ -11,7 +12,6 @@ import Form from './FeedbackForm' import type { Tracker } from 'Components/utils/withTracker' import type { Location } from 'react-router-dom' import type { Node } from 'react' -import classNames from 'classnames' type OwnProps = { blacklist: Array, @@ -25,6 +25,7 @@ type Props = OwnProps & { } type State = { showForm: boolean, + feedbackAlreadyGiven: boolean, showThanks: boolean } @@ -54,12 +55,12 @@ class PageFeedback extends Component { super(props) this.state = { showForm: false, - showThanks: false + showThanks: false, + feedbackAlreadyGiven: feedbackAlreadyGiven([ + this.props.customEventName || 'rate page usefulness', + this.props.location.pathname + ]) } - this.feedbackAlreadyGiven = feedbackAlreadyGiven([ - this.props.customEventName || 'rate page usefulness', - this.props.location.pathname - ]) } handleFeedback = ({ useful }) => { @@ -78,6 +79,7 @@ class PageFeedback extends Component { saveFeedbackOccurrenceInLocalStorage(feedback) this.setState({ showThanks: useful, + feedbackAlreadyGiven: true, showForm: !useful }) } @@ -92,7 +94,11 @@ class PageFeedback extends Component { } render() { let { stickToFooter = false } = this.props - if (this.feedbackAlreadyGiven) { + if ( + this.state.feedbackAlreadyGiven && + !this.state.showForm && + !this.state.showThanks + ) { return null } const pathname = @@ -106,31 +112,31 @@ class PageFeedback extends Component { })}> {!this.state.showForm && !this.state.showThanks && ( <> -
+
{this.props.customMessage || ( Cette page vous est utile ? )}{' '} -
- {' '} - - -
+
+
+ {' '} + +
)} @@ -139,8 +145,8 @@ class PageFeedback extends Component { Merci pour votre retour ! Vous pouvez nous contacter directement à{' '} - - contact@embauche.beta.gouv.fr + + contact@mon-entreprise.beta.gouv.fr
@@ -148,7 +154,7 @@ class PageFeedback extends Component { {this.state.showForm && (
- this.setState({ showThanks: false, showForm: false }) + this.setState({ showThanks: true, showForm: false }) } onCancel={() => this.setState({ showThanks: false, showForm: false }) diff --git a/source/components/LegalNotice.js b/source/components/LegalNotice.js index b4b11ce71..d84ae003b 100644 --- a/source/components/LegalNotice.js +++ b/source/components/LegalNotice.js @@ -52,8 +52,8 @@ export const LegalNoticeContent = withTranslation()(() => (

- - contact@embauche.beta.gouv.fr + + contact@mon-entreprise.beta.gouv.fr

diff --git a/source/components/PrivacyContent.js b/source/components/PrivacyContent.js deleted file mode 100644 index 82ddd87a7..000000000 --- a/source/components/PrivacyContent.js +++ /dev/null @@ -1,37 +0,0 @@ -import { T } from 'Components' -import withLanguage from 'Components/utils/withLanguage' -import React from 'react' - -const PrivacyContent = ({ language }) => ( - <> - -

Vie privée

-

- Nous ne stockons aucune donnée personnelle sur nos serveurs. Toutes les - informations que vous fournissez (salaires, code postal de l'entreprise, - SIREN etc.) sont sauvegardées uniquement sur votre navigateur. Personne - d'autre que vous ne peut y avoir accès. -

-

- Toutefois, nous recueillons des statistiques anonymes sur l'utilisation - du site, que nous utilisons dans le seul but d'améliorer le service, - conformément aux{' '} - - recommandations de la CNIL - {' '} - et à la directive RGPD. -

-

Vous pouvez vous en soustraire ci-dessous.

-
-