🐛 corrige l'ordre des question sur kiwi

fix #628
fix #614
pull/650/head
Johan Girod 2019-09-04 17:26:32 +02:00
parent 74c278cb76
commit 44779fb14a
No known key found for this signature in database
GPG Key ID: 9E27B57DA2E8AE12
1 changed files with 6 additions and 6 deletions

View File

@ -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
}