diff --git a/source/components/RulePage.js b/source/components/RulePage.js
index 0f1472a2e..e52675516 100644
--- a/source/components/RulePage.js
+++ b/source/components/RulePage.js
@@ -1,24 +1,20 @@
import { goBackToSimulation } from 'Actions/actions'
import { ScrollToTop } from 'Components/utils/Scroll'
-import { encodeRuleName } from 'Engine/rules'
import {
decodeRuleName,
- findRuleByDottedName,
- findRulesByName
+ findRuleByDottedName
} from 'Engine/rules.js'
-import { compose, head } from 'ramda'
+import { compose } from 'ramda'
import React from 'react'
import emoji from 'react-easy-emoji'
import { Trans } from 'react-i18next'
import { connect } from 'react-redux'
-import { Link, Redirect } from 'react-router-dom'
+import { Redirect } from 'react-router-dom'
import {
flatRulesSelector,
noUserInputSelector,
situationBranchNameSelector
} from 'Selectors/analyseSelectors'
-import { capitalise0 } from '../utils'
-import Namespace from './rule/Namespace'
import Rule from './rule/Rule'
import './RulePage.css'
import SearchButton from './SearchButton'
@@ -47,22 +43,10 @@ export default compose(
)
}
- if (decodedRuleName.includes(' . ')) {
- if (!findRuleByDottedName(flatRules, decodedRuleName))
- return
+ if (!findRuleByDottedName(flatRules, decodedRuleName))
+ return
- return renderRule(decodedRuleName)
- }
-
- let rules = findRulesByName(flatRules, decodedRuleName)
- if (!rules.length) return
- if (rules.find(({ ns }) => ns == null)) return renderRule(decodedRuleName)
- if (rules.length > 1)
- return (
-
- )
- let dottedName = head(rules).dottedName
- return renderRule(dottedName)
+ return renderRule(decodedRuleName)
})
const BackToSimulation = compose(
@@ -80,22 +64,3 @@ const BackToSimulation = compose(
)
}
)
-
-let DisambiguateRuleQuery = ({ rules, flatRules, name }) => (
-
-
{capitalise0(name)}
-
-
- Plusieurs règles de la base ont ce nom. Laquelle voulez-vous afficher ?
-
-
-
- {rules.map(({ dottedName, ns, title }) => (
- -
-
- {title}
-
- ))}
-
-
-)
diff --git a/source/components/SearchBar.js b/source/components/SearchBar.js
index 5294b3919..badbba945 100644
--- a/source/components/SearchBar.js
+++ b/source/components/SearchBar.js
@@ -84,7 +84,7 @@ function SearchBar({
to={
sitePaths.documentation.index +
'/' +
- encodeRuleName(rule.name)
+ encodeRuleName(rule.dottedName)
}>
{rule.title || capitalise0(rule.name)}
diff --git a/source/sites/mon-entreprise.fr/pages/Documentation/RulesList.js b/source/sites/mon-entreprise.fr/pages/Documentation/RulesList.js
index 4bc979c9c..0f6d73fd6 100644
--- a/source/sites/mon-entreprise.fr/pages/Documentation/RulesList.js
+++ b/source/sites/mon-entreprise.fr/pages/Documentation/RulesList.js
@@ -1,13 +1,12 @@
import { React, T } from 'Components'
import SearchBar from 'Components/SearchBar'
-import { connect } from 'react-redux'
+import { useSelector } from 'react-redux'
import 'react-select/dist/react-select.css'
import { flatRulesSelector } from 'Selectors/analyseSelectors'
import './RulesList.css'
-export default connect(state => ({
- flatRules: flatRulesSelector(state)
-}))(function RulesList({ flatRules }) {
+export default function RulesList() {
+ const flatRules = useSelector(flatRulesSelector)
return (
@@ -16,4 +15,4 @@ export default connect(state => ({
)
-})
+}