🐛 Corrige le calcul de l'avancement

pull/206/head
Laurent Bossavit 2018-04-24 10:45:31 +02:00
parent bdbad664cf
commit bda764680a
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
import formValueTypes from 'Components/conversation/formValueTypes'
import { rules, findRuleByName } from 'Engine/rules'
import { propEq, isEmpty, curry } from 'ramda'
import { propEq, isEmpty, curry, values } from 'ramda'
import './TargetSelection.css'
import BlueButton from './BlueButton'
import { Field, reduxForm, formValueSelector, change } from 'redux-form'
@ -115,8 +115,8 @@ export default class TargetSelection extends Component {
let computeRatio = (mvt, name) =>
!isEmpty(mvt) &&
mvt.current[name].missingVariables.length /
mvt.initial[name].missingVariables.length
values(mvt.current[name]).length /
values(mvt.initial[name]).length
let Header = ({
conversationStarted,

View File

@ -49,7 +49,7 @@ import {
missingVariables: {variable: [objectives]}
*/
export let collectMissingVariablesByTarget = targets => fromPairs(targets.map(target => [target, target.missingVariables]))
export let collectMissingVariablesByTarget = targets => fromPairs(targets.map(target => [target.dottedName, target.missingVariables]))
export let getNextSteps = missingVariablesByTarget => {
let impact = ([, count]) => count