diff --git a/source/actions.js b/source/actions.js index d55637aaa..5160d932a 100644 --- a/source/actions.js +++ b/source/actions.js @@ -30,5 +30,3 @@ export function changeThemeColour(colour) {return {type: CHANGE_THEME_COLOUR, co export const EXPLAIN_VARIABLE = 'EXPLAIN_VARIABLE' - -export const POINT_OUT_OBJECTIVES = 'POINT_OUT_OBJECTIVES' diff --git a/source/components/Results.css b/source/components/Results.css index 7c296dd3e..80ba36482 100644 --- a/source/components/Results.css +++ b/source/components/Results.css @@ -135,23 +135,6 @@ width: 100%; } -#results li:not(.pointedOut):hover .rule-box { - background: #ddd; -} -#results li.irrelevant .rule-box { - background: rgba(255, 255, 255, 0.35); -} - -#results li.pointedOut:not(.irrelevant) .rule-name { - color: #4A89DC; -} -#results li.pointedOut .rule-type { - color: #4A89DC; -} - -#results li.pointedOut .rule-box { - border-bottom: .8em solid #4A89DC; -} #results li.number p { color: #4A89DC; font-weight: bold; diff --git a/source/components/Results.js b/source/components/Results.js index edaa9e34a..2e8a85234 100644 --- a/source/components/Results.js +++ b/source/components/Results.js @@ -18,7 +18,6 @@ let humanFigure = decimalDigits => value => fmt(value.toFixed(decimalDigits)) @withRouter @connect( state => ({ - pointedOutObjectives: state.pointedOutObjectives, analysedSituation: state.analysedSituation, conversationStarted: !R.isEmpty(state.form), conversationFirstAnswer: R.path(['form', 'conversation', 'values'])(state), @@ -29,7 +28,6 @@ export default class Results extends Component { render() { let { analysedSituation, - pointedOutObjectives, conversationStarted, conversationFirstAnswer: showResults, situationGate, @@ -70,12 +68,9 @@ export default class Results extends Component { unsatisfied = ruleValue == null, nonApplicableValue = nonApplicable ? nonApplicable.nodeValue : false, irrelevant = nonApplicableValue === true || formuleValue == 0, - number = nonApplicableValue == false && formuleValue != null, - pointedOut = - pointedOutObjectives.find(objective => objective == dottedName) - || R.contains(encodeRuleName(name))(location.pathname) + number = nonApplicableValue == false && formuleValue != null - ;
  • + ;
  • diff --git a/source/components/conversation/FormDecorator.js b/source/components/conversation/FormDecorator.js index 8184028ef..e7521642b 100644 --- a/source/components/conversation/FormDecorator.js +++ b/source/components/conversation/FormDecorator.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' import classNames from 'classnames' import { connect } from 'react-redux' import {Field, change} from 'redux-form' -import {stepAction, POINT_OUT_OBJECTIVES} from '../../actions' +import {stepAction} from '../../actions' import StepAnswer from './StepAnswer' import {capitalise0} from '../../utils' @@ -21,8 +21,7 @@ export var FormDecorator = formType => RenderField => }), dispatch => ({ stepAction: (name, step) => dispatch(stepAction(name, step)), - setFormValue: (field, value) => dispatch(change('conversation', field, value)), - pointOutObjectives: objectives => dispatch({type: POINT_OUT_OBJECTIVES, objectives}) + setFormValue: (field, value) => dispatch(change('conversation', field, value)) }) ) class extends Component { @@ -34,7 +33,6 @@ export var FormDecorator = formType => RenderField => stepAction, themeColours, setFormValue, - pointOutObjectives, /* Une étape déjà répondue est marquée 'folded'. Dans ce dernier cas, un résumé de la réponse est affiché */ unfolded @@ -83,8 +81,7 @@ export var FormDecorator = formType => RenderField => return (
    null} //pointOutObjectives(objectives)} - onMouseLeave={() => pointOutObjectives([])}> + > {this.state.helpVisible && this.renderHelpBox(helpText)}
    {this.renderHeader(unfolded, valueType, human, helpText, wideQuestion, subquestion)} @@ -176,8 +173,5 @@ export var FormDecorator = formType => RenderField => {helpComponent}
    } - componentWillUnmount(){ - this.props.pointOutObjectives([]) - } } diff --git a/source/reducers.js b/source/reducers.js index 90c7ad5a9..76ebf7a7e 100644 --- a/source/reducers.js +++ b/source/reducers.js @@ -7,7 +7,7 @@ import {reducer as formReducer, formValueSelector} from 'redux-form' import {rules, findRuleByName } from 'Engine/rules' import {buildNextSteps} from 'Engine/generateQuestions' import computeThemeColours from 'Components/themeColours' -import { STEP_ACTION, START_CONVERSATION, EXPLAIN_VARIABLE, POINT_OUT_OBJECTIVES, CHANGE_THEME_COLOUR} from './actions' +import { STEP_ACTION, START_CONVERSATION, EXPLAIN_VARIABLE, CHANGE_THEME_COLOUR} from './actions' import {analyseTopDown} from 'Engine/traverse' @@ -32,8 +32,9 @@ export let reduceSteps = (state, action) => { let sim = findRuleByName(flatRules, rootVariable), // Hard assumptions cannot be changed, they are used to specialise a simulator + // before the user sees the first question hardAssumptions = R.pathOr({},['simulateur','hypothèses'],sim), - // Soft assumptions are revealed after the simulation starts, and can be changed + // Soft assumptions are revealed after the simulation ends, and can be changed softAssumptions = R.pathOr({},['simulateur','par défaut'],sim), intermediateSituation = assume(fromConversation, hardAssumptions), completeSituation = assume(intermediateSituation,softAssumptions) @@ -59,7 +60,7 @@ export let reduceSteps = (state, action) => { unfoldedSteps = buildNextSteps(situationGate, flatRules, newState.analysedSituation) // The simulation is "over" - except we can now fill in extra questions - // where the answers were previously given reasonable assumptions + // where the answers were previously given default reasonable assumptions if (unfoldedSteps.length == 0 && !R.isEmpty(softAssumptions)) { let newSituation = intermediateSituation(state), reanalyse = analyseTopDown(flatRules,rootVariable)(newSituation), @@ -108,14 +109,6 @@ function explainedVariable(state = null, {type, variableName=null}) { } } -function pointedOutObjectives(state=[], {type, objectives}) { - switch (type) { - case POINT_OUT_OBJECTIVES: - return objectives - default: - return state - } -} export default reduceReducers( combineReducers({ @@ -136,9 +129,8 @@ export default reduceReducers( themeColours, - explainedVariable, + explainedVariable - pointedOutObjectives, }), // cross-cutting concerns because here `state` is the whole state tree reduceSteps