Merge pull request #74 from sgmap/enums-are-inputs

Admettre qu'on ne peut pas calculer les 'une possibilité' ;)
pull/84/head
Laurent Bossavit 2017-10-04 17:14:39 +02:00 committed by GitHub
commit a2994559a2
1 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,8 @@ export default class Algorithm extends React.Component {
showValues: true
}
render(){
let {traversedRule: rule, showValues} = this.props
let {traversedRule: rule, showValues} = this.props,
ruleWithoutFormula = !rule['formule'] || rule.formule.explanation['une possibilité']
return (
<div id="algorithm">
<section id="rule-rules" className={classNames({showValues})}>
@ -34,7 +35,7 @@ export default class Algorithm extends React.Component {
}}
<section id="formule">
<h2>Calcul</h2>
{rule['formule'] ? makeJsx(rule['formule']) : <RuleWithoutFormula />}
{ruleWithoutFormula ? <RuleWithoutFormula /> : makeJsx(rule['formule'])}
</section>
</section>
</div>