From b2e17b748c844aae2e4c0b1a21c5d9fa86b1254a Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Tue, 17 Jul 2018 18:20:07 +0200 Subject: [PATCH] =?UTF-8?q?change=20le=20chemin=20de=20cr=C3=A9ation=20dep?= =?UTF-8?q?uis=20'my-company'=20vers=20'register'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pour éviter de faire doublon avec le titre du site --- source/sites/mycompanyinfrance.fr/App.js | 2 +- source/sites/mycompanyinfrance.fr/Landing.js | 2 +- .../pages/Company/DirectorStatus.js | 2 +- .../pages/Company/Find.js | 110 ++++++++++-------- .../pages/Company/Home.js | 2 +- .../pages/Company/LegalSetup.js | 2 +- .../pages/Company/MainStatus.js | 2 +- .../pages/Company/NumberOfAssociate.js | 4 +- .../pages/Header/StepsHeader.js | 2 +- 9 files changed, 70 insertions(+), 58 deletions(-) diff --git a/source/sites/mycompanyinfrance.fr/App.js b/source/sites/mycompanyinfrance.fr/App.js index adb47a10f..af2b6d1a1 100644 --- a/source/sites/mycompanyinfrance.fr/App.js +++ b/source/sites/mycompanyinfrance.fr/App.js @@ -27,7 +27,7 @@ class InFranceRoute extends Component {
{/* */} - +
diff --git a/source/sites/mycompanyinfrance.fr/Landing.js b/source/sites/mycompanyinfrance.fr/Landing.js index 6ee6329b1..462d410aa 100644 --- a/source/sites/mycompanyinfrance.fr/Landing.js +++ b/source/sites/mycompanyinfrance.fr/Landing.js @@ -27,7 +27,7 @@ const Landing = ({ colours: { colour } }) => ( Take the step by step guide diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/DirectorStatus.js b/source/sites/mycompanyinfrance.fr/pages/Company/DirectorStatus.js index 234222548..4af403b07 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/DirectorStatus.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/DirectorStatus.js @@ -14,7 +14,7 @@ type Props = { } const goToNextStep = (history: RouterHistory) => { - history.push('/my-company/set-legal-status') + history.push('/register/set-legal-status') } const DefineDirectorStatus = ({ diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/Find.js b/source/sites/mycompanyinfrance.fr/pages/Company/Find.js index 9d386ecd5..9d5d83287 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/Find.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/Find.js @@ -1,68 +1,66 @@ /* @flow */ +import { compose, toPairs } from 'ramda' import React from 'react' +import { connect } from 'react-redux' +import { Link, withRouter } from 'react-router-dom' // $FlowFixMe import ReactSelect from 'react-select' // $FlowFixMe import 'react-select/dist/react-select.css' import './Find.css' -import { Link, withRouter } from 'react-router-dom' -import { toPairs } from 'ramda' -import { connect } from 'react-redux' -import { compose }from 'ramda'; -import type { RouterHistory } from 'react-router' -import type { SaveExistingCompanyDetailsAction } from 'Types/companyStatusTypes' - +import type { RouterHistory } from 'react-router' +import type { SaveExistingCompanyDetailsAction } from 'Types/companyStatusTypes' const goToNextStep = (history: RouterHistory) => { history.push('/social-security') } -type CompanyType = {[string]: string}; +type CompanyType = { [string]: string } type State = { - input: ?Company, + input: ?Company } type Props = { // $FlowFixMe - onCompanyDetailsConfirmation: {[string]: string} => void, - history: RouterHistory, + onCompanyDetailsConfirmation: ({ [string]: string }) => void, + history: RouterHistory } class Search extends React.Component { state = { - input: null, - + input: null } handleChange = input => { this.setState({ input }) } getOptions = (input: string) => - fetch(`https://sirene.entreprise.api.gouv.fr/v1/full_text/${input}`) - .then(response => { - if (!response.ok) console.log('not ok') - return response.json() - }) - .then(json => ({ options: json.etablissement })) - .catch(function(error) { - console.log( - 'Erreur dans la recherche de communes à partir du code postal', - error - ) // eslint-disable-line no-console - }) - + fetch(`https://sirene.entreprise.api.gouv.fr/v1/full_text/${input}`) + .then(response => { + if (!response.ok) console.log('not ok') + return response.json() + }) + .then(json => ({ options: json.etablissement })) + .catch(function(error) { + console.log( + 'Erreur dans la recherche de communes à partir du code postal', + error + ) // eslint-disable-line no-console + }) + render() { - return ( <> -

Find your company

-

- - I don't have a company yet - -

-

Thanks to the SIREN database, the public informations of your company will be automatically available for the next steps.

- +

Find your company

+

+ I don't have a company yet +

+

+ {' '} + Thanks to the SIREN database, the public informations of your company + will be automatically available for the next steps. +

+ { loadOptions={this.getOptions} /> - {!!this.state.input && - <> - - - - } + }} + className="ui__ button"> + Confirm and simulate hiring costs + + + )} ) } @@ -109,7 +109,8 @@ let Company = (data: CompanyType) => { ([key, value]) => companyDataSelection[key] != null ? (
  • - {companyDataSelection[key]}
    + {companyDataSelection[key]} +
    {value}
  • ) : null @@ -118,6 +119,17 @@ let Company = (data: CompanyType) => { ) } -export default compose(withRouter,connect(null, { - onCompanyDetailsConfirmation: (details: {[string]: string}): SaveExistingCompanyDetailsAction => ({ type: 'SAVE_EXISTING_COMPANY_DETAILS', details }) -}))(Search); \ No newline at end of file +export default compose( + withRouter, + connect( + null, + { + onCompanyDetailsConfirmation: (details: { + [string]: string + }): SaveExistingCompanyDetailsAction => ({ + type: 'SAVE_EXISTING_COMPANY_DETAILS', + details + }) + } + ) +)(Search) diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/Home.js b/source/sites/mycompanyinfrance.fr/pages/Company/Home.js index 51b5e8f0d..080024258 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/Home.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/Home.js @@ -9,7 +9,7 @@ type Props = { const CreateMyCompany = ({ match }: Props) => ( <>

    Register a company

    - + My company is already registered with the French Administration

    diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/LegalSetup.js b/source/sites/mycompanyinfrance.fr/pages/Company/LegalSetup.js index d8a39edd1..58a4ba06d 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/LegalSetup.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/LegalSetup.js @@ -13,7 +13,7 @@ type Props = { } const goToNextStep = (history: RouterHistory) => { - history.push('/my-company/number-of-associate') + history.push('/register/number-of-associate') } const LegalSetup = ({ chooseCompanyLegalSetup, history }: Props) => ( <> diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/MainStatus.js b/source/sites/mycompanyinfrance.fr/pages/Company/MainStatus.js index 9dcdb26ed..ca3354dcd 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/MainStatus.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/MainStatus.js @@ -14,7 +14,7 @@ type Props = { } const StatusButton = ({ status }: { status: LegalStatus }) => ( - + Create {status} ) diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/NumberOfAssociate.js b/source/sites/mycompanyinfrance.fr/pages/Company/NumberOfAssociate.js index c79c06ebb..21b52ab25 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Company/NumberOfAssociate.js +++ b/source/sites/mycompanyinfrance.fr/pages/Company/NumberOfAssociate.js @@ -1,7 +1,7 @@ /* @flow */ +import { companyHaveMultipleAssociate } from 'Actions/companyStatusActions' import React from 'react' import { connect } from 'react-redux' -import { companyHaveMultipleAssociate } from 'Actions/companyStatusActions' import { SkipButton } from 'Ui/Button' import type { RouterHistory } from 'react-router' @@ -11,7 +11,7 @@ type Props = { } const goToNextStep = (history: RouterHistory) => { - history.push('/my-company/define-director-status') + history.push('/register/define-director-status') } const NumberOfAssociate = ({ diff --git a/source/sites/mycompanyinfrance.fr/pages/Header/StepsHeader.js b/source/sites/mycompanyinfrance.fr/pages/Header/StepsHeader.js index 3315f2053..ef1b0dc97 100644 --- a/source/sites/mycompanyinfrance.fr/pages/Header/StepsHeader.js +++ b/source/sites/mycompanyinfrance.fr/pages/Header/StepsHeader.js @@ -26,7 +26,7 @@ type Props = { const StepsHeader = ({ companyProgress, estimationProgress }: Props) => (