From 61e2ebb38521254ff7de567beca8e9d29bd812a3 Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Fri, 29 Sep 2017 22:59:20 +0200 Subject: [PATCH] =?UTF-8?q?:bug:=20Permettre=20d'acc=C3=A9der=20aux=20page?= =?UTF-8?q?s=20r=C3=A8gles=20depuis=20des=20variables=20qualifi=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/rule/Rule.js | 4 ++-- source/engine/traverse.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/components/rule/Rule.js b/source/components/rule/Rule.js index c29d821aa..ffe286451 100644 --- a/source/components/rule/Rule.js +++ b/source/components/rule/Rule.js @@ -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 { diff --git a/source/engine/traverse.js b/source/engine/traverse.js index fc71e87db..5ffc03896 100644 --- a/source/engine/traverse.js +++ b/source/engine/traverse.js @@ -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), /*