From 16f5e4aee6a44f74d4f947022edaec55f8c4f95b Mon Sep 17 00:00:00 2001 From: Mael Date: Tue, 24 Apr 2018 18:30:16 +0200 Subject: [PATCH] :bug: Avancement par objectif correctement calcule --- source/components/TargetSelection.js | 72 ++++++++++++++++------------ source/containers/App.dev.js | 1 + source/i18n.js | 7 +-- source/reducers.js | 43 ++++++++++------- 4 files changed, 72 insertions(+), 51 deletions(-) diff --git a/source/components/TargetSelection.js b/source/components/TargetSelection.js index 2a557d2e9..0773dd8ca 100644 --- a/source/components/TargetSelection.js +++ b/source/components/TargetSelection.js @@ -51,16 +51,23 @@ export default class TargetSelection extends Component { }}> {this.renderOutputList()} - {!this.firstEstimationComplete && -

Entrez un salaire mensuel

- } + {!this.firstEstimationComplete && ( +

+ Entrez un salaire mensuel +

+ )} {this.firstEstimationComplete && !conversationStarted && (

- Estimation approximative
- pour une situation par défaut (CDI non cadre). + + Estimation approximative + {' '} +
+ + pour une situation par défaut (CDI non cadre). +

Affiner le calcul @@ -115,8 +122,34 @@ export default class TargetSelection extends Component { let computeRatio = (mvt, name) => !isEmpty(mvt) && - values(mvt.current[name]).length / - values(mvt.initial[name]).length + values(mvt.current[name]).length / values(mvt.initial[name]).length + +let ProgressCircle = ({ activeInput, s, missingVariablesByTarget }) => { + let isActiveInput = activeInput === s.dottedName, + ratio = isActiveInput + ? null + : computeRatio(missingVariablesByTarget, s.dottedName) + + return ( + + {ratio === 0 ? ( +