From 03c4bc584d43cecfdf371c02b1f2624e19413579 Mon Sep 17 00:00:00 2001 From: stanislavh Date: Tue, 5 Dec 2023 11:22:12 +0100 Subject: [PATCH] SONAR-21135 Do not display old severity in the list of custom rules --- .../components/RuleDetailsCustomRules.tsx | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx index 074adafaf0f..6993e3a0c53 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx @@ -31,11 +31,9 @@ import { import { sortBy } from 'lodash'; import * as React from 'react'; import ConfirmButton from '../../../components/controls/ConfirmButton'; -import IssueSeverityIcon from '../../../components/icon-mappers/IssueSeverityIcon'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { getRuleUrl } from '../../../helpers/urls'; import { useDeleteRuleMutation, useSearchRulesQuery } from '../../../queries/rules'; -import { IssueSeverity } from '../../../types/issues'; import { Rule, RuleDetails } from '../../../types/types'; import CustomRuleButton from './CustomRuleButton'; @@ -44,11 +42,11 @@ interface Props { ruleDetails: RuleDetails; } -const COLUMN_COUNT = 3; -const COLUMN_COUNT_WITH_EDIT_PERMISSIONS = 4; +const COLUMN_COUNT = 2; +const COLUMN_COUNT_WITH_EDIT_PERMISSIONS = 3; export default function RuleDetailsCustomRules(props: Readonly) { - const { ruleDetails } = props; + const { ruleDetails, canChange } = props; const rulesSearchParams = { f: 'name,severity,params', template_key: ruleDetails.key, @@ -84,13 +82,14 @@ export default function RuleDetailsCustomRules(props: Readonly) { {sortBy(rules, (rule) => rule.name).map((rule) => ( ))} @@ -118,15 +117,6 @@ function RuleListItem( - - - {translate('severity', rule.severity)} - - {rule.params -- 2.39.5