Harmonisation des URL de /règle

pull/157/head
mama 2018-02-13 18:51:53 +01:00
parent 26c331d679
commit 2aef3d0fad
3 changed files with 13 additions and 6 deletions

View File

@ -62,8 +62,10 @@ export class SearchBar extends React.Component {
let { selectedOption } = this.state
if (selectedOption != null) {
this.props.finally()
return <Redirect to={'/règle/' + selectedOption.dottedName} />
this.props.finally && this.props.finally()
return (
<Redirect to={'/règle/' + encodeRuleName(selectedOption.dottedName)} />
)
}
return (
<>

View File

@ -45,11 +45,11 @@ export class Node extends React.Component {
}
// Un élément du graphe de calcul qui a une valeur interprétée (à afficher)
export let Leaf = ({ classes, name, value }) => (
export let Leaf = ({ classes, dottedName, name, value }) => (
<span className={classNames(classes, 'leaf')}>
{name && (
{dottedName && (
<span className="nodeHead">
<Link to={'/règle/' + encodeRuleName(name)}>
<Link to={'/règle/' + encodeRuleName(dottedName)}>
<span className="name">
{capitalise0(name)}
<NodeValuePointer data={value} />

View File

@ -183,7 +183,12 @@ let fillVariableNode = (rules, rule, filter) => parseResult => {
dottedName = disambiguateRuleReference(rules, rule, variablePartialName)
let jsx = nodeValue => (
<Leaf classes="variable" name={fragments.join(' . ')} value={nodeValue} />
<Leaf
classes="variable"
name={fragments.join(' . ')}
dottedName={dottedName}
value={nodeValue}
/>
)
return {