aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/DomainFacet-test.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/__snapshots__/DomainFacet-test.tsx.snap7
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/utils.ts1
4 files changed, 16 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx b/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx
index 2b62fbeccbb..1a52f8c80c5 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx
@@ -96,7 +96,9 @@ export default class DomainFacet extends React.PureComponent<Props> {
typeof item === 'string' ? (
<span className="facet search-navigator-facet facet-category" key={item}>
<span className="facet-name">
- {translate('component_measures.facet_category', item)}
+ {!this.props.hasOverview && item === 'overall_category'
+ ? translate('component_measures.facet_category', item, 'estimated')
+ : translate('component_measures.facet_category', item)}
</span>
</span>
) : (
diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/DomainFacet-test.tsx b/server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/DomainFacet-test.tsx
index 1c90ccf475e..310ec53bcab 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/DomainFacet-test.tsx
+++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/DomainFacet-test.tsx
@@ -82,6 +82,11 @@ it('should render without overview', () => {
).toBe(false);
});
+it('should use "estimated" label for overall measures ', () => {
+ const wrapper = shallow(<DomainFacet {...PROPS} hasOverview={false} />);
+ expect(wrapper.find('.facet-name').map(w => w.text())).toMatchSnapshot();
+});
+
it('should not display subtitles of new measures if there is none', () => {
const domain = {
name: 'Reliability',
diff --git a/server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/__snapshots__/DomainFacet-test.tsx.snap b/server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/__snapshots__/DomainFacet-test.tsx.snap
index 0a4c85967f1..25deb6dc14a 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/__snapshots__/DomainFacet-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/__snapshots__/DomainFacet-test.tsx.snap
@@ -441,3 +441,10 @@ exports[`should not display subtitles of new measures if there is none, even on
</FacetItemsList>
</FacetBox>
`;
+
+exports[`should use "estimated" label for overall measures 1`] = `
+Array [
+ "component_measures.facet_category.new_code_category",
+ "component_measures.facet_category.overall_category.estimated",
+]
+`;
diff --git a/server/sonar-web/src/main/js/apps/component-measures/utils.ts b/server/sonar-web/src/main/js/apps/component-measures/utils.ts
index 7c2eb9cf1ff..12884e3046e 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/utils.ts
+++ b/server/sonar-web/src/main/js/apps/component-measures/utils.ts
@@ -163,6 +163,7 @@ export function hasFullMeasures(branch?: BranchLike) {
export function getMeasuresPageMetricKeys(metrics: { [key: string]: Metric }, branch?: BranchLike) {
if (!hasFullMeasures(branch)) {
return [
+ 'coverage',
'new_coverage',
'new_lines_to_cover',
'new_uncovered_lines',