From 4748d33a7171554e113b5693846327075719b6b7 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Sun, 27 Sep 2020 11:05:08 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Corrige=20l'affichage=20de=20cer?= =?UTF-8?q?taines=20pages=20de=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1132 --- publicodes/source/components/rule/Rule.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/publicodes/source/components/rule/Rule.tsx b/publicodes/source/components/rule/Rule.tsx index 3cba6d4d6..25751eae6 100644 --- a/publicodes/source/components/rule/Rule.tsx +++ b/publicodes/source/components/rule/Rule.tsx @@ -1,7 +1,8 @@ -import React, { useState } from 'react' +import React from 'react' import { Trans } from 'react-i18next' import Engine from '../..' import { formatValue } from '../../format' +import { ruleWithDedicatedDocumentationPage } from '../../ruleUtils' import { serializeUnit } from '../../units' import { Markdown } from '../Markdown' import { RuleLinkWithContext } from '../RuleLink' @@ -112,11 +113,14 @@ function AssociatedRules({ dottedName: Name engine: Engine }) { - const namespaceRules = Object.keys(engine.getParsedRules()).filter( - ruleDottedName => - ruleDottedName.startsWith(dottedName) && - ruleDottedName.split(' . ').length === dottedName.split(' . ').length + 1 - ) + const namespaceRules = Object.keys(engine.getParsedRules()) + .filter( + ruleDottedName => + ruleDottedName.startsWith(dottedName) && + ruleDottedName.split(' . ').length === + dottedName.split(' . ').length + 1 + ) + .filter(rule => !ruleWithDedicatedDocumentationPage(rule)) if (!namespaceRules.length) { return null }