From cd44b5229a28a4fc4677e0aa0132540fc4f55eda Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Tue, 22 Jan 2019 12:57:23 +0100 Subject: [PATCH] =?UTF-8?q?Redessine=20le=20tag=20beta=20avec=20les=20hypo?= =?UTF-8?q?th=C3=A8ses=20associ=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/actions/companyStatusActions.js | 30 +++++++------ source/components/AlphaWarning.css | 20 +++++++++ source/components/AlphaWarning.js | 20 +++++++++ .../components/conversation/conversation.css | 1 + .../rémunération-dirigeant.yaml | 5 +-- source/components/ui/index.css | 13 ------ source/locales/en.yaml | 8 ++-- source/selectors/companyStatusSelectors.js | 42 ++++++++++++------- .../layout/Navigation/Navigation.js | 14 +++---- .../pages/Company/Home.js | 2 +- .../pages/Company/PreviousAnswers.js | 2 +- .../pages/Company/index.js | 30 ++++++------- .../pages/SocialSecurity/AssimiléSalarié.js | 7 ++-- .../pages/SocialSecurity/Indépendant.js | 7 ++-- .../pages/SocialSecurity/MicroEntreprise.js | 7 ++-- .../pages/SocialSecurity/Salarié.js | 13 +++--- .../pages/SocialSecurity/SchemeComparaison.js | 7 ++-- .../sites/mycompanyinfrance.fr/sitePaths.js | 18 ++++---- 18 files changed, 140 insertions(+), 106 deletions(-) create mode 100644 source/components/AlphaWarning.css create mode 100644 source/components/AlphaWarning.js diff --git a/source/actions/companyStatusActions.js b/source/actions/companyStatusActions.js index 5089517fa..e5e311df2 100644 --- a/source/actions/companyStatusActions.js +++ b/source/actions/companyStatusActions.js @@ -9,11 +9,10 @@ import type { DirectorIsInAMinorityAction, DefineDirectorStatusAction } from 'Types/companyTypes' -import { last } from "ramda"; -import type { RouterHistory } from 'react-router' -import { dropWhile } from "ramda"; +import { dropWhile, last } from 'ramda' import { nextQuestionUrlSelector } from 'Selectors/companyStatusSelectors' -import sitePaths from '../sites/mycompanyinfrance.fr/sitePaths'; +import sitePaths from '../sites/mycompanyinfrance.fr/sitePaths' +import type { RouterHistory } from 'react-router' const thenGoToNextQuestion = actionCreator => (...args: any) => ( dispatch: any => void, @@ -72,12 +71,13 @@ export const goToCompanyStatusChoice = () => ( history.push(sitePaths().entreprise.index) } - export const resetCompanyStatusChoice = (from: string) => ( dispatch: ResetCompanyStatusAction => void, - getState: ()=> any + getState: () => any ) => { - const answeredQuestion = Object.keys(getState().inFranceApp.companyLegalStatus); + const answeredQuestion = Object.keys( + getState().inFranceApp.companyLegalStatus + ) const answersToReset = dropWhile(a => a !== from, answeredQuestion) if (!answersToReset.length) { return @@ -85,24 +85,28 @@ export const resetCompanyStatusChoice = (from: string) => ( dispatch( ({ type: 'RESET_COMPANY_STATUS_CHOICE', - answersToReset, + answersToReset }: ResetCompanyStatusAction) ) } export const goBackToPreviousQuestion = () => ( - dispatch: ResetCompanyStatusAction => void, + dispatch: ResetCompanyStatusAction => void, getState: () => any, history: RouterHistory ) => { - const previousQuestion = last(Object.keys(getState().inFranceApp.companyLegalStatus)); + const previousQuestion = last( + Object.keys(getState().inFranceApp.companyLegalStatus) + ) if (previousQuestion) { dispatch( ({ type: 'RESET_COMPANY_STATUS_CHOICE', - answersToReset: [previousQuestion], + answersToReset: [previousQuestion] }: ResetCompanyStatusAction) ) } - history.push(sitePaths().entreprise.statusJuridique[previousQuestion || 'index']) -} \ No newline at end of file + history.push( + sitePaths().entreprise.statutJuridique[previousQuestion || 'index'] + ) +} diff --git a/source/components/AlphaWarning.css b/source/components/AlphaWarning.css new file mode 100644 index 000000000..a2b621baa --- /dev/null +++ b/source/components/AlphaWarning.css @@ -0,0 +1,20 @@ +.beta__container { + padding-left: 1rem; + border-top-left-radius: 0.3rem; + + border-left: 3px solid #333; +} +.beta__tag { + font-size: 80%; + line-height: 1rem; + padding: 0.4rem 0.8rem; + background: #333; + margin-left: -1rem; + text-transform: uppercase; + color: white; + border-bottom-right-radius: 0.3rem; + border-top-right-radius: 0.3rem; + display: inline-block; + margin-bottom: 0.6rem; + vertical-align: middle; +} diff --git a/source/components/AlphaWarning.js b/source/components/AlphaWarning.js new file mode 100644 index 000000000..b6b55107b --- /dev/null +++ b/source/components/AlphaWarning.js @@ -0,0 +1,20 @@ +import React from 'react' +import './AlphaWarning.css' + +export default function AlphaWarning() { + return ( +
+ Version alpha + +
+ ) +} diff --git a/source/components/conversation/conversation.css b/source/components/conversation/conversation.css index 50665c73f..629d3283a 100644 --- a/source/components/conversation/conversation.css +++ b/source/components/conversation/conversation.css @@ -60,6 +60,7 @@ .step-question h1 { font-size: 1.7rem; + margin-top: 1rem; color: rgba(0, 0, 0, 0.8); } diff --git a/source/components/simulationConfigs/rémunération-dirigeant.yaml b/source/components/simulationConfigs/rémunération-dirigeant.yaml index ad456ff53..231078c8f 100644 --- a/source/components/simulationConfigs/rémunération-dirigeant.yaml +++ b/source/components/simulationConfigs/rémunération-dirigeant.yaml @@ -1,8 +1,5 @@ titre: | - **Calcul du revenu du travailleur indépendant ou dirigeant d'entreprise**, en fonction du régime de protection sociale. - - - Pour les sociétés, nous considérons pour l'instant que tout le chiffre d'affaires part dans les charges et la rémunération du dirigeant : zéro bénéfice en fin d'année. - - L'impôt sur le revenu est calculé pour un célibataire sans enfants et sans autre revenu. + Calcul du revenu du travailleur indépendant ou dirigeant d'entreprise. objectifs: - revenu disponible diff --git a/source/components/ui/index.css b/source/components/ui/index.css index 8704b6a71..74e7f016c 100644 --- a/source/components/ui/index.css +++ b/source/components/ui/index.css @@ -55,7 +55,6 @@ button { .ui__.notice { font-size: 85%; color: rgba(0, 0, 0, 0.6); - margin-top: 2em; } ul.ui__.no-bullet { list-style: none; @@ -73,15 +72,3 @@ span.ui__.enumeration:not(:last-of-type)::after { #lds-ellipsis { display: none; } - -#betaTag { - background: #333; - text-transform: uppercase; - color: white; - font-weight: 500; - border-radius: 1em; - padding: 0.1em 0.5em; - margin: 1rem; - font-size: 1rem; - vertical-align: middle; -} diff --git a/source/locales/en.yaml b/source/locales/en.yaml index 5ffbd6118..93fe9f8d6 100644 --- a/source/locales/en.yaml +++ b/source/locales/en.yaml @@ -123,7 +123,7 @@ Mes réponses: My answers Modifier mes réponses: Change my answers simulation-end: title: No more questions left! - text: You have reached the most accurate estimate. + text: You have reached the most accurate estimate. hiring: text: You can now turn your hiring project into reality. cta: Know the procedures @@ -203,7 +203,7 @@ accueil: 2: Learn the basics of French labour law action: Discover the hiring process › -piedDePage: +piedDePage: entreprise: existeDéjà: My company is already registered with the French Administration @@ -512,12 +512,12 @@ path: créer: '/create-a-{{companyStatus}}' trouver: '/find' après: '/after-registration' - statusJuridique: + statutJuridique: index: '/legal-status' liste: '/list' gérantMinoritaire: '/chairman-or-managing-director' responsabilité: '/liability' - statusDirigeant: '/directors-status' + statutDirigeant: '/directors-status' nombreAssociés: '/multiple-associates' microEntreprise: '/micro-entreprise-or-individual-business' sécuritéSociale: diff --git a/source/selectors/companyStatusSelectors.js b/source/selectors/companyStatusSelectors.js index fb70a0777..b23cebf0b 100644 --- a/source/selectors/companyStatusSelectors.js +++ b/source/selectors/companyStatusSelectors.js @@ -185,35 +185,45 @@ export const nextQuestionUrlSelector = (state: { inFranceApp: State }) => { const paths = sitePaths() const nextQuestion = nextQuestionSelector(state) if (!nextQuestion) { - return paths.entreprise.statusJuridique.liste + return paths.entreprise.statutJuridique.liste } - return paths.entreprise.statusJuridique[nextQuestion] + return paths.entreprise.statutJuridique[nextQuestion] } -export const régimeSelector = (state: { inFranceApp: State }): 'indépendant' | 'assimilé-salarié' | 'micro-entreprise' | null => { +export const régimeSelector = (state: { + inFranceApp: State +}): 'indépendant' | 'assimilé-salarié' | 'micro-entreprise' | null => { const companyStatusChoice = state.inFranceApp.companyStatusChoice const companyLegalStatus = state.inFranceApp.companyLegalStatus if (!companyStatusChoice) { - if(companyLegalStatus.microEnterprise === true) { - return "micro-entreprise" + if (companyLegalStatus.microEnterprise === true) { + return 'micro-entreprise' } if (companyLegalStatus.directorStatus === 'SALARIED') { - return "assimilé-salarié" - } + return 'assimilé-salarié' + } if (companyLegalStatus.directorStatus === 'SELF_EMPLOYED') { - return "indépendant" - } - return null; + return 'indépendant' + } + return null } - if(companyStatusChoice.includes('micro-entreprise')) { - + if (companyStatusChoice.includes('micro-entreprise')) { return 'micro-entreprise' } - if(companyStatusChoice.includes('EI') || companyStatusChoice === 'EURL' || companyStatusChoice === 'SARL' && companyLegalStatus?.minorityDirector === false) { + if ( + companyStatusChoice.includes('EI') || + companyStatusChoice === 'EURL' || + (companyStatusChoice === 'SARL' && + companyLegalStatus?.minorityDirector === false) + ) { return 'indépendant' } - if(companyStatusChoice.includes('SAS') || companyStatusChoice === 'SARL' && companyLegalStatus?.minorityDirector === true) { + if ( + companyStatusChoice.includes('SAS') || + (companyStatusChoice === 'SARL' && + companyLegalStatus?.minorityDirector === true) + ) { return 'assimilé-salarié' } - return null; -} \ No newline at end of file + return null +} diff --git a/source/sites/mycompanyinfrance.fr/layout/Navigation/Navigation.js b/source/sites/mycompanyinfrance.fr/layout/Navigation/Navigation.js index 69ac183f3..41af099d2 100644 --- a/source/sites/mycompanyinfrance.fr/layout/Navigation/Navigation.js +++ b/source/sites/mycompanyinfrance.fr/layout/Navigation/Navigation.js @@ -66,13 +66,13 @@ const StepsHeader = ({