+ )
+ }
+}
diff --git a/source/components/conversation/FoldedSteps.js b/source/components/conversation/FoldedSteps.js
index f7114832b..36997056a 100644
--- a/source/components/conversation/FoldedSteps.js
+++ b/source/components/conversation/FoldedSteps.js
@@ -1,7 +1,4 @@
-import { getInputComponent } from 'Engine/generateQuestions'
-//import styles from './.css'
// css in conversation.Css
-import { isEmpty, map, pick } from 'ramda'
import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
import { connect } from 'react-redux'
@@ -9,19 +6,17 @@ import { animateScroll, Element, scroller } from 'react-scroll'
import { reset } from 'redux-form'
import { resetSimulation } from '../../actions'
import { LinkButton, SimpleButton } from '../ui/Button'
-import withColours from '../withColours'
+import { isEmpty } from 'ramda'
+
+import { flatRulesSelector } from 'Selectors/analyseSelectors'
+import FoldedStep from './FoldedStep'
-@withColours
@connect(
- pick([
- 'currentQuestion',
- 'foldedSteps',
- 'situationGate',
- 'targetNames',
- 'nextSteps',
- 'analysis',
- 'flatRules'
- ]),
+ state => ({
+ foldedSteps: state.conversationSteps.foldedSteps,
+ targetNames: state.targetNames,
+ flatRules: flatRulesSelector(state)
+ }),
{
resetSimulation,
resetForm: () => reset('conversation')
@@ -34,7 +29,7 @@ export default class FoldedSteps extends Component {
this.props.resetForm()
}
render() {
- let { foldedSteps, targetNames, flatRules } = this.props
+ let { foldedSteps } = this.props
if (isEmpty(foldedSteps || [])) return null
return (
@@ -45,16 +40,14 @@ export default class FoldedSteps extends Component {
Tout effacer
- {map(
- getInputComponent({ unfolded: false })(flatRules, targetNames),
- foldedSteps
- )}
+ {foldedSteps.map(dottedName => (
+
+ ))}
)
}
}
-@withColours
@connect(state => ({
foldedSteps: state.foldedSteps,
conversationStarted: state.conversationStarted
diff --git a/source/components/conversation/FormDecorator.js b/source/components/conversation/FormDecorator.js
index 62e1df74f..37a98b521 100644
--- a/source/components/conversation/FormDecorator.js
+++ b/source/components/conversation/FormDecorator.js
@@ -1,14 +1,11 @@
import React, { Component } from 'react'
-import { Trans, translate } from 'react-i18next'
+import { translate } from 'react-i18next'
import classNames from 'classnames'
import { connect } from 'react-redux'
import { Field, change } from 'redux-form'
import { stepAction } from '../../actions'
-import { capitalise0 } from '../../utils'
import Explicable from 'Components/conversation/Explicable'
-import { LinkButton} from 'Components/ui/Button'
import IgnoreStepButton from './IgnoreStepButton'
-import { findRuleByDottedName } from 'Engine/rules'
export let buildValidationFunction = valueType => {
let validator = valueType ? valueType.validator : {},
@@ -27,7 +24,7 @@ export var FormDecorator = formType => RenderField =>
@connect(
//... this helper directly to the redux state to avoid passing more props
state => ({
- situationGate: state.situationGate,
+ themeColours: state.themeColours,
flatRules: state.flatRules
}),
dispatch => ({
@@ -43,20 +40,6 @@ export var FormDecorator = formType => RenderField =>
helpVisible: false
}
render() {
- let { unfolded } = this.props
-
- return (
-
-
- {/* Une étape déjà répondue est marquée 'folded'. Dans ce dernier cas, un résumé
- de la réponse est affiché */}
- {unfolded ? this.renderUnfolded() : this.renderFolded()}
-