From 44779fb14a70e8e24a7b46a8f31742f39a20b58c Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Wed, 4 Sep 2019 17:26:32 +0200 Subject: [PATCH] :bug: corrige l'ordre des question sur kiwi fix #628 fix #614 --- source/selectors/analyseSelectors.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/selectors/analyseSelectors.js b/source/selectors/analyseSelectors.js index 2b6d2bc78..b009e2039 100644 --- a/source/selectors/analyseSelectors.js +++ b/source/selectors/analyseSelectors.js @@ -14,7 +14,6 @@ import { analyse, analyseMany, parseAll } from 'Engine/traverse' import { add, defaultTo, - propEq, difference, dissoc, equals, @@ -269,7 +268,7 @@ let currentMissingVariablesByTargetSelector = createSelector( } ) -const similarity = rule1 => rule2 => +const similarity = (rule1, rule2) => pipe( map(defaultTo('')), map(split(' . ')), @@ -301,10 +300,11 @@ export let nextStepsSelector = createSelector( nextSteps = difference(nextSteps, blacklist) } - nextSteps = sortBy(similarity(last(foldedSteps)), nextSteps) - if (notPriority) { - nextSteps = sortBy(question => notPriority.indexOf(question), nextSteps) - } + nextSteps = sortBy( + question => + similarity(question, last(foldedSteps)) + notPriority.indexOf(question), + nextSteps + ) return nextSteps }