🐛 Correction de l'affichage de l'explication

pull/138/head
mama 2017-12-07 19:31:06 +01:00
parent dda23c5a90
commit c91c13dc1a
3 changed files with 6 additions and 4 deletions

View File

@ -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 <section id="explanation">{this.renderExplanation(targetRules)}</section>
}
renderExplanation(targetRules) {
if (!isEmpty(intersection(targetRules, salaries))) return <ResultsGrid /> // 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 <Rule /> sections ?
if (!isEmpty(intersection(pluck('name', targetRules), salaries))) return <ResultsGrid /> // 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 <Rule /> sections ?
if (targetRules.length > 1)
return <p>Cliquez sur les lignes de résultat ci-dessus pour les comprendre</p>

View File

@ -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 {
}}
/>
<Results />
<Explanation targetRules={R.path(['analysis', 'targets'], this.props)}/>
{done && <Explanation targetRules={R.path(['analysis', 'targets'], this.props)}/>}
</div>
)
}

View File

@ -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 (
<div>