]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-16365 Fix rule description section ordering
authorPhilippe Perrin <philippe.perrin@sonarsource.com>
Wed, 11 May 2022 16:01:31 +0000 (18:01 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 13 May 2022 20:02:49 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsDescription.tsx

index 10aee08b32f7869bda37f28f5e27bd9f3d054134..a9fa8cdb79552fe5f13e93b253c18a9ac75dd25f 100644 (file)
@@ -123,8 +123,8 @@ export default class RuleDetailsDescription extends React.PureComponent<Props, S
 
   sortedDescriptionSections(ruleDetails: RuleDetails) {
     return sortBy(
-      ruleDetails.descriptionSections,
-      s => SECTION_ORDER[s.key] || Object.keys(SECTION_ORDER).length
+      ruleDetails.descriptionSections?.filter(section => SECTION_ORDER[section.key] !== undefined),
+      s => SECTION_ORDER[s.key]
     );
   }