From 190c8307f9166e7d3821196f6126f38a807445d9 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Mon, 4 Feb 2019 10:22:24 +0100 Subject: [PATCH] :bug: fix la question du CA qui ne se posait plus --- source/Provider.js | 61 +++++++++---------- .../simulationConfigs/assimilé.yaml | 2 +- .../simulationConfigs/auto-entrepreneur.yaml | 2 +- .../simulationConfigs/indépendant.yaml | 2 +- .../rémunération-dirigeant.yaml | 6 +- .../components/simulationConfigs/salarié.yaml | 2 +- source/engine/generateQuestions.js | 36 ++++++++--- source/selectors/analyseSelectors.js | 1 + 8 files changed, 66 insertions(+), 46 deletions(-) diff --git a/source/Provider.js b/source/Provider.js index 6769e8fcf..4cf23e5a3 100644 --- a/source/Provider.js +++ b/source/Provider.js @@ -1,18 +1,18 @@ -import SetCSSColour from 'Components/utils/SetCssColour'; -import { ThemeColoursProvider } from 'Components/utils/withColours'; -import { SitePathProvider } from 'Components/utils/withSitePaths'; -import { TrackerProvider } from 'Components/utils/withTracker'; -import createHistory from 'history/createBrowserHistory'; -import i18next from 'i18next'; -import React, { PureComponent } from 'react'; -import { I18nextProvider } from 'react-i18next'; -import { Provider } from 'react-redux'; -import { Router } from 'react-router-dom'; -import reducers from 'Reducers/rootReducer'; -import { applyMiddleware, compose, createStore } from 'redux'; -import { enableBatching } from 'redux-batched-actions'; -import thunk from 'redux-thunk'; -import { getIframeOption, inIframe } from './utils'; +import SetCSSColour from 'Components/utils/SetCssColour' +import { ThemeColoursProvider } from 'Components/utils/withColours' +import { SitePathProvider } from 'Components/utils/withSitePaths' +import { TrackerProvider } from 'Components/utils/withTracker' +import createHistory from 'history/createBrowserHistory' +import i18next from 'i18next' +import React, { PureComponent } from 'react' +import { I18nextProvider } from 'react-i18next' +import { Provider as ReduxProvider } from 'react-redux' +import { Router } from 'react-router-dom' +import reducers from 'Reducers/rootReducer' +import { applyMiddleware, compose, createStore } from 'redux' +import { enableBatching } from 'redux-batched-actions' +import thunk from 'redux-thunk' +import { getIframeOption, inIframe } from './utils' const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose @@ -33,7 +33,7 @@ if ( }) } -export default class Layout extends PureComponent { +export default class Provider extends PureComponent { constructor(props) { super(props) this.history = createHistory({ @@ -56,27 +56,26 @@ export default class Layout extends PureComponent { enableBatching(reducers), this.props.initialStore, storeEnhancer - ) - console.log(this.props.initialStore, this.store.getState()) + ) this.props.onStoreCreated && this.props.onStoreCreated(this.store) } render() { return ( // If IE < 11 display nothing - - - - - - - - <>{this.props.children} - - - - + + + + + + + + <>{this.props.children} + + + + - + ) } } diff --git a/source/components/simulationConfigs/assimilé.yaml b/source/components/simulationConfigs/assimilé.yaml index e9b83520e..993056eb7 100644 --- a/source/components/simulationConfigs/assimilé.yaml +++ b/source/components/simulationConfigs/assimilé.yaml @@ -9,7 +9,7 @@ questions à l'affiche: Charges: entreprise . charges situation: - auto-entrepreneur: non + autoentrepreneur: non indépendant: non contrat salarié: oui contrat salarié . assimilé salarié: oui diff --git a/source/components/simulationConfigs/auto-entrepreneur.yaml b/source/components/simulationConfigs/auto-entrepreneur.yaml index 03e135edb..3d757223f 100644 --- a/source/components/simulationConfigs/auto-entrepreneur.yaml +++ b/source/components/simulationConfigs/auto-entrepreneur.yaml @@ -11,7 +11,7 @@ questions à l'affiche: Commerçant, artisan, ou libéral ?: entreprise . catégorie d'activité situation: - auto-entrepreneur: oui + autoentrepreneur: oui indépendant: non contrat salarié: non période: année diff --git a/source/components/simulationConfigs/indépendant.yaml b/source/components/simulationConfigs/indépendant.yaml index 508984b96..080879745 100644 --- a/source/components/simulationConfigs/indépendant.yaml +++ b/source/components/simulationConfigs/indépendant.yaml @@ -12,6 +12,6 @@ questions à l'affiche: situation: indépendant: oui - auto-entrepreneur: non + autoentrepreneur: non contrat salarié: non période: année diff --git a/source/components/simulationConfigs/rémunération-dirigeant.yaml b/source/components/simulationConfigs/rémunération-dirigeant.yaml index 2cf9ed94b..9bd3f204c 100644 --- a/source/components/simulationConfigs/rémunération-dirigeant.yaml +++ b/source/components/simulationConfigs/rémunération-dirigeant.yaml @@ -16,17 +16,17 @@ situation: branches: - nom: Auto-entrepreneur situation: - auto-entrepreneur: oui + autoentrepreneur: oui indépendant: non contrat salarié: non - nom: Indépendant situation: indépendant: oui - auto-entrepreneur: non + autoentrepreneur: non contrat salarié: non - nom: Assimilé salarié situation: - auto-entrepreneur: non + autoentrepreneur: non indépendant: non contrat salarié: oui contrat salarié . assimilé salarié: oui diff --git a/source/components/simulationConfigs/salarié.yaml b/source/components/simulationConfigs/salarié.yaml index 2a8fa9c48..2540ab145 100644 --- a/source/components/simulationConfigs/salarié.yaml +++ b/source/components/simulationConfigs/salarié.yaml @@ -14,5 +14,5 @@ situation: contrat salarié: oui contrat salarié . assimilé salarié: non indépendant: non - auto-entrepreneur: non + autoentrepreneur: non période: mois diff --git a/source/engine/generateQuestions.js b/source/engine/generateQuestions.js index aa367db01..e1d8d267b 100644 --- a/source/engine/generateQuestions.js +++ b/source/engine/generateQuestions.js @@ -1,11 +1,31 @@ -import formValueTypes from 'Components/conversation/formValueTypes'; -import Input from 'Components/conversation/Input'; -import Question from 'Components/conversation/Question'; -import SelectGéo from 'Components/conversation/select/SelectGéo'; -import SelectAtmp from 'Components/conversation/select/SelectTauxRisque'; -import { add, countBy, descend, flatten, fromPairs, head, identity, is, keys, map, mergeWith, pair, pick, prop, reduce, sortWith, toPairs, unless, values } from 'ramda'; -import React from 'react'; -import { findRuleByDottedName, queryRule } from './rules'; +import formValueTypes from 'Components/conversation/formValueTypes' +import Input from 'Components/conversation/Input' +import Question from 'Components/conversation/Question' +import SelectGéo from 'Components/conversation/select/SelectGéo' +import SelectAtmp from 'Components/conversation/select/SelectTauxRisque' +import { + add, + countBy, + descend, + flatten, + fromPairs, + head, + identity, + is, + keys, + map, + mergeWith, + pair, + pick, + prop, + reduce, + sortWith, + toPairs, + unless, + values +} from 'ramda' +import React from 'react' +import { findRuleByDottedName, queryRule } from './rules' /* COLLECTE DES VARIABLES MANQUANTES diff --git a/source/selectors/analyseSelectors.js b/source/selectors/analyseSelectors.js index 03a1ccd21..5fcd97123 100644 --- a/source/selectors/analyseSelectors.js +++ b/source/selectors/analyseSelectors.js @@ -246,6 +246,7 @@ export let nextStepsSelector = createSelector( ], (mv, questions) => { let nextSteps = getNextSteps(mv) + console.log(nextSteps, questions) if (questions && questions.blacklist) { return difference(nextSteps, questions.blacklist)