diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/overview/events')
3 files changed, 3 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/events/PreviewGraphTooltips.js b/server/sonar-web/src/main/js/apps/overview/events/PreviewGraphTooltips.js index 982320a3a7c..3ee59922574 100644 --- a/server/sonar-web/src/main/js/apps/overview/events/PreviewGraphTooltips.js +++ b/server/sonar-web/src/main/js/apps/overview/events/PreviewGraphTooltips.js @@ -21,6 +21,7 @@ import React from 'react'; import BubblePopup from '../../../components/common/BubblePopup'; import FormattedDate from '../../../components/ui/FormattedDate'; import PreviewGraphTooltipsContent from './PreviewGraphTooltipsContent'; +import { getLocalizedMetricName } from '../../../helpers/l10n'; import type { Metric } from '../types'; import type { Serie } from '../../../components/charts/AdvancedTimeline'; @@ -68,7 +69,7 @@ export default class PreviewGraphTooltips extends React.PureComponent { <PreviewGraphTooltipsContent key={serie.name} serie={serie} - translatedName={metric && metric.custom ? metric.name : serie.translatedName} + translatedName={metric ? getLocalizedMetricName(metric) : serie.translatedName} value={this.props.formatValue(point.y)} /> ); diff --git a/server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js b/server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js index 10a9a0864cb..1b37aaf3691 100644 --- a/server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js +++ b/server/sonar-web/src/main/js/apps/overview/events/__tests__/PreviewGraphTooltips-test.js @@ -24,7 +24,6 @@ import PreviewGraphTooltips from '../PreviewGraphTooltips'; const SERIES_OVERVIEW = [ { name: 'code_smells', - translatedName: 'Code Smells', style: 1, data: [ { @@ -39,7 +38,6 @@ const SERIES_OVERVIEW = [ }, { name: 'bugs', - translatedName: 'Bugs', style: 0, data: [ { @@ -54,7 +52,6 @@ const SERIES_OVERVIEW = [ }, { name: 'vulnerabilities', - translatedName: 'Vulnerabilities', style: 2, data: [ { @@ -70,6 +67,7 @@ const SERIES_OVERVIEW = [ ]; const METRICS = [ + { key: 'code_smells', name: 'Code Smells', type: 'INT' }, { key: 'bugs', name: 'Bugs', type: 'INT' }, { key: 'vulnerabilities', name: 'Vulnerabilities', type: 'INT', custom: true } ]; diff --git a/server/sonar-web/src/main/js/apps/overview/events/__tests__/__snapshots__/PreviewGraphTooltips-test.js.snap b/server/sonar-web/src/main/js/apps/overview/events/__tests__/__snapshots__/PreviewGraphTooltips-test.js.snap index e8090585551..455d71d0124 100644 --- a/server/sonar-web/src/main/js/apps/overview/events/__tests__/__snapshots__/PreviewGraphTooltips-test.js.snap +++ b/server/sonar-web/src/main/js/apps/overview/events/__tests__/__snapshots__/PreviewGraphTooltips-test.js.snap @@ -41,7 +41,6 @@ exports[`should render correctly 1`] = ` ], "name": "code_smells", "style": 1, - "translatedName": "Code Smells", } } translatedName="Code Smells" @@ -62,7 +61,6 @@ exports[`should render correctly 1`] = ` ], "name": "bugs", "style": 0, - "translatedName": "Bugs", } } translatedName="Bugs" @@ -83,7 +81,6 @@ exports[`should render correctly 1`] = ` ], "name": "vulnerabilities", "style": 2, - "translatedName": "Vulnerabilities", } } translatedName="Vulnerabilities" |