- {displayedRule.nodeValue ? (
+ {!isNil(displayedRule.nodeValue) && (
- {displayedRule.format === 'euros' || displayedRule.formule
- ? Intl.NumberFormat(language, {
- style: 'currency',
- currency: 'EUR'
- }).format(displayedRule.nodeValue)
- : typeof displayedRule.nodeValue !== 'object'
- ? displayedRule.nodeValue
- : null}
+ {['euros', 'pourcentage'].includes(ruleFormat) ||
+ displayedRule.formule ? (
+
+ {displayedRule.nodeValue}
+
+ ) : typeof displayedRule.nodeValue !== 'object' ? (
+ displayedRule.nodeValue
+ ) : null}
- ) : null}
-
+ )}
{displayedRule.defaultValue != null &&
typeof displayedRule.defaultValue !== 'object' ? (
Valeur par défaut : {displayedRule.defaultValue}
) : null}
-
+ {!valuesToShow && (
+
+
+ Simuler ma situation
+
+
+ )}
{//flatRule.question &&
// Fonctionnalité intéressante, à implémenter correctement
false && }
diff --git a/source/components/rule/RuleValueVignette.css b/source/components/rule/RuleValueVignette.css
index eb3d805fc..9c5c027e5 100644
--- a/source/components/rule/RuleValueVignette.css
+++ b/source/components/rule/RuleValueVignette.css
@@ -15,7 +15,6 @@
}
.Rule-value {
transition: background 0.8s;
- font-size: 105%;
}
.Rule-value .unsatisfied {
font-style: italic;
diff --git a/source/components/simulationConfigs/assimilé.yaml b/source/components/simulationConfigs/assimilé.yaml
index 3ab314aec..05462463d 100644
--- a/source/components/simulationConfigs/assimilé.yaml
+++ b/source/components/simulationConfigs/assimilé.yaml
@@ -2,10 +2,10 @@ objectifs:
- entreprise . chiffre d'affaires
- revenu disponible
-questions:
+questions:
- entreprise . charges
-questions à l'affiche:
+questions à l'affiche:
Charges: entreprise . charges
situation:
@@ -16,3 +16,4 @@ situation:
contrat salarié . CDD: non
contrat salarié . temps partiel: non
contrat salarié . ATMP . taux réduit: oui
+ période: année
diff --git a/source/components/simulationConfigs/indépendant.yaml b/source/components/simulationConfigs/indépendant.yaml
index f2f270c8e..a55522311 100644
--- a/source/components/simulationConfigs/indépendant.yaml
+++ b/source/components/simulationConfigs/indépendant.yaml
@@ -2,11 +2,11 @@ objectifs:
- entreprise . chiffre d'affaires
- revenu disponible
-questions:
+questions:
- entreprise . charges
- entreprise . catégorie d'activité
-questions à l'affiche:
+questions à l'affiche:
Charges: entreprise . charges
Commerçant, artisan, ou libéral ?: entreprise . catégorie d'activité
@@ -14,3 +14,4 @@ situation:
indépendant: oui
micro entreprise: non
contrat salarié: non
+ période: année
diff --git a/source/components/simulationConfigs/micro-entreprise.yaml b/source/components/simulationConfigs/micro-entreprise.yaml
index 6a78ebd38..53c8ae3d3 100644
--- a/source/components/simulationConfigs/micro-entreprise.yaml
+++ b/source/components/simulationConfigs/micro-entreprise.yaml
@@ -2,11 +2,11 @@ objectifs:
- entreprise . chiffre d'affaires
- revenu disponible
-questions:
+questions:
- entreprise . catégorie d'activité
- entreprise . charges
-questions à l'affiche:
+questions à l'affiche:
Charges: entreprise . charges
Commerçant, artisan, ou libéral ?: entreprise . catégorie d'activité
@@ -14,3 +14,4 @@ situation:
micro entreprise: oui
indépendant: non
contrat salarié: non
+ période: année
diff --git a/source/components/simulationConfigs/rémunération-dirigeant.yaml b/source/components/simulationConfigs/rémunération-dirigeant.yaml
index 231078c8f..fb9f1296f 100644
--- a/source/components/simulationConfigs/rémunération-dirigeant.yaml
+++ b/source/components/simulationConfigs/rémunération-dirigeant.yaml
@@ -9,6 +9,9 @@ questions:
- entreprise . catégorie d'activité
- entreprise . charges
+situation:
+ période: année
+
branches:
- nom: Micro-entreprise
situation:
diff --git a/source/components/simulationConfigs/salarié.yaml b/source/components/simulationConfigs/salarié.yaml
index 83383ca43..a23231b29 100644
--- a/source/components/simulationConfigs/salarié.yaml
+++ b/source/components/simulationConfigs/salarié.yaml
@@ -4,7 +4,7 @@ objectifs:
- contrat salarié . salaire . net
- contrat salarié . salaire . net après impôt
-questions à l'affiche:
+questions à l'affiche:
CDD: contrat salarié . CDD
Cadre: contrat salarié . statut cadre
Temps partiel: contrat salarié . temps partiel
@@ -15,3 +15,4 @@ situation:
contrat salarié . assimilé salarié: non
indépendant: non
micro entreprise: non
+ période: mois
diff --git a/source/components/simulationConfigs/withSimulationConfig.js b/source/components/simulationConfigs/withSimulationConfig.js
index be33ffada..0d0304a09 100644
--- a/source/components/simulationConfigs/withSimulationConfig.js
+++ b/source/components/simulationConfigs/withSimulationConfig.js
@@ -14,8 +14,10 @@ export default config => SimulationComponent =>
constructor(props) {
super(props)
if (config !== props.config) {
- props.resetSimulation()
props.setSimulationConfig(config)
+ if (props.config) {
+ props.resetSimulation()
+ }
}
}
render() {
diff --git a/source/components/ui/AnimatedTargetValue.css b/source/components/ui/AnimatedTargetValue.css
index e4f074e8d..9ecd8fdc2 100644
--- a/source/components/ui/AnimatedTargetValue.css
+++ b/source/components/ui/AnimatedTargetValue.css
@@ -1,5 +1,4 @@
.Rule-value {
- font-size: 105%;
position: relative;
}
diff --git a/source/components/ui/Button/button.css b/source/components/ui/Button/button.css
index 6669b494b..1487bf25e 100644
--- a/source/components/ui/Button/button.css
+++ b/source/components/ui/Button/button.css
@@ -119,6 +119,12 @@
font-family: inherit;
margin: 0;
}
+.ui__.link-button img[src*='twemoji.maxcdn'],
+.ui__.dashed-button img[src*='twemoji.maxcdn'],
+.ui__.text-button img[src*='twemoji.maxcdn'] {
+ margin-right: 0.2rem !important;
+ margin-left: 0.2rem !important;
+}
.ui__.link-button,
.ui__.text-button {
text-decoration: none;
diff --git a/source/components/ui/Montant.js b/source/components/ui/Montant.js
index 9784c15d7..d857d45b0 100644
--- a/source/components/ui/Montant.js
+++ b/source/components/ui/Montant.js
@@ -6,7 +6,7 @@ import './Montant.css'
type Props = {
children: number,
className?: string,
- type: 'currency' | 'percent',
+ type: 'currency' | 'percent' | 'decimal',
style?: { [string]: string },
numFractionDigit?: number
} & ConnectedProps
diff --git a/source/components/ui/animate.js b/source/components/ui/animate.js
index bae7718dc..bfd9b0292 100644
--- a/source/components/ui/animate.js
+++ b/source/components/ui/animate.js
@@ -46,6 +46,34 @@ export const fromBottom = ({
))}
)
+export const fromTop = ({
+ children,
+ config = configPresets.stiff,
+ style: inheritedStyle = {},
+ delay = 0
+}: Props) => (
+ i)}
+ native={true}
+ delay={delay}
+ config={config}
+ leave={{ opacity: 0, y: 50 }}
+ from={{ opacity: 0, y: -50 }}
+ to={{ opacity: 1, y: 0 }}>
+ {/* eslint-disable-next-line react/display-name */}
+ {React.Children.map(children, (item, i) => ({ y, ...style }) => (
+ `translate3d(0, ${y}px,0)`),
+ ...style,
+ ...inheritedStyle
+ }}>
+ {item}
+
+ ))}
+
+)
export const leftToRight = ({
children,
@@ -122,5 +150,6 @@ export default {
appear,
fromBottom,
leftToRight,
+ fromTop,
fadeIn
}
diff --git a/source/components/ui/index.css b/source/components/ui/index.css
index 2838009e5..17ce7adbe 100644
--- a/source/components/ui/index.css
+++ b/source/components/ui/index.css
@@ -40,8 +40,10 @@ button {
.ui__.container {
width: 100%;
max-width: 800px;
- margin: auto;
- padding: 0 0.6rem;
+ margin-right: auto;
+ margin-left: auto;
+ padding-right: 0.6rem;
+ padding-left: 0.6rem;
}
.ui__.container .ui__.full-width {
margin: 0 calc((800px - 100vw) / 2);
diff --git a/source/règles/base.yaml b/source/règles/base.yaml
index 469e121fa..ecf0ebf16 100644
--- a/source/règles/base.yaml
+++ b/source/règles/base.yaml
@@ -2782,6 +2782,7 @@
- espace: indépendant . cotisations
nom: retraite complémentaire
période: année
+ format: euros
notes: Pour les professions libérales, nous avons retenu un des 8 régimes de retraite, celui de la CIPAV, la caisse interprofessionnelle.
formule:
variations:
diff --git a/source/selectors/analyseSelectors.js b/source/selectors/analyseSelectors.js
index 3401e8c85..2d4751616 100644
--- a/source/selectors/analyseSelectors.js
+++ b/source/selectors/analyseSelectors.js
@@ -118,7 +118,7 @@ export let validatedSituationBranchesSelector = createSituationBrancheSelector(
validatedSituationSelector
)
-let situationsWithDefaultsSelector = createSelector(
+export let situationsWithDefaultsSelector = createSelector(
[ruleDefaultsSelector, situationBranchesSelector],
(defaults, situations) =>
mapOrApply(situation => ({ ...defaults, ...situation }), situations)
diff --git a/source/sites/embauche.gouv.fr/App.js b/source/sites/embauche.gouv.fr/App.js
index a060d3ee8..5303706f4 100644
--- a/source/sites/embauche.gouv.fr/App.js
+++ b/source/sites/embauche.gouv.fr/App.js
@@ -7,6 +7,7 @@ import { defaultTracker } from 'Components/utils/withTracker'
import createRavenMiddleware from 'raven-for-redux'
import Raven from 'raven-js'
import React, { Component } from 'react'
+import { withNamespaces } from 'react-i18next'
import { Redirect, Route, Switch } from 'react-router-dom'
import 'Ui/index.css'
import Provider from '../../Provider'
@@ -28,6 +29,7 @@ import Integration from './pages/Integration'
import IntegrationTest from './pages/IntegrationTest'
import Route404 from './pages/Route404'
import RulesList from './pages/RulesList'
+import sitePaths from './sitePaths'
if (process.env.NODE_ENV === 'production') {
Raven.config(
@@ -56,42 +58,53 @@ if (process.env.NODE_ENV === 'production') {
}
const middlewares = [createRavenMiddleware(Raven), trackDomainActions(tracker)]
-
+const paths = sitePaths()
class EmbaucheRoute extends Component {
render() {
return (
{!inIframe() && }
{inIframe() && }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
{inIframe() && }
)
}
}
+const RouterSwitch = withNamespaces()(() => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+))
let ExportedApp = EmbaucheRoute
diff --git a/source/sites/embauche.gouv.fr/sitePaths.js b/source/sites/embauche.gouv.fr/sitePaths.js
new file mode 100644
index 000000000..31f4db991
--- /dev/null
+++ b/source/sites/embauche.gouv.fr/sitePaths.js
@@ -0,0 +1,13 @@
+/* @flow */
+import { constructSitePaths } from '../../utils'
+
+const sitePath = constructSitePaths('', {
+ index: '',
+ documentation: {
+ index: '/documentation',
+ exemples: '/exemples'
+ },
+ contact: '/contact'
+})
+
+export default () => sitePath
diff --git a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Salarié.js b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Salarié.js
index b8240fc1a..9036fe188 100644
--- a/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Salarié.js
+++ b/source/sites/mycompanyinfrance.fr/pages/SocialSecurity/Salarié.js
@@ -16,11 +16,13 @@ export let SalarySimulation = withSitePaths(({ sitePaths }) => (
Vous pouvez maintenant concrétiser votre projet d'embauche.
-
-
- Connaître les démarches
-
-
+ {sitePaths.démarcheEmbauche && (
+
+
+ Connaître les démarches
+
+
+ )}
>
}
targets={}
diff --git a/source/sites/mycompanyinfrance.fr/sitePaths.js b/source/sites/mycompanyinfrance.fr/sitePaths.js
index d154dd95e..423872c3c 100644
--- a/source/sites/mycompanyinfrance.fr/sitePaths.js
+++ b/source/sites/mycompanyinfrance.fr/sitePaths.js
@@ -1,6 +1,7 @@
/* @flow */
-import { map, reduce, toPairs, zipObj } from 'ramda'
+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 = [
@@ -88,21 +89,6 @@ const constructLocalizedSitePath = language => {
}
})
}
-const constructSitePaths = (
- root: string,
- { index, ...sitePaths }: { index: string }
-) => ({
- index: root + index,
- ...map(
- value =>
- typeof value === 'string'
- ? root + index + value
- : typeof value === 'function'
- ? (...args) => root + index + value(...args)
- : constructSitePaths(root + index, value),
- sitePaths
- )
-})
let sitePath = constructLocalizedSitePath()
i18n.on('languageChanged', () => {
diff --git a/source/utils.js b/source/utils.js
index 13314c1e8..8e4749603 100644
--- a/source/utils.js
+++ b/source/utils.js
@@ -82,3 +82,19 @@ export function softCatch(
}
}
}
+
+export const constructSitePaths = (
+ root: string,
+ { index, ...sitePaths }: { index: string }
+) => ({
+ index: root + index,
+ ...map(
+ value =>
+ typeof value === 'string'
+ ? root + index + value
+ : typeof value === 'function'
+ ? (...args) => root + index + value(...args)
+ : constructSitePaths(root + index, value),
+ sitePaths
+ )
+})
diff --git a/yarn.lock b/yarn.lock
index ed28ad6c0..3773e05b7 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1521,7 +1521,7 @@ babel-polyfill@^6.26.0:
core-js "^2.5.0"
regenerator-runtime "^0.10.5"
-babel-runtime@6.x, babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.25.0, babel-runtime@^6.26.0:
+babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.25.0, babel-runtime@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
dependencies:
@@ -6880,13 +6880,6 @@ raw-loader@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa"
-rc-progress@^2.2.6:
- version "2.2.6"
- resolved "https://registry.yarnpkg.com/rc-progress/-/rc-progress-2.2.6.tgz#d5d07c07333b352a9ef13230c5940e13336c1e62"
- dependencies:
- babel-runtime "6.x"
- prop-types "^15.5.8"
-
rc@^1.0.1, rc@^1.1.6, rc@^1.2.7:
version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"