From fb3e559e9f808f3e2a2cfd34ba6d021a93ebe8d9 Mon Sep 17 00:00:00 2001 From: Mael Date: Mon, 7 Jan 2019 10:29:40 +0100 Subject: [PATCH] =?UTF-8?q?:art:=20On=20cache=20les=20r=C3=A9sultats=20ava?= =?UTF-8?q?nt=20la=201=C3=A8re=20saisie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/ComparativeSimulation.js | 17 +++++++++++++---- source/components/ComparativeTargets.js | 6 ++++-- source/selectors/analyseSelectors.js | 8 ++++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/source/components/ComparativeSimulation.js b/source/components/ComparativeSimulation.js index 2eb60e7d3..9ebd8b07a 100644 --- a/source/components/ComparativeSimulation.js +++ b/source/components/ComparativeSimulation.js @@ -8,7 +8,8 @@ import ComparativeTargets from 'Components/ComparativeTargets' import './ComparativeSimulation.css' import { nextStepsSelector, - analysisWithDefaultsSelector + analysisWithDefaultsSelector, + noUserInputSelector } from 'Selectors/analyseSelectors' import simulationConfig from './simulateur-rémunération-dirigeant.yaml' import { createMarkdownDiv } from 'Engine/marked' @@ -18,7 +19,8 @@ export default compose( connect(state => ({ previousAnswers: state.conversationSteps.foldedSteps, noNextSteps: nextStepsSelector(state, simulationConfig).length == 0, - analyses: analysisWithDefaultsSelector(state, simulationConfig) + analyses: analysisWithDefaultsSelector(state, simulationConfig), + noUserInput: noUserInputSelector(state) })) )( class extends React.Component { @@ -26,7 +28,13 @@ export default compose( displayAnswers: false } render() { - let { colours, noNextSteps, previousAnswers, analyses } = this.props + let { + colours, + noNextSteps, + previousAnswers, + analyses, + noUserInput + } = this.props return (
@@ -58,7 +66,8 @@ export default compose(

Vous avez atteint l'estimation la plus précise.

)} - + +
) diff --git a/source/components/ComparativeTargets.js b/source/components/ComparativeTargets.js index 41eb19f39..caa55187f 100644 --- a/source/components/ComparativeTargets.js +++ b/source/components/ComparativeTargets.js @@ -41,10 +41,12 @@ export default compose( analyses, target, setSituationBranch, - chiffreAffaires + chiffreAffaires, + hide } = this.props + console.log(hide) return ( -
+

{target.title}

    diff --git a/source/selectors/analyseSelectors.js b/source/selectors/analyseSelectors.js index 8afb6b49a..48eb20573 100644 --- a/source/selectors/analyseSelectors.js +++ b/source/selectors/analyseSelectors.js @@ -23,7 +23,8 @@ import { isEmpty, pick, reduce, - intersection + intersection, + dissoc } from 'ramda' import { getFormValues } from 'redux-form' import { createSelector, createSelectorCreator, defaultMemoize } from 'reselect' @@ -63,7 +64,10 @@ export let situationSelector = createDeepEqualSelector( export let noUserInputSelector = createSelector( [situationSelector], - situation => !situation || isEmpty(situation) + situation => + !situation || + console.log(situation) || + isEmpty(dissoc('période', situation)) ) export let formattedSituationSelector = createSelector(