diff --git a/source/Provider.js b/source/Provider.js
index f2096bdb6..161f353bd 100644
--- a/source/Provider.js
+++ b/source/Provider.js
@@ -1,4 +1,5 @@
import SetCSSColour from 'Components/utils/SetCssColour'
+import { SitePathProvider } from 'Components/utils/withSitePaths'
import { TrackerProvider } from 'Components/utils/withTracker'
import createHistory from 'history/createBrowserHistory'
import i18next from 'i18next'
@@ -66,12 +67,14 @@ export default class Layout extends PureComponent {
// If IE < 11 display nothing
-
-
-
- <>{this.props.children}>
-
-
+
+
+
+
+ <>{this.props.children}>
+
+
+
)
diff --git a/source/actions/actions.js b/source/actions/actions.js
index ac0deb0a4..75ab621a6 100644
--- a/source/actions/actions.js
+++ b/source/actions/actions.js
@@ -51,6 +51,17 @@ export function setExample(name, situation, dottedName) {
return { type: 'SET_EXAMPLE', name, situation, dottedName }
}
+export const goBackToSimulation = () => (
+ dispatch: any => void,
+ _: any,
+ history: RouterHistory
+): void => {
+ while (history.location.pathname.includes('documentation')) {
+ history.goBack()
+ }
+ dispatch({ type: 'SET_EXAMPLE', name: null })
+}
+
export function loadPreviousSimulation(): LoadPreviousSimulationAction {
return {
type: 'LOAD_PREVIOUS_SIMULATION'
diff --git a/source/components/ComparativeTargets.js b/source/components/ComparativeTargets.js
index a7237ac6e..d7d5e8791 100644
--- a/source/components/ComparativeTargets.js
+++ b/source/components/ComparativeTargets.js
@@ -1,6 +1,7 @@
import PeriodSwitch from 'Components/PeriodSwitch'
import withColours from 'Components/utils/withColours'
-import { findRuleByDottedName } from 'Engine/rules'
+import withSitePaths from 'Components/utils/withSitePaths'
+import { encodeRuleName, findRuleByDottedName } from 'Engine/rules'
import { compose } from 'ramda'
import React from 'react'
import emoji from 'react-easy-emoji'
@@ -26,7 +27,8 @@ export default compose(
setSituationBranch: id => dispatch({ type: 'SET_SITUATION_BRANCH', id })
})
),
- withColours
+ withColours,
+ withSitePaths
)(
class ComparativeTargets extends React.Component {
render() {
@@ -35,6 +37,7 @@ export default compose(
analyses,
target,
setSituationBranch,
+ sitePaths,
simulationBranches
} = this.props
if (!simulationBranches) {
@@ -44,7 +47,6 @@ export default compose(
// This is not elegant
let getRatioPrélèvements = analysis =>
analysis.targets.find(t => t.dottedName === 'ratio de prélèvements')
-
return (
{target.title}
@@ -87,7 +89,11 @@ export default compose(
setSituationBranch(i)}
className="explanation">
{emoji('📖')}
@@ -99,7 +105,11 @@ export default compose(
de{' '}
+ to={
+ sitePaths.documentation.index +
+ '/' +
+ encodeRuleName(ratioPrélèvements.dottedName)
+ }>
prélèvements
diff --git a/source/components/RuleLink.js b/source/components/RuleLink.js
index dc87a2e60..5879429b4 100644
--- a/source/components/RuleLink.js
+++ b/source/components/RuleLink.js
@@ -1,21 +1,26 @@
/* @flow */
import withColours from 'Components/utils/withColours'
+import withSitePaths from 'Components/utils/withSitePaths'
import { compose } from 'ramda'
import React from 'react'
-import { withRouter } from 'react-router'
import { Link } from 'react-router-dom'
-import { capitalise0, normalizeBasePath } from '../utils'
+import { capitalise0 } from '../utils'
import './RuleLink.css'
import type { Règle } from 'Types/RegleTypes'
-import type { Match } from 'react-router'
+
type Props = Règle & {
- match: Match,
+ sitePaths: Object,
style: CSSStyleDeclaration,
colours: { colour: string }
}
-const RuleLink = ({ lien, nom, colours: { colour }, match, style }: Props) => {
- const newPath =
- normalizeBasePath(match.path).replace(/simulation\/$/, '') + lien
+const RuleLink = ({
+ lien,
+ nom,
+ colours: { colour },
+ style,
+ sitePaths
+}: Props) => {
+ const newPath = sitePaths.documentation.index + '/' + lien
return (
{
}
export default compose(
- withRouter,
+ withSitePaths,
withColours
)(RuleLink)
diff --git a/source/components/RulePage.js b/source/components/RulePage.js
index a1c392463..865ae61db 100644
--- a/source/components/RulePage.js
+++ b/source/components/RulePage.js
@@ -1,4 +1,4 @@
-import { setExample } from 'Actions/actions'
+import { goBackToSimulation } from 'Actions/actions'
import { ScrollToTop } from 'Components/utils/Scroll'
import { encodeRuleName } from 'Engine/rules'
import {
@@ -25,9 +25,9 @@ export default compose(
connect(state => ({
themeColours: state.themeColours,
valuesToShow: !noUserInputSelector(state),
- flatRules: flatRulesSelector(state),
- situationBranch:
- state.simulationConfig?.branches[state.situationBranch]?.nom
+ flatRules: flatRulesSelector(state)
+ // situationBranch:
+ // state.simulationConfig?.branches[state.situationBranch]?.nom
})),
withNamespaces()
)(
@@ -57,7 +57,7 @@ export default compose(
let { situationBranch } = this.props
return (
-
+
{situationBranch}
)}
-
+
@@ -81,12 +78,7 @@ export default compose(
const BackToSimulation = compose(
connect(
null,
- dispatch => ({
- setExample: compose(
- dispatch,
- setExample
- )
- })
+ { goBackToSimulation }
),
withRouter,
withNamespaces()
@@ -94,18 +86,20 @@ const BackToSimulation = compose(
// Triggers rerender when the language changes
class BackToSimulation extends Component {
render() {
- let { colour, setExample, visible } = this.props
+ let { goBackToSimulation, visible } = this.props
return (
-
{
- setExample(null)
- }}
- style={{ color: colour, visibility: visible ? 'visible' : 'hidden' }}>
-
+ className="ui__ link-button"
+ onClick={goBackToSimulation}
+ style={{ visibility: visible ? 'visible' : 'hidden' }}>
+
Reprendre la simulation
-
+
)
}
}
@@ -122,7 +116,7 @@ let DisambiguateRuleQuery = ({ rules, flatRules }) => (
{rules.map(({ dottedName, ns, title }) => (
- {title}
+ {title}
))}
diff --git a/source/components/SalarySimulation.js b/source/components/SalarySimulation.js
index fd0f53aa7..eaac08889 100644
--- a/source/components/SalarySimulation.js
+++ b/source/components/SalarySimulation.js
@@ -1,9 +1,12 @@
import { startConversation } from 'Actions/actions'
import { Component, React, T } from 'Components'
import AnswerList from 'Components/AnswerList'
+import Distribution from 'Components/Distribution'
+import PaySlip from 'Components/PaySlip'
import { ScrollToTop } from 'Components/utils/Scroll'
import withColours from 'Components/utils/withColours'
import withLanguage from 'Components/utils/withLanguage'
+import withSitePaths from 'Components/utils/withSitePaths'
import { compose } from 'ramda'
import emoji from 'react-easy-emoji'
import { Trans, withNamespaces } from 'react-i18next'
@@ -18,12 +21,9 @@ import {
validInputEnteredSelector
} from 'Selectors/analyseSelectors'
import * as Animate from 'Ui/animate'
-import sitePaths from '../sites/mycompanyinfrance.fr/sitePaths'
import { normalizeBasePath } from '../utils'
import Conversation from './conversation/Conversation'
-import Distribution from './Distribution'
import PageFeedback from './Feedback/PageFeedback'
-import PaySlip from './PaySlip'
import QuickLink from './QuickLink'
import ResultView from './ResultView'
import './SalarySimulation.css'
@@ -47,7 +47,8 @@ export default compose(
startConversation
}
),
- withLanguage
+ withLanguage,
+ withSitePaths
)(
class Simulation extends Component {
state = {
@@ -59,13 +60,13 @@ export default compose(
conversationStarted,
arePreviousAnswers,
nextSteps,
- startConversation,
blockingInputControls,
displayHiringProcedures,
match,
validInputEntered,
- location,
period,
+ location,
+ sitePaths,
noUserInput
} = this.props
const displayConversation = conversationStarted && !blockingInputControls
@@ -143,7 +144,7 @@ export default compose(
+ to={sitePaths.démarcheEmbauche}>
Connaître les démarches
@@ -185,7 +186,7 @@ export default compose(
/>
)}
- {/* {!location.pathname.endsWith('/simulation') && validInputEntered && (
+ {!location.pathname.endsWith('/simulation') && validInputEntered && (
{arePreviousAnswers && conversationStarted && (
@@ -229,7 +230,7 @@ export default compose(
- )} */}
+ )}
>
)
}
diff --git a/source/components/SearchBar.js b/source/components/SearchBar.js
index c0da6db60..0fec6cee9 100644
--- a/source/components/SearchBar.js
+++ b/source/components/SearchBar.js
@@ -1,6 +1,7 @@
+import withSitePaths from 'Components/utils/withSitePaths'
import { encodeRuleName } from 'Engine/rules.js'
import Fuse from 'fuse.js'
-import { sortBy, pick } from 'ramda'
+import { compose, pick, sortBy } from 'ramda'
import React from 'react'
import Highlighter from 'react-highlight-words'
import { withNamespaces } from 'react-i18next'
@@ -70,7 +71,11 @@ class SearchBar extends React.Component {
this.props.finally && this.props.finally()
return (
)
}
@@ -99,7 +104,7 @@ class SearchBar extends React.Component {
@@ -114,4 +119,7 @@ class SearchBar extends React.Component {
}
}
-export default withNamespaces()(SearchBar)
+export default compose(
+ withSitePaths,
+ withNamespaces()
+)(SearchBar)
diff --git a/source/components/SearchButton.js b/source/components/SearchButton.js
index 3f9db18a9..f0c2c150f 100644
--- a/source/components/SearchButton.js
+++ b/source/components/SearchButton.js
@@ -39,13 +39,12 @@ export default compose(
return this.state.visible ? (
- Chercher une règle
+ Chercher dans la documentation
) : (
diff --git a/source/components/TargetSelection.js b/source/components/TargetSelection.js
index 3c1408af1..6168713bf 100644
--- a/source/components/TargetSelection.js
+++ b/source/components/TargetSelection.js
@@ -3,6 +3,7 @@ import InputSuggestions from 'Components/conversation/InputSuggestions'
import PeriodSwitch from 'Components/PeriodSwitch'
import withColours from 'Components/utils/withColours'
import withLanguage from 'Components/utils/withLanguage'
+import withSitePaths from 'Components/utils/withSitePaths'
import { encodeRuleName, findRuleByDottedName } from 'Engine/rules'
import { compose, propEq } from 'ramda'
import React, { Component } from 'react'
@@ -18,7 +19,6 @@ import {
flatRulesSelector,
noUserInputSelector
} from 'Selectors/analyseSelectors'
-import { normalizeBasePath } from '../utils'
import AnimatedTargetValue from './AnimatedTargetValue'
import CurrencyInput from './CurrencyInput/CurrencyInput'
import ProgressCircle from './ProgressCircle'
@@ -139,32 +139,32 @@ export default compose(
}
)
-let Header = ({
- target,
- conversationStarted,
- isActiveInput,
- blockingInputControls,
- match
-}) => {
- const ruleLink =
- normalizeBasePath(match.path).replace(/simulation\/$/, '') +
- 'règle/' +
- encodeRuleName(target.dottedName)
- return (
-
- {conversationStarted && !blockingInputControls && (
-
- )}
+let Header = withSitePaths(
+ ({
+ target,
+ conversationStarted,
+ isActiveInput,
+ blockingInputControls,
+ sitePaths
+ }) => {
+ const ruleLink =
+ sitePaths.documentation.index + '/' + encodeRuleName(target.dottedName)
+ return (
+
+ {conversationStarted && !blockingInputControls && (
+
+ )}
-
-
- {target.title || target.name}
+
+
+ {target.title || target.name}
+
+ {!conversationStarted && {target['résumé']}
}
- {!conversationStarted && {target['résumé']}
}
-
- )
-}
+ )
+ }
+)
let CurrencyField = withColours(props => {
return (
@@ -260,6 +260,7 @@ const TargetValue = connect(
const AidesGlimpse = compose(
withColours,
withRouter,
+ withSitePaths,
connect(state => ({ analysis: analysisWithDefaultsSelector(state) }))
)(
class AidesGlimpse extends Component {
@@ -277,11 +278,8 @@ const AidesGlimpse = compose(
- {' '}
diff --git a/source/components/Targets.js b/source/components/Targets.js
index beeeef871..232540261 100644
--- a/source/components/Targets.js
+++ b/source/components/Targets.js
@@ -1,20 +1,24 @@
import withColours from 'Components/utils/withColours'
+import withSitePaths from 'Components/utils/withSitePaths'
import { compose } from 'ramda'
import React from 'react'
import emoji from 'react-easy-emoji'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
+import sitePaths from '../../sites/mycompanyinfrance.fr/sitePaths';
import { analysisWithDefaultsSelector } from 'Selectors/analyseSelectors'
import './Targets.css'
export default compose(
connect(state => ({ analysis: analysisWithDefaultsSelector(state) })),
- withColours
+ withColours,
+ withSitePaths,
)(
class Targets extends React.Component {
render() {
let {
title,
nodeValue,
+ sitePaths,
unité: unit,
dottedName
} = this.props.analysis.targets[0]
@@ -33,7 +37,7 @@ export default compose(
{emoji('📖')}
diff --git a/source/components/rule/Namespace.js b/source/components/rule/Namespace.js
index 92587ebc2..6450be0d5 100644
--- a/source/components/rule/Namespace.js
+++ b/source/components/rule/Namespace.js
@@ -1,43 +1,49 @@
+import withSitePaths from 'Components/utils/withSitePaths'
import { encodeRuleName, findRuleByDottedName } from 'Engine/rules'
import React from 'react'
+import emoji from 'react-easy-emoji'
import { Link } from 'react-router-dom'
import { capitalise0 } from '../../utils'
import './Namespace.css'
-import emoji from 'react-easy-emoji'
-let Namespace = ({ ns, flatRules, colour }) => (
-
- {ns
- .split(' . ')
- .reduce(
- (memo, next) => [
- ...memo,
- [...(memo.length ? memo.reverse()[0] : []), next]
- ],
- []
- )
- .map(fragments => {
- let ruleName = fragments.join(' . '),
- rule = findRuleByDottedName(flatRules, ruleName)
- if (!rule) {
- throw new Error(
- `Attention, il se peut que la règle ${ruleName}, ait été définie avec un namespace qui n'existe pas.`
- )
- }
- let ruleText = rule.title || capitalise0(rule.name),
- style = { color: colour }
-
- return (
-
-
- {rule.icon && {emoji(rule.icon)} }
- {ruleText}
-
- {' › '}
-
+let Namespace = ({ ns, flatRules, colour, sitePaths }) => {
+ return (
+
+ {ns
+ .split(' . ')
+ .reduce(
+ (memo, next) => [
+ ...memo,
+ [...(memo.length ? memo.reverse()[0] : []), next]
+ ],
+ []
)
- })}
-
-)
+ .map(fragments => {
+ let ruleName = fragments.join(' . '),
+ rule = findRuleByDottedName(flatRules, ruleName)
+ if (!rule) {
+ throw new Error(
+ `Attention, il se peut que la règle ${ruleName}, ait été définie avec un namespace qui n'existe pas.`
+ )
+ }
+ let ruleText = rule.title || capitalise0(rule.name),
+ style = { color: colour }
-export default Namespace
+ return (
+
+
+ {rule.icon && {emoji(rule.icon)} }
+ {ruleText}
+
+ {' › '}
+
+ )
+ })}
+
+ )
+}
+export default withSitePaths(Namespace)
diff --git a/source/components/rule/Rule.js b/source/components/rule/Rule.js
index 67547014a..ce9abb03e 100644
--- a/source/components/rule/Rule.js
+++ b/source/components/rule/Rule.js
@@ -1,5 +1,6 @@
import withColours from 'Components/utils/withColours'
import withLanguage from 'Components/utils/withLanguage'
+import withSitePaths from 'Components/utils/withSitePaths'
import { getInputComponent } from 'Engine/generateQuestions'
import knownMecanisms from 'Engine/known-mecanisms.yaml'
import { createMarkdownDiv } from 'Engine/marked'
@@ -29,16 +30,17 @@ import Examples from './Examples'
import RuleHeader from './Header'
import References from './References'
import './Rule.css'
+import sitePaths from '../../sites/mycompanyinfrance.fr/sitePaths';
let LazySource = React.lazy(() => import('./RuleSource'))
export default compose(
- connect(state => ({
+ connect((state, props) => ({
currentExample: state.currentExample,
flatRules: flatRulesSelector(state),
valuesToShow: !noUserInputSelector(state),
- analysedRule: ruleAnalysisSelector(state),
- analysedExample: exampleAnalysisSelector(state)
+ analysedRule: ruleAnalysisSelector(state, props),
+ analysedExample: exampleAnalysisSelector(state, props)
})),
AttachDictionary(knownMecanisms),
withNamespaces(),
@@ -73,7 +75,7 @@ export default compose(
>
) : (
-
+
{title}
@@ -170,7 +172,8 @@ export default compose(
}
)
-let NamespaceRulesList = withColours(({ namespaceRules, colours }) => (
+let NamespaceRulesList = compose(withColours, withSitePaths)(({ namespaceRules, colours, sitePaths }) => {
+ return (
Règles associées
@@ -183,14 +186,15 @@ let NamespaceRulesList = withColours(({ namespaceRules, colours }) => (
color: colours.textColourOnWhite,
textDecoration: 'underline'
}}
- to={'../règle/' + encodeRuleName(r.dottedName)}>
+ to={sitePaths.documentation.index + '/' + encodeRuleName(r.dottedName)}>
{r.title || r.name}
))}
-))
+)
+ })
const UserInput = reduxForm({
form: 'conversation',
diff --git a/source/components/rule/RuleValueVignette.js b/source/components/rule/RuleValueVignette.js
index 8248c10a9..5cb0ec66c 100644
--- a/source/components/rule/RuleValueVignette.js
+++ b/source/components/rule/RuleValueVignette.js
@@ -7,7 +7,7 @@ import './RuleValueVignette.css'
let RuleValueVignette = ({ name, title, nodeValue: ruleValue }) => (
-
+
{title}
diff --git a/source/components/simulationConfigs/withSimulationConfig.js b/source/components/simulationConfigs/withSimulationConfig.js
index f5a5aa533..b2190459d 100644
--- a/source/components/simulationConfigs/withSimulationConfig.js
+++ b/source/components/simulationConfigs/withSimulationConfig.js
@@ -1,4 +1,3 @@
-import { resetSimulation } from 'Actions/actions'
import React from 'react'
import { connect } from 'react-redux'
@@ -8,7 +7,6 @@ export default config => SimulationComponent =>
dispatch => ({
setSimulation: () => {
dispatch({ type: 'SET_SIMULATION_CONFIG', config })
- dispatch(resetSimulation())
}
})
)(
diff --git a/source/components/utils/withSitePaths.js b/source/components/utils/withSitePaths.js
new file mode 100644
index 000000000..67e33a0e1
--- /dev/null
+++ b/source/components/utils/withSitePaths.js
@@ -0,0 +1,29 @@
+/* @flow */
+
+import React, { Component, createContext } from 'react'
+import type { ComponentType } from 'react'
+
+export type SitePaths = Object
+
+const SitePathsContext = createContext({})
+
+export const SitePathProvider = SitePathsContext.Provider
+export default function withSitePaths
(
+ WrappedComponent: ComponentType
+) {
+ class WithSitePaths extends Component<
+ $Diff
+ > {
+ displayName = `withSitePaths(${WrappedComponent.displayName || ''})`
+ render() {
+ return (
+
+ {sitePaths => (
+
+ )}
+
+ )
+ }
+ }
+ return WithSitePaths
+}
diff --git a/source/engine/mecanismViews/common.js b/source/engine/mecanismViews/common.js
index 920c668ee..ddebbeee1 100644
--- a/source/engine/mecanismViews/common.js
+++ b/source/engine/mecanismViews/common.js
@@ -1,6 +1,7 @@
import classNames from 'classnames'
import withLanguage from 'Components/utils/withLanguage'
-import { contains } from 'ramda'
+import withSitePaths from 'Components/utils/withSitePaths'
+import { compose, contains } from 'ramda'
import React, { Component } from 'react'
import { Trans } from 'react-i18next'
import { connect } from 'react-redux'
@@ -80,17 +81,33 @@ export function InlineMecanism({ name }) {
}
// Un élément du graphe de calcul qui a une valeur interprétée (à afficher)
-export const Leaf = connect(state => ({ flatRules: flatRulesSelector(state) }))(
+export const Leaf = compose(
+ withSitePaths,
+ connect(state => ({ flatRules: flatRulesSelector(state) }))
+)(
class Leaf extends Component {
render() {
- let { classes, dottedName, name, value, flatRules, filter } = this.props,
+ let {
+ classes,
+ dottedName,
+ name,
+ value,
+ flatRules,
+ filter,
+ sitePaths
+ } = this.props,
rule = findRuleByDottedName(flatRules, dottedName)
return (
{dottedName && (
-
+
{rule.title || capitalise0(name)} {filter}
@@ -106,7 +123,7 @@ export const Leaf = connect(state => ({ flatRules: flatRulesSelector(state) }))(
export function SimpleRuleLink({ rule: { dottedName, title, name } }) {
return (
-
+
{title || capitalise0(name)}
)
diff --git a/source/engine/rules.js b/source/engine/rules.js
index 81ceeab6d..2a1a0138a 100644
--- a/source/engine/rules.js
+++ b/source/engine/rules.js
@@ -105,9 +105,9 @@ export let nameLeaf = pipe(
)
export let encodeRuleName = name =>
- name.replace(/\s\.\s/g, '--').replace(/\s/g, '-')
+ encodeURI(name.replace(/\s\.\s/g, '/').replace(/\s/g, '-'))
export let decodeRuleName = name =>
- name.replace(/--/g, ' . ').replace(/-/g, ' ')
+ decodeURI(name.replace(/\//g, ' . ').replace(/-/g, ' '))
export let ruleParents = dottedName => {
let fragments = splitName(dottedName) // dottedName ex. [CDD . événements . rupture]
diff --git a/source/locales/en.yaml b/source/locales/en.yaml
index 462198f8f..72f2d7cf1 100644
--- a/source/locales/en.yaml
+++ b/source/locales/en.yaml
@@ -50,7 +50,7 @@ afficher les sources complémentaires: display additional information sources
input: This rule does not have a formula to compute it. Its value must be supplied through the form.
Déclenchement: Applicability
Calcul: Formula
-Chercher une règle: Find a rule
+Chercher dans la documentation: Search the documentation
Entrez des mots clefs ici: Enter keywords
noresults: No results
cliquez pour insérer cette suggestion: click to insert this suggestion
diff --git a/source/règles/base.yaml b/source/règles/base.yaml
index d48d910ee..98153470d 100644
--- a/source/règles/base.yaml
+++ b/source/règles/base.yaml
@@ -1318,7 +1318,7 @@
> C'est donc aussi une mesure de la valeur apportée par le salarié à l'entreprise : l'employeur est prêt à verser cette somme en contrepartie du travail fourni.
- Des [aides différées](/règle/aides employeur) peuvent venir diminuer ce montant.
+ Des [aides différées](/documentation/aides-employeur) peuvent venir diminuer ce montant.
formule: rémunération . total sans réduction - réductions de cotisations
alternative: entreprise . rémunération totale du dirigeant
diff --git a/source/selectors/analyseSelectors.js b/source/selectors/analyseSelectors.js
index 7ae822192..9d322db0c 100644
--- a/source/selectors/analyseSelectors.js
+++ b/source/selectors/analyseSelectors.js
@@ -122,7 +122,7 @@ let analyseRule = (parsedRules, ruleDottedName, situationGate) =>
export let ruleAnalysisSelector = createSelector(
[
parsedRulesSelector,
- (_, { dottedName }) => dottedName,
+ (_, props) => props.dottedName,
situationsWithDefaultsSelector,
state => state.situationBranch || 0
],
@@ -154,7 +154,7 @@ let exampleSituationSelector = createSelector(
export let exampleAnalysisSelector = createSelector(
[
parsedRulesSelector,
- (_, { dottedName }) => dottedName,
+ (_, props) => props.dottedName,
exampleSituationSelector
],
(rules, dottedName, situation) =>
diff --git a/source/selectors/companyStatusSelectors.js b/source/selectors/companyStatusSelectors.js
index 85f2904f4..2231a3fa2 100644
--- a/source/selectors/companyStatusSelectors.js
+++ b/source/selectors/companyStatusSelectors.js
@@ -15,6 +15,7 @@ import {
pick,
sortBy
} from 'ramda'
+//TODO : use react context
import sitePaths from '../sites/mycompanyinfrance.fr/sitePaths'
const LEGAL_STATUS_DETAILS: {
diff --git a/source/selectors/regleSelectors.js b/source/selectors/regleSelectors.js
index 90f670764..800a3ade4 100644
--- a/source/selectors/regleSelectors.js
+++ b/source/selectors/regleSelectors.js
@@ -34,7 +34,7 @@ export const règleLocaliséeSelector = createSelector(
}
return {
nom: localizedRule.titre || localizedRule.nom,
- lien: 'règle/' + encodeRuleName(dottedName),
+ lien: encodeRuleName(dottedName),
id: dottedName,
...(localizedRule.shortDescription
diff --git a/source/sites/embauche.gouv.fr/pages/RulesList.js b/source/sites/embauche.gouv.fr/pages/RulesList.js
index a9c20a984..f3fd7102d 100644
--- a/source/sites/embauche.gouv.fr/pages/RulesList.js
+++ b/source/sites/embauche.gouv.fr/pages/RulesList.js
@@ -1,5 +1,5 @@
+import { Component, React, T } from 'Components'
import SearchBar from 'Components/SearchBar'
-import { React, Component, T } from 'Components'
import { connect } from 'react-redux'
import 'react-select/dist/react-select.css'
import { flatRulesSelector } from 'Selectors/analyseSelectors'
@@ -16,11 +16,7 @@ export default connect(state => ({
Explorez notre base de règles
-
+
)
}
diff --git a/source/sites/mycompanyinfrance.fr/App.js b/source/sites/mycompanyinfrance.fr/App.js
index 9d6829deb..bfe100bed 100644
--- a/source/sites/mycompanyinfrance.fr/App.js
+++ b/source/sites/mycompanyinfrance.fr/App.js
@@ -1,5 +1,8 @@
+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'
@@ -7,6 +10,10 @@ 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'
@@ -47,13 +54,16 @@ class InFranceRoute extends Component {
}
}
render() {
+ const paths = sitePaths()
return (
+ onStoreCreated={persistEverything}
+ initialStore={retrievePersistedState()}>
@@ -63,8 +73,10 @@ class InFranceRoute extends Component {
}
}
-let RouterSwitch = withNamespaces()(() => {
- const paths = sitePaths()
+let RouterSwitch = compose(
+ withNamespaces(),
+ withSitePaths
+)(({ sitePaths }) => {
return (
@@ -76,15 +88,19 @@ let RouterSwitch = withNamespaces()(() => {
-
+
+
{process.env.NODE_ENV !== 'production' && (
)}
diff --git a/source/sites/mycompanyinfrance.fr/layout/Navigation/Navigation.js b/source/sites/mycompanyinfrance.fr/layout/Navigation/Navigation.js
index 62d972659..69ac183f3 100644
--- a/source/sites/mycompanyinfrance.fr/layout/Navigation/Navigation.js
+++ b/source/sites/mycompanyinfrance.fr/layout/Navigation/Navigation.js
@@ -1,5 +1,6 @@
/* @flow */
import { React, T } from 'Components'
+import withSitePaths from 'Components/utils/withSitePaths'
import { compose } from 'ramda'
import emoji from 'react-easy-emoji'
import { withNamespaces } from 'react-i18next'
@@ -9,10 +10,10 @@ import selectors from 'Selectors/progressSelectors'
import companySvg from '../../images/company.svg'
import estimateSvg from '../../images/estimate.svg'
import hiringSvg from '../../images/hiring.svg'
-import sitePaths from '../../sitePaths'
import './Navigation.css'
import NavOpener from './NavOpener'
import SideBar from './SideBar'
+
import type { TFunction } from 'react-i18next'
const Progress = ({ percent }) => (
@@ -28,6 +29,7 @@ const Progress = ({ percent }) => (
type Props = {
companyProgress: number,
estimationProgress: number,
+ sitePaths: Object,
hiringProgress: number,
companyStatusChoice: string,
t: TFunction
@@ -37,6 +39,7 @@ const StepsHeader = ({
t,
estimationProgress,
hiringProgress,
+ sitePaths,
companyStatusChoice
}: Props) => (
@@ -45,7 +48,7 @@ const StepsHeader = ({
@@ -63,13 +66,13 @@ const StepsHeader = ({
Nombre d'associés
@@ -78,7 +81,7 @@ const StepsHeader = ({
@@ -89,8 +92,7 @@ const StepsHeader = ({
Responsabilité
@@ -98,7 +100,7 @@ const StepsHeader = ({
@@ -109,7 +111,7 @@ const StepsHeader = ({
@@ -119,9 +121,7 @@ const StepsHeader = ({
+ to={sitePaths.entreprise.statusJuridique.liste}>
Liste des statuts
@@ -133,62 +133,56 @@ const StepsHeader = ({
Micro-entreprise
-
+
EI
-
+
EIRL
-
+
EURL
-
+
SA
-
+
SARL
-
+
SAS
-
+
SASU
-
+
SNC
@@ -196,7 +190,7 @@ const StepsHeader = ({
-
+
Après la création
@@ -204,7 +198,7 @@ const StepsHeader = ({
-
+
Retrouver votre entreprise
@@ -212,7 +206,7 @@ const StepsHeader = ({
-
+
Protection sociale
-
+
Embauche
({
...selectors(state),
diff --git a/source/sites/mycompanyinfrance.fr/layout/ProgressHeader/ProgressHeader.js b/source/sites/mycompanyinfrance.fr/layout/ProgressHeader/ProgressHeader.js
index 8e1af6df5..a55c62643 100644
--- a/source/sites/mycompanyinfrance.fr/layout/ProgressHeader/ProgressHeader.js
+++ b/source/sites/mycompanyinfrance.fr/layout/ProgressHeader/ProgressHeader.js
@@ -1,6 +1,7 @@
/* @flow */
import { React, T } from 'Components'
+import withSitePaths from 'Components/utils/withSitePaths'
import withTracker from 'Components/utils/withTracker'
import { compose } from 'ramda'
import { withNamespaces } from 'react-i18next'
@@ -10,8 +11,8 @@ import selectors from 'Selectors/progressSelectors'
import companySvg from '../../images/company.svg'
import estimateSvg from '../../images/estimate.svg'
import hiringSvg from '../../images/hiring.svg'
-import sitePaths from '../../sitePaths'
import './ProgressHeader.css'
+
import type { Tracker } from 'Components/utils/withTracker'
const Progress = ({ percent }) => (
@@ -28,18 +29,20 @@ type Props = {
companyProgress: number,
estimationProgress: number,
hiringProgress: number,
- tracker: Tracker
+ tracker: Tracker,
+ sitePaths: Object
}
const StepsHeader = ({
companyProgress,
estimationProgress,
hiringProgress,
- tracker
+ tracker,
+ sitePaths
}: Props) => (
tracker.push(['trackEvent', 'Header', 'click', 'Your company'])
@@ -51,7 +54,7 @@ const StepsHeader = ({
tracker.push(['trackEvent', 'Header', 'click', 'Social security'])
@@ -64,7 +67,7 @@ const StepsHeader = ({
tracker.push(['trackEvent', 'Header', 'click', 'Hiring process'])
@@ -87,5 +90,6 @@ export default compose(
selectors,
{}
),
- withNamespaces()
+ withNamespaces(),
+ withSitePaths
)(StepsHeader)
diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/AfterRegistration.js b/source/sites/mycompanyinfrance.fr/pages/Company/AfterRegistration.js
index 62f5a2678..f159c2df2 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Company/AfterRegistration.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Company/AfterRegistration.js
@@ -1,21 +1,22 @@
/* @flow */
import { React, T } from 'Components'
import { ScrollToTop } from 'Components/utils/Scroll'
+import withSitePaths from 'Components/utils/withSitePaths'
import { compose } from 'ramda'
import { withNamespaces } from 'react-i18next'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import Animate from 'Ui/animate'
-import sitePaths from '../../sitePaths'
import siret from './siret.jpg'
import type { TFunction } from 'react-i18next'
type Props = {
companyStatusChoice: string,
+ sitePaths: Object,
t: TFunction
}
-const AfterRegistration = ({ t, companyStatusChoice }: Props) => (
+const AfterRegistration = ({ t, companyStatusChoice, sitePaths }: Props) => (
@@ -91,10 +92,10 @@ const AfterRegistration = ({ t, companyStatusChoice }: Props) => (
>
)}
-
+
‹ Démarche de création
-
+
Estimez vos cotisations ›
@@ -105,5 +106,6 @@ export default compose(
connect(state => ({
companyStatusChoice: state.inFranceApp.companyStatusChoice
})),
- withNamespaces()
+ withNamespaces(),
+ withSitePaths
)(AfterRegistration)
diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/CreationChecklist.js b/source/sites/mycompanyinfrance.fr/pages/Company/CreationChecklist.js
index 68bab5ce3..3457a8afc 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Company/CreationChecklist.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Company/CreationChecklist.js
@@ -12,8 +12,10 @@ import { withNamespaces } from 'react-i18next'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import * as Animate from 'Ui/animate'
+import withSitePaths from 'Components/utils/withSitePaths'
+
import { CheckItem, Checklist } from 'Ui/Checklist'
-import sitePaths, { LANDING_LEGAL_STATUS_LIST } from '../../sitePaths'
+import { LANDING_LEGAL_STATUS_LIST } from '../../sitePaths'
import Page404 from '../404'
import StatusDescription from './StatusDescription'
import type { Match } from 'react-router'
@@ -24,6 +26,7 @@ type Props = {
match: Match,
onChecklistInitialization: (string, Array) => void,
onStatusChange: () => void,
+ sitePaths: Object,
onItemCheck: (name: string, checked: boolean) => void,
t: TFunction,
companyCreationChecklist: { [string]: boolean }
@@ -34,6 +37,7 @@ const CreateCompany = ({
statusChooserCompleted,
onChecklistInitialization,
onItemCheck,
+ sitePaths,
companyCreationChecklist,
onStatusChange,
t
@@ -422,7 +426,7 @@ const CreateCompany = ({
‹ Choisir un autre statut
-
+
Après la création ›
@@ -431,6 +435,7 @@ const CreateCompany = ({
}
export default compose(
withNamespaces(),
+ withSitePaths,
connect(
state => ({
companyCreationChecklist: state.inFranceApp.companyCreationChecklist,
diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/Find.js b/source/sites/mycompanyinfrance.fr/pages/Company/Find.js
index e7bd8fbb8..60a099d82 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Company/Find.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Company/Find.js
@@ -1,23 +1,23 @@
/* @flow */
import { saveExistingCompanyDetails } from 'Actions/existingCompanyActions'
import { React, T } from 'Components'
+// $FlowFixMe
+import withSitePaths from 'Components/utils/withSitePaths'
import { compose } from 'ramda'
import Helmet from 'react-helmet'
import { withNamespaces } from 'react-i18next'
import { connect } from 'react-redux'
import { withRouter } from 'react-router'
import { Link } from 'react-router-dom'
-// $FlowFixMe
import ReactSelect from 'react-select'
// $FlowFixMe
import 'react-select/dist/react-select.css'
-import sitePaths from '../../sitePaths'
import './Find.css'
import { CompanyDetails as Company } from './YourCompany'
import type { RouterHistory } from 'react-router'
-const goToNextStep = (history: RouterHistory) => {
- history.push(sitePaths().sécuritéSociale.index)
+const goToNextStep = (history: RouterHistory, sitePaths: Object) => {
+ history.push(sitePaths.sécuritéSociale.index)
}
type State = {
@@ -52,7 +52,7 @@ class Search extends React.Component {
})
render() {
- let { t } = this.props
+ let { t, sitePaths } = this.props
return (
@@ -69,7 +69,7 @@ class Search extends React.Component {
Retrouver votre entreprise
-
+
Je n'ai pas encore d'entreprise
@@ -101,7 +101,7 @@ class Search extends React.Component {
{
this.props.onCompanyDetailsConfirmation(this.state.input)
- goToNextStep(this.props.history)
+ goToNextStep(this.props.history, sitePaths)
}}
className="ui__ button">
Confirmer et simuler un salaire
@@ -115,6 +115,7 @@ class Search extends React.Component {
export default compose(
withRouter,
+ withSitePaths,
connect(
null,
{
diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/Home.js b/source/sites/mycompanyinfrance.fr/pages/Company/Home.js
index 4f42bc382..4ea533098 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Company/Home.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Company/Home.js
@@ -1,14 +1,15 @@
/* @flow */
import { resetCompanyStatusChoice } from 'Actions/companyStatusActions'
import { React, T } from 'Components'
+import withSitePaths from 'Components/utils/withSitePaths'
import { compose, toPairs } from 'ramda'
import Helmet from 'react-helmet'
import { withNamespaces } from 'react-i18next'
import { connect } from 'react-redux'
import { Link, Redirect } from 'react-router-dom'
import { nextQuestionUrlSelector } from 'Selectors/companyStatusSelectors'
-import sitePaths from '../../sitePaths'
import PreviousAnswers from './PreviousAnswers'
+
import type { TFunction } from 'react-i18next'
import type { Match, Location } from 'react-router'
@@ -19,10 +20,12 @@ type Props = {
guideAlreadyStarted: boolean,
resetCompanyStatusChoice: (?string) => void,
t: TFunction,
- location: Location
+ location: Location,
+ sitePaths: Object
}
const CreateMyCompany = ({
match,
+ sitePaths,
nextQuestionUrl,
guideAlreadyStarted,
resetCompanyStatusChoice,
@@ -31,7 +34,7 @@ const CreateMyCompany = ({
}: Props) => {
if (!match.isExact) {
const companyStatusCurrentQuestionName = (toPairs(
- sitePaths().entreprise.statusJuridique
+ sitePaths.entreprise.statusJuridique
).find(([, pathname]) => location.pathname === pathname) || [])[0]
resetCompanyStatusChoice(companyStatusCurrentQuestionName)
}
@@ -75,7 +78,7 @@ const CreateMyCompany = ({
{!guideAlreadyStarted ? Commencer : Reprendre }
Plus tard ›
@@ -96,5 +99,6 @@ export default compose(
}),
{ resetCompanyStatusChoice }
),
+ withSitePaths,
withNamespaces()
)(CreateMyCompany)
diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/PickLegalStatus.js b/source/sites/mycompanyinfrance.fr/pages/Company/PickLegalStatus.js
index 484b91530..07c3f0e30 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Company/PickLegalStatus.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Company/PickLegalStatus.js
@@ -1,40 +1,39 @@
/* @flow */
-import { React, T } from 'Components'
-import Helmet from 'react-helmet'
-import { connect } from 'react-redux'
-import { filter } from 'ramda'
-import { Link } from 'react-router-dom'
-import { possibleStatusSelector } from 'Selectors/companyStatusSelectors'
-import { withNamespaces } from 'react-i18next'
-import StatusDescription from './StatusDescription'
+import { goBackToPreviousQuestion } from 'Actions/companyStatusActions';
+import { React, T } from 'Components';
+import withLanguage from 'Components/utils/withLanguage';
+import withSitePaths from 'Components/utils/withSitePaths';
+import { compose, filter } from 'ramda';
+import Helmet from 'react-helmet';
+import { withNamespaces } from 'react-i18next';
+import { connect } from 'react-redux';
+import { Link } from 'react-router-dom';
+import { possibleStatusSelector } from 'Selectors/companyStatusSelectors';
+import StatusDescription from './StatusDescription';
import type { RouterHistory } from 'react-router'
-import { compose } from 'ramda'
import type { LegalStatus } from 'Selectors/companyStatusSelectors'
-import withLanguage from 'Components/utils/withLanguage'
import type { TFunction } from 'react-i18next'
-import sitePaths from '../../sitePaths'
-import { goBackToPreviousQuestion } from 'Actions/companyStatusActions'
-
type Props = {
history: RouterHistory,
possibleStatus: { [LegalStatus]: boolean },
goBackToPreviousQuestion: () => void,
+ sitePaths: Object,
setMainStatus: LegalStatus => void,
language: string,
t: TFunction
}
-const StatusButton = withNamespaces()(
- ({ status, t }: { status: LegalStatus, t: TFunction }) => (
+const StatusButton = withSitePaths(withNamespaces()(
+ ({ status, t, sitePaths }: { status: LegalStatus, t: TFunction, sitePaths: Object }) => (
-
+
Créer une {t(status)}
)
-)
+))
const StatusTitle = ({ status, language }) =>
status === 'EI' ? (
<>
@@ -85,6 +84,7 @@ const SetMainStatus = ({
history,
possibleStatus,
goBackToPreviousQuestion,
+ sitePaths,
t,
language
}: Props) => {
@@ -121,7 +121,7 @@ const SetMainStatus = ({
‹ Précédent
Choisir plus tard ›
@@ -132,6 +132,7 @@ const SetMainStatus = ({
export default compose(
withNamespaces(),
+ withSitePaths,
withLanguage,
connect(
state => ({ possibleStatus: possibleStatusSelector(state) }),
diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/PreviousAnswers.js b/source/sites/mycompanyinfrance.fr/pages/Company/PreviousAnswers.js
index 1a427df2a..7de876b57 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Company/PreviousAnswers.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Company/PreviousAnswers.js
@@ -1,11 +1,12 @@
/* @flow */
import { goToCompanyStatusChoice } from 'Actions/companyStatusActions'
import { React, T } from 'Components'
-import { isNil } from 'ramda'
+import withSitePaths from 'Components/utils/withSitePaths'
+import { compose, isNil } from 'ramda'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import Animate from 'Ui/animate'
-import sitePaths from '../../sitePaths'
+
import type { LegalStatusRequirements } from 'Types/companyTypes'
const requirementToText = (key, value) => {
switch (key) {
@@ -38,6 +39,7 @@ type Props = LegalStatusRequirements & { goToCompanyStatusChoice: () => void }
const PreviousAnswers = ({
goToCompanyStatusChoice,
+ sitePaths,
...legalStatus
}: Props) => {
return (
@@ -57,7 +59,7 @@ const PreviousAnswers = ({
([key, value]) =>
!isNil(value) && (
-
+
{requirementToText(key, value)}
@@ -71,7 +73,10 @@ const PreviousAnswers = ({
)
}
-export default connect(
- state => state.inFranceApp.companyLegalStatus,
- { goToCompanyStatusChoice }
+export default compose(
+ connect(
+ state => state.inFranceApp.companyLegalStatus,
+ { goToCompanyStatusChoice }
+ ),
+ withSitePaths
)(PreviousAnswers)
diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/YourCompany.js b/source/sites/mycompanyinfrance.fr/pages/Company/YourCompany.js
index 75227feef..c3da51e21 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Company/YourCompany.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Company/YourCompany.js
@@ -2,11 +2,11 @@
import { React, T } from 'Components'
import withLanguage from 'Components/utils/withLanguage'
-import { toPairs } from 'ramda'
+import { toPairs, compose } from 'ramda'
import { withNamespaces } from 'react-i18next'
import { connect } from 'react-redux'
import { Link, Redirect } from 'react-router-dom'
-import sitePaths from '../../sitePaths'
+import withSitePaths from 'Components/utils/withSitePaths'
import type { ResetExistingCompanyDetailsAction } from 'Types/companyTypes'
import type { TFunction } from 'react-i18next'
@@ -61,27 +61,27 @@ export const CompanyDetails = withNamespaces()(
}
)
-const YourCompany = ({ companyDetails, resetCompanyDetails }) => (
+const YourCompany = ({ companyDetails, resetCompanyDetails, sitePaths }) => (
<>
- {!companyDetails && }
+ {!companyDetails && }
Votre entreprise
-
+
Ce n'est pas mon entreprise
-
+
Simuler une embauche
>
)
-export default connect(
+export default compose(withSitePaths, connect(
state => ({
companyDetails: state.inFranceApp.existingCompanyDetails
}),
@@ -91,4 +91,4 @@ export default connect(
type: 'RESET_EXISTING_COMPANY_DETAILS'
})
})
-)(YourCompany)
+))(YourCompany)
diff --git a/source/sites/mycompanyinfrance.fr/pages/Company/index.js b/source/sites/mycompanyinfrance.fr/pages/Company/index.js
index c859b9907..b18e57286 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Company/index.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Company/index.js
@@ -1,9 +1,10 @@
import React from 'react'
import { withNamespaces } from 'react-i18next'
import { connect } from 'react-redux'
+import { compose } from 'ramda'
import { Redirect, Route, Switch } from 'react-router'
import * as Animate from 'Ui/animate'
-import sitePaths from '../../sitePaths'
+import withSitePaths from 'Components/utils/withSitePaths'
import AfterRegistration from './AfterRegistration'
import CreationChecklist from './CreationChecklist'
import DefineDirectorStatus from './DirectorStatus'
@@ -28,71 +29,72 @@ const CreateMyCompany = ({
match,
location,
companyStatusChoice,
- existingCompany
+ existingCompany,
+ sitePaths,
}) => {
- const paths = sitePaths()
+
return (
<>
-
-
+
+
{existingCompany && (
)}
{companyStatusChoice ? (
) : (
)}
@@ -101,7 +103,11 @@ const CreateMyCompany = ({
)
}
-export default connect(state => ({
- companyStatusChoice: state.inFranceApp.companyStatusChoice,
- existingCompany: state.inFranceApp.existingCompanyDetails
-}))(withNamespaces()(CreateMyCompany))
+export default compose(
+ connect(state => ({
+ companyStatusChoice: state.inFranceApp.companyStatusChoice,
+ existingCompany: state.inFranceApp.existingCompanyDetails
+ })),
+ withNamespaces(),
+ withSitePaths
+)(CreateMyCompany)
diff --git a/source/sites/mycompanyinfrance.fr/pages/Documentation/index.js b/source/sites/mycompanyinfrance.fr/pages/Documentation/index.js
new file mode 100644
index 000000000..e69de29bb
diff --git a/source/sites/mycompanyinfrance.fr/pages/HiringProcess.js b/source/sites/mycompanyinfrance.fr/pages/HiringProcess.js
index 2e8b576e3..49811d4f6 100644
--- a/source/sites/mycompanyinfrance.fr/pages/HiringProcess.js
+++ b/source/sites/mycompanyinfrance.fr/pages/HiringProcess.js
@@ -4,6 +4,7 @@ import {
initializeHiringChecklist
} from 'Actions/hiringChecklistAction'
import { React, T } from 'Components'
+import withSitePaths from 'Components/utils/withSitePaths'
import { compose } from 'ramda'
import Helmet from 'react-helmet'
import { withNamespaces } from 'react-i18next'
@@ -11,10 +12,10 @@ import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import Animate from 'Ui/animate'
import { CheckItem, Checklist } from 'Ui/Checklist'
-import sitePaths from '../sitePaths'
const HiringProcess = ({
onChecklistInitialization,
+ sitePaths,
onItemCheck,
hiringChecklist,
t
@@ -200,7 +201,7 @@ const HiringProcess = ({
+ to={sitePaths.sécuritéSociale.index + '/simulation'}>
Obtenir un exemple de fiche de paie
@@ -209,6 +210,7 @@ const HiringProcess = ({
export default compose(
withNamespaces(),
+ withSitePaths,
connect(
state => ({ hiringChecklist: state.inFranceApp.hiringChecklist }),
{
diff --git a/source/sites/mycompanyinfrance.fr/pages/Landing.js b/source/sites/mycompanyinfrance.fr/pages/Landing.js
index 47d6daac3..55cbad371 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Landing.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Landing.js
@@ -1,75 +1,74 @@
/* @flow */
import withColours from 'Components/utils/withColours'
+import withSitePaths from 'Components/utils/withSitePaths'
import marianneSvg from 'Images/marianne.svg'
import urssafSvg from 'Images/urssaf.svg'
+import { compose } from 'ramda'
import React from 'react'
import emoji from 'react-easy-emoji'
import { Trans, withNamespaces } from 'react-i18next'
import { Link } from 'react-router-dom'
import Animate from 'Ui/animate'
import Footer from '../layout/Footer/Footer'
-import sitePaths from '../sitePaths'
import './Landing.css'
-export default withNamespaces()(
- withColours(({ colours: { colour } }) => (
- <>
-
+
+
+
+
+
+
+ {emoji('🧭')} Que souhaitez vous faire ?
+
+
+
+ {emoji('💡')} Créer une entreprise
+
-
- {emoji('💶')} Estimer les cotisations et les taxes
-
+
+ {emoji('💶')} Estimer les cotisations et les taxes
+
-
- {emoji('🤝')} Connaître les démarches d'embauche
-
-
- {emoji('🏡')} Déclarer mon activité d'économie collaborative
-
+
+ {emoji('🤝')} Connaître les démarches d'embauche
+
+
+ {emoji('🏡')} Déclarer mon activité d'économie collaborative
+
-
- {emoji('🌍')} Démarrer une activité en France en tant
- qu'entrepreneur étranger
-
-
-
-
- >
- ))
-)
+
+ {emoji('🌍')} Démarrer une activité en France en tant qu'entrepreneur
+ étranger
+
+
+
+
+ >
+))
diff --git a/source/sites/mycompanyinfrance.fr/pages/Sitemap.js b/source/sites/mycompanyinfrance.fr/pages/Sitemap.js
index 4f9c5626f..d6d0bd95a 100644
--- a/source/sites/mycompanyinfrance.fr/pages/Sitemap.js
+++ b/source/sites/mycompanyinfrance.fr/pages/Sitemap.js
@@ -1,17 +1,21 @@
+import withSitePaths from 'Components/utils/withSitePaths'
import React from 'react'
-import sitePaths, { generateSiteMap } from '../sitePaths'
-const SiteMap = () => (
+import { generateSiteMap } from '../sitePaths'
+
+const SiteMap = ({ sitePaths }) => (
<>
Sitemap
- {generateSiteMap(sitePaths()).map(path => (
-
- {path}
-
-
- ))}
+ {generateSiteMap(
+ sitePaths.map(path => (
+
+ {path}
+
+
+ ))
+ )}
>
)
-export default SiteMap
+export default withSitePaths(SiteMap)
diff --git a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Home.js b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Home.js
index 622c6e040..83acd49f0 100644
--- a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Home.js
+++ b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Home.js
@@ -3,6 +3,7 @@
import { Component, React, T } from 'Components'
import { ScrollToTop } from 'Components/utils/Scroll'
import withLanguage from 'Components/utils/withLanguage'
+import withSitePaths from 'Components/utils/withSitePaths'
import { compose } from 'ramda'
import Helmet from 'react-helmet'
import { withNamespaces } from 'react-i18next'
@@ -10,8 +11,8 @@ import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import { régimeSelector } from 'Selectors/companyStatusSelectors'
import * as Animate from 'Ui/animate'
-import sitePaths from '../../sitePaths'
import Video from './Video'
+
import type { Match, Location } from 'react-router'
import type { TFunction } from 'react-i18next'
@@ -20,27 +21,23 @@ type Props = {
location: Location,
t: TFunction,
régime: 'indépendant' | 'assimilé-salarié' | 'micro-entreprise' | null,
+ sitePaths: Object,
language: string
}
class SocialSecurity extends Component {
render() {
+ const { t, match, régime, sitePaths } = this.props
return (
<>
- {this.props.t(
- 'sécu.page.titre',
- "Sécurité sociale et coût d'embauche"
- )}
+ {t('sécu.page.titre', "Sécurité sociale et coût d'embauche")}
-
+
- {this.props.match.isExact && (
+ {match.isExact && (
<>
Protection sociale : coûts et avantages
@@ -64,15 +61,15 @@ class SocialSecurity extends Component {
La rémunération du dirigeant
+ to={sitePaths.sécuritéSociale.salarié}>
Le salaire d'un employé
@@ -87,6 +84,7 @@ class SocialSecurity extends Component {
export default compose(
withNamespaces(),
withLanguage,
+ withSitePaths,
connect(state => ({
régime: régimeSelector(state)
}))
diff --git a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/index.js b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/index.js
index 6c111abec..571281ca4 100644
--- a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/index.js
+++ b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/index.js
@@ -1,8 +1,7 @@
-import RulePage from 'Components/RulePage'
import { ScrollToTop } from 'Components/utils/Scroll'
+import withSitePaths from 'Components/utils/withSitePaths'
import React from 'react'
import { Route, Switch } from 'react-router'
-import sitePaths from '../../sitePaths'
import AssimiléSalarié from './AssimiléSalarié'
import Home from './Home'
import Indépendant from './Indépendant'
@@ -10,37 +9,30 @@ import MicroEntreprise from './MicroEntreprise'
import Salarié from './Salarié'
import SchemeComparaison from './SchemeComparaison'
-const SocialSecurityRoutes = () => {
- const paths = sitePaths()
- return (
- <>
-
-
-
-
-
-
-
-
-
-
- >
- )
-}
+const SocialSecurityRoutes = ({ sitePaths }) => (
+ <>
+
+
+
+
+
+
+
+
+
+ >
+)
-export default SocialSecurityRoutes
+export default withSitePaths(SocialSecurityRoutes)