diff options
Diffstat (limited to 'server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx index 6021f6e382c..faec9a9c928 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsTooltipsContentCoverage.tsx @@ -20,6 +20,7 @@ import * as React from 'react'; import { translate } from '../../helpers/l10n'; import { formatMeasure } from '../../helpers/measures'; +import { MetricKey } from '../../types/metrics'; import { MeasureHistory } from '../../types/project-activity'; export interface GraphsTooltipsContentCoverageProps { @@ -28,13 +29,10 @@ export interface GraphsTooltipsContentCoverageProps { tooltipIdx: number; } -export default function GraphsTooltipsContentCoverage({ - addSeparator, - measuresHistory, - tooltipIdx, -}: GraphsTooltipsContentCoverageProps) { - const uncovered = measuresHistory.find((measure) => measure.metric === 'uncovered_lines'); - const coverage = measuresHistory.find((measure) => measure.metric === 'coverage'); +export default function GraphsTooltipsContentCoverage(props: GraphsTooltipsContentCoverageProps) { + const { addSeparator, measuresHistory, tooltipIdx } = props; + const uncovered = measuresHistory.find((measure) => measure.metric === MetricKey.uncovered_lines); + const coverage = measuresHistory.find((measure) => measure.metric === MetricKey.coverage); if (!uncovered || !uncovered.history[tooltipIdx] || !coverage || !coverage.history[tooltipIdx]) { return null; } |