1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-08 22:15:02 +00:00

change le chemin de création depuis 'my-company' vers 'register'

pour éviter de faire doublon avec le titre du site
This commit is contained in:
Johan Girod 2018-07-17 18:20:07 +02:00 committed by Mael
parent b4ee87daac
commit b2e17b748c
9 changed files with 70 additions and 58 deletions

View file

@ -27,7 +27,7 @@ class InFranceRoute extends Component {
<StepsHeader location={location} />
<div className="ui__ container">
{/* <Route path="/règle/:name" component={RulePage} /> */}
<Route path="/my-company" component={CreateMyCompany} />
<Route path="/register" component={CreateMyCompany} />
<Route path="/social-security" component={CostsBenefits} />
<Route path="/hiring-process" component={HiringProcess} />
</div>

View file

@ -27,7 +27,7 @@ const Landing = ({ colours: { colour } }) => (
</ul>
<Link
className="ui__ inverted-button cta"
to="/my-company"
to="/register"
alt="the first step to create a company">
Take the step by step guide
</Link>

View file

@ -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 = ({

View file

@ -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<Props, State> {
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 (
<>
<h1 className="question__title">Find your company</h1>
<p>
<Link to="/my-company">
I don&apos;t have a company yet
</Link>
</p>
<p> Thanks to the SIREN database, the public informations of your company will be automatically available for the next steps.</p>
<h1 className="question__title">Find your company</h1>
<p>
<Link to="/register">I don&apos;t have a company yet</Link>
</p>
<p>
{' '}
Thanks to the SIREN database, the public informations of your company
will be automatically available for the next steps.
</p>
<ReactSelect.Async
valueKey="id"
labelKey="l1_normalisee"
@ -78,17 +76,19 @@ class Search extends React.Component<Props, State> {
loadOptions={this.getOptions}
/>
{!!this.state.input &&
<>
<Company {...this.state.input} />
<button onClick={() => {
this.props.onCompanyDetailsConfirmation(this.state.input);
{!!this.state.input && (
<>
<Company {...this.state.input} />
<button
onClick={() => {
this.props.onCompanyDetailsConfirmation(this.state.input)
goToNextStep(this.props.history)
}} className="ui__ button">
Confirm and simulate hiring costs
</button>
</>
}
}}
className="ui__ button">
Confirm and simulate hiring costs
</button>
</>
)}
</>
)
}
@ -109,7 +109,8 @@ let Company = (data: CompanyType) => {
([key, value]) =>
companyDataSelection[key] != null ? (
<li key={key}>
<strong>{companyDataSelection[key]}</strong><br/>
<strong>{companyDataSelection[key]}</strong>
<br />
{value}
</li>
) : 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);
export default compose(
withRouter,
connect(
null,
{
onCompanyDetailsConfirmation: (details: {
[string]: string
}): SaveExistingCompanyDetailsAction => ({
type: 'SAVE_EXISTING_COMPANY_DETAILS',
details
})
}
)
)(Search)

View file

@ -9,7 +9,7 @@ type Props = {
const CreateMyCompany = ({ match }: Props) => (
<>
<h1 className="question__title">Register a company</h1>
<Link className="ui__ link-button" to="/my-company/find">
<Link className="ui__ link-button" to="/register/find">
My company is already registered with the French Administration
</Link>
<p>

View file

@ -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) => (
<>

View file

@ -14,7 +14,7 @@ type Props = {
}
const StatusButton = ({ status }: { status: LegalStatus }) => (
<Link to={`/my-company/register-${status}`} className="ui__ button">
<Link to={`/register/register-${status}`} className="ui__ button">
Create {status}
</Link>
)

View file

@ -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 = ({

View file

@ -26,7 +26,7 @@ type Props = {
const StepsHeader = ({ companyProgress, estimationProgress }: Props) => (
<header className="ui__ steps-header container">
<nav>
<NavLink to="/my-company" activeClassName="active">
<NavLink to="/register" activeClassName="active">
<img src={companySvg} />
<Progress percent={companyProgress} />
</NavLink>