diff --git a/package.json b/package.json
index 156bb8217..99d0c89df 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,6 @@
"ramda": "^0.23.0",
"react": "^15.5.4",
"react-dom": "^15.5.4",
- "react-json-tree": "^0.10.0",
"react-redux": "^5.0.3",
"react-router-dom": "^4.1.1",
"reduce-reducers": "^0.1.2",
diff --git a/source/components/Rule.js b/source/components/Rule.js
index 385d7696e..bd0fac1a0 100644
--- a/source/components/Rule.js
+++ b/source/components/Rule.js
@@ -137,38 +137,3 @@ class Algorithm extends React.Component {
)
}
}
-
-let JSONView = ({o, rootKey}) => (
-
- ''}
- theme={theme}
- hideRoot={true}
- shouldExpandNode={() => true}
- data={rootKey ? {[rootKey]: o} : o}
- />
-
-)
-
-
-
-var theme = {
- scheme: 'atelier forest',
- author: 'bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest)',
- base00: '#1b1918',
- base01: '#2c2421',
- base02: '#68615e',
- base03: '#766e6b',
- base04: '#9c9491',
- base05: '#a8a19f',
- base06: '#e6e2e0',
- base07: '#f1efee',
- base08: '#f22c40',
- base09: '#df5320',
- base0A: '#d5911a',
- base0B: '#5ab738',
- base0C: '#00ad9c',
- base0D: '#407ee7',
- base0E: '#6666ea',
- base0F: '#c33ff3'
-}
diff --git a/source/engine/generateQuestions.js b/source/engine/generateQuestions.js
index 7ffdb61a5..538bc269a 100644
--- a/source/engine/generateQuestions.js
+++ b/source/engine/generateQuestions.js
@@ -82,6 +82,8 @@ let buildNextSteps = analysedSituation => {
analysedSituation
)
+ console.log('missingVariables', missingVariables)
+
/*
Parmi les variables manquantes, certaines sont citées dans une règle de type 'une possibilité'.
**On appelle ça des groupes de type 'variante'.**
@@ -181,14 +183,6 @@ export let generateGridQuestions = missingVariables => R.pipe(
)(relevantVariants)
})
)
-
- //TODO reintroduce objectives
- // {
- // objectives: R.pipe(
- // R.chain(v => missingVariables[variant.dottedName + ' . ' + v]),
- // R.uniq()
- // )(variant['une possibilité'])
- // }
)
export let generateSimpleQuestions = missingVariables => R.pipe(
diff --git a/source/engine/rules.js b/source/engine/rules.js
index 7aed618c3..63e2a9c36 100644
--- a/source/engine/rules.js
+++ b/source/engine/rules.js
@@ -128,11 +128,11 @@ let collectNodeMissingVariables = (root, source=root, results=[]) => {
export let collectMissingVariables = (groupMethod='groupByMissingVariable') => analysedSituation =>
R.pipe(
R.unless(R.is(Array), R.of),
- R.chain( v =>
+ R.chain( v => console.log('v', v) ||
R.pipe(
collectNodeMissingVariables,
R.flatten,
- R.map(mv => [v.variableName, mv])
+ R.map(mv => [v.dottedName, mv])
)(v)
),
//groupBy missing variable but remove mv from value, it's now in the key
diff --git a/source/engine/traverse.js b/source/engine/traverse.js
index 5873ed8c1..88ba115b9 100644
--- a/source/engine/traverse.js
+++ b/source/engine/traverse.js
@@ -58,9 +58,8 @@ let fillVariableNode = (rule, situationGate) => (parseResult) => {
let
{fragments} = parseResult,
variablePartialName = fragments.join(' . '),
- variableName = disambiguateRuleReference(rule, variablePartialName),
- // y = console.log('variableName', variableName),
- variable = findRuleByDottedName(variableName),
+ dottedName = disambiguateRuleReference(rule, variablePartialName),
+ variable = findRuleByDottedName(dottedName),
variableIsRule = variable.formule != null,
//TODO perf : mettre un cache sur les variables !
// On le fait pas pour l'instant car ça peut compliquer les fonctionnalités futures
@@ -70,15 +69,14 @@ let fillVariableNode = (rule, situationGate) => (parseResult) => {
variable
),
- nodeValue = variableIsRule ? parsedRule.nodeValue : evaluateVariable(situationGate, variableName, variable.format),
- missingVariables = variableIsRule ? [] : (nodeValue == null ? [variableName] : [])
+ nodeValue = variableIsRule ? parsedRule.nodeValue : evaluateVariable(situationGate, dottedName, variable.format),
+ missingVariables = variableIsRule ? [] : (nodeValue == null ? [dottedName] : [])
return {
nodeValue,
category: 'variable',
fragments: fragments,
- variableName,
- name: variableName,
+ dottedName,
type: 'boolean | numeric',
explanation: parsedRule,
missingVariables,
diff --git a/source/reducers.js b/source/reducers.js
index df980dca1..6e1b6af1f 100644
--- a/source/reducers.js
+++ b/source/reducers.js
@@ -7,7 +7,7 @@ import { euro, months } from './components/conversation/formValueTypes.js'
import { EXPLAIN_VARIABLE, POINT_OUT_OBJECTIVES} from './actions'
import R from 'ramda'
-import {findGroup, findRuleByDottedName, parentName, collectMissingVariables, findVariantsAndRecords} from './engine/rules'
+import {findGroup, findRuleByDottedName, parentName, findVariantsAndRecords} from './engine/rules'
import {reduceSteps, generateGridQuestions, generateSimpleQuestions} from './engine/generateQuestions'