From 6225820c7dbfef629e8ec51a9fe7d4c7de6bde3b Mon Sep 17 00:00:00 2001 From: Mael Date: Fri, 5 Oct 2018 15:48:54 +0000 Subject: [PATCH] =?UTF-8?q?:bug:=20Un=20contr=C3=B4le=20bloquant=20ne=20se?= =?UTF-8?q?=20fait=20que=20sur=20une=20variable=20saisie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C'est un hack pour palier à nos problèmes de performance lors de l'inversion sur des petites valeurs, ex. salaire total = 2. Donc on le limite à une valeur supérieure à 400. --- source/engine/traverse.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/engine/traverse.js b/source/engine/traverse.js index 5f3310276..166365e2d 100644 --- a/source/engine/traverse.js +++ b/source/engine/traverse.js @@ -297,10 +297,13 @@ export let parseAll = flatRules => { } let evaluateControls = blocking => (parsedRules, situationGate) => { - return chain(({ controls }) => + return chain(({ controls, dottedName }) => controls ?.filter( - ({ level }) => (blocking ? level === 'bloquant' : level !== 'bloquant') + ({ level }) => + blocking + ? level === 'bloquant' && situationGate(dottedName) != undefined + : level !== 'bloquant' ) .map(control => ({ ...control,