diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2020-02-21 11:32:21 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2020-02-21 20:46:20 +0100 |
commit | aa237a8224a408e4764f25a93c4e9debf8c28ac4 (patch) | |
tree | 81f4d727ae0ba1d87fc0dbce36e71b59c306767b /server | |
parent | 615738314faff9614ad383565854dcb5d327ac0f (diff) | |
download | sonarqube-aa237a8224a408e4764f25a93c4e9debf8c28ac4.tar.gz sonarqube-aa237a8224a408e4764f25a93c4e9debf8c28ac4.zip |
SONAR-13033 Add donut chart to overview
Diffstat (limited to 'server')
2 files changed, 13 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx b/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx index e50ec18b938..6b8b6440a31 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx @@ -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')} diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/__snapshots__/SecurityHotspotsReviewed-test.tsx.snap b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/__snapshots__/SecurityHotspotsReviewed-test.tsx.snap index 725abb11385..161d2b33878 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/__snapshots__/SecurityHotspotsReviewed-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/__snapshots__/SecurityHotspotsReviewed-test.tsx.snap @@ -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> |