import React, { Component } from 'react' // import {findRuleByName} from '../engine/rules.js' import {analyseSituation} from '../engine/traverse' import './Rule.css' import JSONTree from 'react-json-tree' import R from 'ramda' import PageTypeIcon from './PageTypeIcon' import {connect} from 'react-redux' import {formValueSelector} from 'redux-form' import mockSituation from '../engine/mockSituation.yaml' // situationGate function useful for testing : let testingSituationGate = v => // eslint-disable-line no-unused-vars R.path(v.split('.'))(mockSituation) @connect(state => ({ situationGate: name => formValueSelector('conversation')(state, name) })) export default class Rule extends Component { render() { let { params: {name}, situationGate } = this.props, rule = analyseSituation( situationGate ).find(R.propEq('name', name)) if (!rule) { this.props.router.push('/404') return null } return (
{rule.description}
Pourquoi cette règle me concerne ? Comment est-elle calculée ? C'est pas très lisible pour l'instant, mais ça le deviendra
*/}