Merge pull request #454 from betagouv/demo

Demo
pull/458/head
Johan Girod 2019-02-06 14:42:15 +01:00 committed by GitHub
commit 85843bb70d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 68 additions and 56 deletions

View File

@ -363,8 +363,8 @@ associés:
Note: this choice is not final. You can start your company on your own,
and welcome new partners as your business grows.
</1>
choix1: Only one partner
choix2: More than one partner
choix1: Alone
choix2: Several partners
trouver:
page:
@ -581,3 +581,4 @@ prochainement: soon
Estimer les cotisations sociales pour une embauche: Estimate the social security contributions for a hiring
À quoi servent mes cotisations ?: How are my contributions distributed?
Accueil: Home

View File

@ -1,29 +1,29 @@
import RulePage from 'Components/RulePage';
import TrackPageView from 'Components/utils/TrackPageView';
import withSitePaths from 'Components/utils/withSitePaths';
import { defaultTracker } from 'Components/utils/withTracker';
import { compose } from 'ramda';
import createRavenMiddleware from 'raven-for-redux';
import Raven from 'raven-js';
import React, { Component } from 'react';
import Helmet from 'react-helmet';
import { withNamespaces } from 'react-i18next';
import { Route, Switch } from 'react-router-dom';
import 'Ui/index.css';
import Provider from '../../Provider';
import { persistEverything, retrievePersistedState } from '../../storage/persistEverything';
import ReactPiwik from '../../Tracker';
import './App.css';
import Footer from './layout/Footer/Footer';
import Navigation from './layout/Navigation/Navigation';
import ProgressHeader from './layout/ProgressHeader/ProgressHeader';
import trackSimulatorActions from './middlewares/trackSimulatorActions';
import CompanyIndex from './pages/Company';
import HiringProcess from './pages/HiringProcess';
import Landing from './pages/Landing';
import Sitemap from './pages/Sitemap';
import SocialSecurity from './pages/SocialSecurity';
import sitePaths from './sitePaths';
import RulePage from 'Components/RulePage'
import TrackPageView from 'Components/utils/TrackPageView'
import withSitePaths from 'Components/utils/withSitePaths'
import { defaultTracker } from 'Components/utils/withTracker'
import { compose } from 'ramda'
import createRavenMiddleware from 'raven-for-redux'
import Raven from 'raven-js'
import React, { Component } from 'react'
import Helmet from 'react-helmet'
import { withNamespaces } from 'react-i18next'
import { Route, Switch } from 'react-router-dom'
import 'Ui/index.css'
import Provider from '../../Provider'
import { persistEverything } from '../../storage/persistEverything'
import ReactPiwik from '../../Tracker'
import './App.css'
import Footer from './layout/Footer/Footer'
import Navigation from './layout/Navigation/Navigation'
import ProgressHeader from './layout/ProgressHeader/ProgressHeader'
import trackSimulatorActions from './middlewares/trackSimulatorActions'
import CompanyIndex from './pages/Company'
import HiringProcess from './pages/HiringProcess'
import Landing from './pages/Landing'
import Sitemap from './pages/Sitemap'
import SocialSecurity from './pages/SocialSecurity'
import sitePaths from './sitePaths'
if (process.env.NODE_ENV === 'production') {
Raven.config(
@ -61,7 +61,7 @@ class InFranceRoute extends Component {
sitePaths={paths}
reduxMiddlewares={middlewares}
onStoreCreated={persistEverything()}
initialStore={{ ...retrievePersistedState() }}>
initialStore={{}}>
<TrackPageView />
<div id="content">
<RouterSwitch />

View File

@ -12,7 +12,6 @@ import hiringSvg from '../../images/hiring.svg';
import './Navigation.css';
import NavOpener from './NavOpener';
import SideBar from './SideBar';
import type { TFunction } from 'react-i18next'
type OwnProps = {};
@ -30,6 +29,9 @@ const StepsHeader = ({ t, sitePaths, companyStatusChoice }: Props) => (
<nav className="navigation">
<ul>
<li>
<NavLink to='/' exact className="navigationItem"><T>Accueil</T></NavLink>
</li>
<li>
<NavOpener
to={sitePaths.entreprise.index}
exact={false}

View File

@ -32,7 +32,7 @@ const NumberOfAssociates = ({ companyHasMultipleAssociates, t }: Props) => (
/>
</Helmet>
<h2>
<T k="associés.titre">Nombre d'associés</T>
<T k="associés.titre">Seul ou à plusieurs</T>
</h2>
<T k="associés.description">
<p>
@ -53,14 +53,14 @@ const NumberOfAssociates = ({ companyHasMultipleAssociates, t }: Props) => (
companyHasMultipleAssociates(false)
}}
className="ui__ button">
<T k="associés.choix1">Un associé</T>
<T k="associés.choix1">Seul</T>
</button>
<button
onClick={() => {
companyHasMultipleAssociates(true)
}}
className="ui__ button">
<T k="associés.choix2">Plusieurs associés</T>
<T k="associés.choix2">Plusieurs personnes</T>
</button>
</div>
<CompanyStatusNavigation

View File

@ -1,7 +1,7 @@
/* @flow */
import { reduce, toPairs, zipObj } from 'ramda';
import i18n from '../../i18n';
import { constructSitePaths } from '../../utils';
import { reduce, toPairs, zipObj } from 'ramda'
import i18n from '../../i18n'
import { constructSitePaths } from '../../utils'
import type { LegalStatus } from 'Selectors/companyStatusSelectors'
export const LANDING_LEGAL_STATUS_LIST: Array<LegalStatus> = [
@ -34,15 +34,18 @@ const constructLocalizedSitePath = language => {
),
créer: (companyStatus: LegalStatus | ':status') =>
companyStatus === ':status'
? [t('path.entreprise.créer', '/créer-une-{{companyStatus}}',{
companyStatus: ':status'
}), t(
'path.entreprise.devenirAutoEntrepreneur',
'/devenir-{{autoEntrepreneur}}',
{
autoEntrepreneur: ':status'
}
)]
? [
t('path.entreprise.créer', '/créer-une-{{companyStatus}}', {
companyStatus: ':status'
}),
t(
'path.entreprise.devenirAutoEntrepreneur',
'/devenir-{{autoEntrepreneur}}',
{
autoEntrepreneur: ':status'
}
)
]
: companyStatus.includes('auto-entrepreneur')
? t(
'path.entreprise.devenirAutoEntrepreneur',
@ -108,9 +111,9 @@ const constructLocalizedSitePath = language => {
})
}
let sitePath = constructLocalizedSitePath()
let sitePath = constructLocalizedSitePath(i18n.language)
i18n.on('languageChanged', () => {
sitePath = constructLocalizedSitePath()
sitePath = constructLocalizedSitePath(i18n.language)
})
export default () => sitePath
@ -136,16 +139,22 @@ export const generateSiteMap = (sitePaths: Object) =>
sitePaths
)
type LangLink = Array<{ href: string, hrefLang: 'fr' | 'en'}>
type LangLink = Array<{ href: string, hrefLang: 'fr' | 'en' }>
type SiteMap = Array<string>
const enSiteMap:SiteMap = generateSiteMap(constructLocalizedSitePath('en')).map(path =>
(process.env.EN_SITE || '').replace('${path}', path)
)
const frSiteMap:SiteMap = generateSiteMap(constructLocalizedSitePath('fr')).map(path =>
(process.env.FR_SITE || '').replace('${path}', path)
)
const enSiteMap: SiteMap = generateSiteMap(
constructLocalizedSitePath('en')
).map(path => (process.env.EN_SITE || '').replace('${path}', path))
const frSiteMap: SiteMap = generateSiteMap(
constructLocalizedSitePath('fr')
).map(path => (process.env.FR_SITE || '').replace('${path}', path))
export const hrefLangLink = {
en: zipObj<string, LangLink>(enSiteMap, frSiteMap.map(href => [{ href, hrefLang: 'fr' }])),
fr: zipObj<string, LangLink>(frSiteMap, enSiteMap.map(href => [{ href, hrefLang: 'en' }]))
en: zipObj<string, LangLink>(
enSiteMap,
frSiteMap.map(href => [{ href, hrefLang: 'fr' }])
),
fr: zipObj<string, LangLink>(
frSiteMap,
enSiteMap.map(href => [{ href, hrefLang: 'en' }])
)
}