🐛 ⚙️ Oubli de court circuit au niveau des ruleProps

pull/117/head
mama 2017-10-24 19:47:16 +02:00
parent 572806a59d
commit dba0bc5838
1 changed files with 12 additions and 4 deletions

View File

@ -430,20 +430,28 @@ export let treatRuleRoot = (rules, rule) => {
return { ...evaluated, nodeValue, isApplicable }
}
let collectMissing = ({
formule,
isApplicable,
'non applicable si': notApplicable,
'applicable si': applicable
}) => {
let condMissing = R.chain(applyOrEmpty(collectNodeMissing))([
notApplicable,
applicable
]),
let
condMissing =
val(notApplicable) === true
? []
: val(applicable) === false
? []
: [
...applyOrEmpty(collectNodeMissing)(notApplicable),
...applyOrEmpty(collectNodeMissing)(applicable)
],
collectInFormule = isApplicable !== false,
formMissing = applyOrEmpty(() =>
applyOrEmpty(collectNodeMissing)(formule)
)(collectInFormule)
return R.concat(condMissing, formMissing)
}