🐛 Permettre d'accéder aux pages règles depuis des variables qualifiées

pull/47/head
Laurent Bossavit 2017-09-29 22:59:20 +02:00
parent 98cd9db2ce
commit 61e2ebb385
2 changed files with 4 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import {connect} from 'react-redux'
import {formValueSelector} from 'redux-form'
import R from 'ramda'
import './Rule.css'
import {rules, decodeRuleName} from 'Engine/rules.js'
import {rules, decodeRuleName, nameLeaf} from 'Engine/rules.js'
import mockSituation from 'Engine/mockSituation.yaml'
import {analyseSituation} from 'Engine/traverse'
import {START_CONVERSATION} from '../../actions'
@ -36,7 +36,7 @@ export default class Rule extends Component {
}
}
setRule(name){
this.rule = analyseSituation(rules, decodeRuleName(name))(this.props.situationGate)
this.rule = analyseSituation(rules, nameLeaf(decodeRuleName(name)))(this.props.situationGate)
}
componentWillMount(){
let {

View File

@ -449,6 +449,8 @@ export let analyseTopDown = (rules, rootVariable) => situationGate => {
//On fait ainsi pour chaque règle de la base.
parsedRules = R.map(treatOne,rules),
// TODO: we should really make use of namespaces at this level, in particular
// setRule in Rule.js needs to get smarter and pass dottedName
rootRule = findRuleByName(parsedRules, rootVariable),
/*