From edd8f87fcdeeb5678910820309d58a964569aaba Mon Sep 17 00:00:00 2001 From: Mael Date: Wed, 14 Mar 2018 16:58:12 +0100 Subject: [PATCH] Amelioration des messages guides --- source/components/ProgressTip.js | 10 +++------- source/components/TargetSelection.js | 8 ++++---- source/components/conversation/Conversation.js | 1 - source/components/rule/RuleValueVignette.js | 2 +- source/engine/traverse.js | 7 ++++--- source/entry.dev.js | 2 +- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/source/components/ProgressTip.js b/source/components/ProgressTip.js index 3c0bc0ea1..37f54c546 100644 --- a/source/components/ProgressTip.js +++ b/source/components/ProgressTip.js @@ -33,13 +33,9 @@ export default class ProgressTip extends Component {
{nbQuestions != 0 && (

- {nbQuestions === 1 ? ( - Une dernière question ! - ) : ( - - Il reste moins de {{ nbQuestions }} questions. - - )} + {nbQuestions === 1 + ? 'Une dernière question !' + : `Moins de ${nbQuestions} questions`} - {this.state.activeInput ? ( + {!this.state.activeInput || !this.props.targets.length ? ( +

Entrez un salaire mensuel

+ ) : (
{this.props.selectingTargets ? ( !this.props.conversationVisible && ( -

Cochez un ou plusieurs objectifs

+

Que voulez-vous affiner ?

) ) : ( <> @@ -79,8 +81,6 @@ export default class TargetSelection extends Component { )}
- ) : ( -

Entrez un salaire mensuel

)} ) diff --git a/source/components/conversation/Conversation.js b/source/components/conversation/Conversation.js index 80f7f6cd4..9e6422377 100644 --- a/source/components/conversation/Conversation.js +++ b/source/components/conversation/Conversation.js @@ -58,7 +58,6 @@ export default class Conversation extends Component { reinitialise, textColourOnWhite } = this.props - console.log(this.props) return ( <> {!isEmpty(foldedSteps) && ( diff --git a/source/components/rule/RuleValueVignette.js b/source/components/rule/RuleValueVignette.js index 22f9a5c5b..76c80d8a4 100644 --- a/source/components/rule/RuleValueVignette.js +++ b/source/components/rule/RuleValueVignette.js @@ -24,7 +24,7 @@ export let RuleValue = ({ value }) => let unsatisfied = value == null, irrelevant = value == 0 let [className, text] = irrelevant - ? ['irrelevant', 'Non applicable'] + ? ['irrelevant', '0'] : unsatisfied ? ['unsatisfied', ''] : ['figure', humanFigure(0)(value) + ' €'] diff --git a/source/engine/traverse.js b/source/engine/traverse.js index f584556fa..483cedd56 100644 --- a/source/engine/traverse.js +++ b/source/engine/traverse.js @@ -473,7 +473,7 @@ export let treatRuleRoot = (rules, rule) => { : anyNull([e['non applicable si'], e['applicable si']]) ? null : !val(e['non applicable si']) && - undefOrTrue(val(e['applicable si'])) + undefOrTrue(val(e['applicable si'])) }, nodeValue = computeRuleValue(formuleValue, isApplicable) @@ -596,16 +596,17 @@ export let getTargets = (target, rules) => { let multiSimulation = path(['simulateur', 'objectifs'])(target) let targets = multiSimulation ? // On a un simulateur qui définit une liste d'objectifs - multiSimulation + multiSimulation .map(n => disambiguateRuleReference(rules, target, n)) .map(n => findRuleByDottedName(rules, n)) : // Sinon on est dans le cas d'une simple variable d'objectif - [target] + [target] return targets } export let parseAll = flatRules => { + console.log('parseall') let treatOne = rule => treatRuleRoot(flatRules, rule) return map(treatOne, flatRules) } diff --git a/source/entry.dev.js b/source/entry.dev.js index 6a2e1150d..2f4efd00f 100644 --- a/source/entry.dev.js +++ b/source/entry.dev.js @@ -20,7 +20,7 @@ let initialStore = { let enhancer = compose( applyMiddleware(debounceFormChangeActions()), - DevTools.instrument() + DevTools.instrument({ maxAge: 10 }) ) let initialRules = lang == 'en' ? rules : rulesFr