diff options
author | stanislavh <stanislav.honcharov@sonarsource.com> | 2023-12-05 11:22:12 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-12-08 20:03:05 +0000 |
commit | 03c4bc584d43cecfdf371c02b1f2624e19413579 (patch) | |
tree | 93eebbc2c7b3cda832f25454b5403b376491f88a /server | |
parent | 631ea82186d2093a77ac9d76129c742cddc72518 (diff) | |
download | sonarqube-03c4bc584d43cecfdf371c02b1f2624e19413579.tar.gz sonarqube-03c4bc584d43cecfdf371c02b1f2624e19413579.zip |
SONAR-21135 Do not display old severity in the list of custom rules
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsCustomRules.tsx | 22 |
1 files 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<Props>) { - 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<Props>) { <Table className="sw-my-6" id="coding-rules-detail-custom-rules" - columnCount={props.canChange ? COLUMN_COUNT_WITH_EDIT_PERMISSIONS : COLUMN_COUNT} + columnCount={canChange ? COLUMN_COUNT_WITH_EDIT_PERMISSIONS : COLUMN_COUNT} + columnWidths={canChange ? ['auto', 'auto', '1%'] : ['auto', 'auto']} > {sortBy(rules, (rule) => rule.name).map((rule) => ( <RuleListItem key={rule.key} rule={rule} - editable={props.canChange} + editable={canChange} onDelete={handleRuleDelete} /> ))} @@ -119,15 +118,6 @@ function RuleListItem( </ContentCell> <ContentCell> - <IssueSeverityIcon - className="sw-mr-1" - severity={rule.severity as IssueSeverity} - aria-hidden - /> - {translate('severity', rule.severity)} - </ContentCell> - - <ContentCell> <UnorderedList className="sw-mt-0"> {rule.params ?.filter((param) => param.defaultValue) |