⚙️ Explication simple du mécanisme synchronisation

pull/337/head
Mael 2018-09-07 16:56:36 +02:00
parent 3489fa7b34
commit 1cbc931df7
2 changed files with 16 additions and 3 deletions

View File

@ -79,3 +79,11 @@ export class Leaf extends Component {
)
}
}
export function SimpleRuleLink({ rule: { dottedName, title, name } }) {
return (
<Link to={'../règle/' + encodeRuleName(dottedName)}>
<span className="name">{title || capitalise0(name)}</span>
</Link>
)
}

View File

@ -1,6 +1,5 @@
import {
reduce,
reduced,
path,
mergeWith,
objOf,
@ -33,7 +32,7 @@ import {
import React from 'react'
import { Trans } from 'react-i18next'
import { anyNull, val } from './traverse-common-functions'
import { Node } from './mecanismViews/common'
import { Node, SimpleRuleLink } from './mecanismViews/common'
import {
makeJsx,
evaluateNode,
@ -992,7 +991,13 @@ export let mecanismSynchronisation = (recurse, k, v) => {
return {
explanation: { ...v, API: recurse(v.API) },
evaluate,
jsx: (nodeValue, explanation) => <span>{nodeValue}</span>,
jsx: function Synchronisation(nodeValue, explanation) {
return (
<p>
Obtenu à partir de la saisie <SimpleRuleLink rule={explanation.API} />
</p>
)
},
category: 'mecanism',
name: 'synchronisation'
}