🐛 Corrige l'affichage de certaines pages de doc

Fixes #1132
pull/1135/head
Maxime Quandalle 2020-09-27 11:05:08 +01:00
parent aa0e42de78
commit 4748d33a71
1 changed files with 10 additions and 6 deletions

View File

@ -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<Name extends string>({
dottedName: Name
engine: Engine<Name>
}) {
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
}