]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13033 Add donut chart to overview
authorJeremy Davis <jeremy.davis@sonarsource.com>
Fri, 21 Feb 2020 10:32:21 +0000 (11:32 +0100)
committerSonarTech <sonartech@sonarsource.com>
Fri, 21 Feb 2020 19:46:20 +0000 (20:46 +0100)
server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx
server/sonar-web/src/main/js/apps/overview/branches/__tests__/__snapshots__/SecurityHotspotsReviewed-test.tsx.snap

index e50ec18b938b74c884de8a0e57bec326ecc1822d..6b8b6440a314f595c1f96e3f862cc14468c5c976 100644 (file)
@@ -21,6 +21,7 @@ import * as React from 'react';
 import { translate } from 'sonar-ui-common/helpers/l10n';
 import { formatMeasure } from 'sonar-ui-common/helpers/measures';
 import { getLeakValue } from '../../../components/measure/utils';
+import CoverageRating from '../../../components/ui/CoverageRating';
 import { findMeasure } from '../../../helpers/measures';
 import { MetricKey } from '../../../types/metrics';
 
@@ -46,7 +47,10 @@ export default function SecurityHotspotsReviewed(props: SecurityHotspotsReviewed
       {value === undefined ? (
         <span aria-label={translate('no_data')} className="overview-measures-empty-value" />
       ) : (
-        <span className="huge">{formatMeasure(value, 'PERCENT')}</span>
+        <>
+          <CoverageRating value={value} />
+          <span className="huge spacer-left">{formatMeasure(value, 'PERCENT')}</span>
+        </>
       )}
       <span className="big-spacer-left">
         {translate('overview.measures.security_hotspots_reviewed')}
index 725abb11385ba2c3ef2d6362df4c6512a3f01114..161d2b33878399be62741788f592c3462777578e 100644 (file)
@@ -2,8 +2,11 @@
 
 exports[`should render correctly 1`] = `
 <Fragment>
+  <CoverageRating
+    value="1.0"
+  />
   <span
-    className="huge"
+    className="huge spacer-left"
   >
     1.0%
   </span>
@@ -31,8 +34,11 @@ exports[`should render correctly: no measures 1`] = `
 
 exports[`should render correctly: on new code 1`] = `
 <Fragment>
+  <CoverageRating
+    value="1.0"
+  />
   <span
-    className="huge"
+    className="huge spacer-left"
   >
     1.0%
   </span>