From c91c13dc1a828204697bad287f60318b1a829f00 Mon Sep 17 00:00:00 2001 From: mama Date: Thu, 7 Dec 2017 19:31:06 +0100 Subject: [PATCH] :bug: Correction de l'affichage de l'explication --- source/components/Explanation.js | 3 ++- source/components/Simulateur.js | 5 +++-- source/components/TargetSelection.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/components/Explanation.js b/source/components/Explanation.js index 388f76451..f7b12299c 100644 --- a/source/components/Explanation.js +++ b/source/components/Explanation.js @@ -4,6 +4,7 @@ import { salaries } from 'Components/TargetSelection' import { isEmpty, intersection, head } from 'ramda' import Rule from 'Components/rule/Rule' import './Explanation.css' +import {pluck} from 'ramda' export default class Explanation extends Component { render() { @@ -14,7 +15,7 @@ export default class Explanation extends Component { return
{this.renderExplanation(targetRules)}
} renderExplanation(targetRules) { - if (!isEmpty(intersection(targetRules, salaries))) return // Problem if targetRules is [salaire net, aides] the Explanation will not explain 'aides'. The user will have to click on Aides to understand it. Should we display a list of sections ? + if (!isEmpty(intersection(pluck('name', targetRules), salaries))) return // Problem if targetRules is [salaire net, aides] the Explanation will not explain 'aides'. The user will have to click on Aides to understand it. Should we display a list of sections ? if (targetRules.length > 1) return

Cliquez sur les lignes de résultat ci-dessus pour les comprendre

diff --git a/source/components/Simulateur.js b/source/components/Simulateur.js index 9a2a140cb..7a16e05ff 100644 --- a/source/components/Simulateur.js +++ b/source/components/Simulateur.js @@ -72,7 +72,8 @@ export default class extends Component { situationGate, themeColours, targetNames, - inputInversions + inputInversions, + done } = this.props, reinitalise = () => { ReactPiwik.push(['trackEvent', 'restart', '']) @@ -116,7 +117,7 @@ export default class extends Component { }} /> - + {done && } ) } diff --git a/source/components/TargetSelection.js b/source/components/TargetSelection.js index 1dfd1fe9c..f00f20f1f 100644 --- a/source/components/TargetSelection.js +++ b/source/components/TargetSelection.js @@ -34,7 +34,7 @@ export default class TargetSelection extends Component { } renderOutputList() { - let popularTargets = [...salaries, 'aides'].map(curry(findRuleByName)(rules)), + let popularTargets = [...salaries, 'aides employeur différées'].map(curry(findRuleByName)(rules)), { targets } = this.state return (