diff options
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResults.tsx | 26 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/helpers/testMocks.ts | 8 |
2 files changed, 17 insertions, 17 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> ); } diff --git a/server/sonar-web/src/main/js/helpers/testMocks.ts b/server/sonar-web/src/main/js/helpers/testMocks.ts index 1b593839bdd..53fc466a14a 100644 --- a/server/sonar-web/src/main/js/helpers/testMocks.ts +++ b/server/sonar-web/src/main/js/helpers/testMocks.ts @@ -505,13 +505,7 @@ export function mockCompareResult(overrides: Partial<CompareResponse> = {}): Com ], modified: [ { - cleanCodeAttributeCategory: CleanCodeAttributeCategory.Consistent, - impacts: [ - { - softwareQuality: SoftwareQuality.Maintainability, - severity: SoftwareImpactSeverity.Low, - }, - ], + impacts: [], key: 'java:S1698', name: '== and != should not be used when equals is overridden', left: { params: {}, severity: 'MINOR' }, |