diff options
author | stanislavh <stanislav.honcharov@sonarsource.com> | 2023-10-09 14:49:53 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-10-10 20:02:45 +0000 |
commit | d2980aff4d6bc9b1a0b6a0e698146aaa916de158 (patch) | |
tree | 501408b10744133d4c7f2e674d80b83222276521 /server/sonar-web/src/main/js/apps/quality-profiles/compare | |
parent | 35d41265d408ef9401a04a5d89c8e88f426880be (diff) | |
download | sonarqube-d2980aff4d6bc9b1a0b6a0e698146aaa916de158.tar.gz sonarqube-d2980aff4d6bc9b1a0b6a0e698146aaa916de158.zip |
SONAR-20547 Add conditional check CC category for security hotspot
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-profiles/compare')
-rw-r--r-- | server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx index 800733aa422..80abc67bffd 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx @@ -233,16 +233,22 @@ function RuleCell({ rule, severity }: Readonly<{ rule: RuleCompare; severity?: s <Link className="sw-ml-1" to={getRulesUrl({ rule_key: rule.key, open: rule.key })}> {rule.name} </Link> - <ul className="sw-mt-3 sw-flex sw-items-center"> - <li> - <CleanCodeAttributePill cleanCodeAttributeCategory={rule.cleanCodeAttributeCategory} /> - </li> - {rule.impacts.map(({ severity, softwareQuality }) => ( - <li key={softwareQuality} className="sw-ml-2"> - <SoftwareImpactPill type="rule" quality={softwareQuality} severity={severity} /> - </li> - ))} - </ul> + {(rule.cleanCodeAttributeCategory || rule.impacts.length > 0) && ( + <ul className="sw-mt-3 sw-flex sw-items-center"> + {rule.cleanCodeAttributeCategory && ( + <li> + <CleanCodeAttributePill + cleanCodeAttributeCategory={rule.cleanCodeAttributeCategory} + /> + </li> + )} + {rule.impacts.map(({ severity, softwareQuality }) => ( + <li key={softwareQuality} className="sw-ml-2"> + <SoftwareImpactPill type="rule" quality={softwareQuality} severity={severity} /> + </li> + ))} + </ul> + )} </div> ); } |