Browse Source

SONAR-11364 Display estimated coverage on the measures page

tags/7.5
Stas Vilchik 5 years ago
parent
commit
d167e54bc3

+ 3
- 1
server/sonar-web/src/main/js/apps/component-measures/sidebar/DomainFacet.tsx View File

@@ -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>
) : (

+ 5
- 0
server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/DomainFacet-test.tsx View File

@@ -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',

+ 7
- 0
server/sonar-web/src/main/js/apps/component-measures/sidebar/__tests__/__snapshots__/DomainFacet-test.tsx.snap View File

@@ -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",
]
`;

+ 1
- 0
server/sonar-web/src/main/js/apps/component-measures/utils.ts View File

@@ -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',

+ 1
- 0
sonar-core/src/main/resources/org/sonar/l10n/core.properties View File

@@ -2569,6 +2569,7 @@ component_measures.domain_facets.Complexity.help=How simple or complicated the c

component_measures.facet_category.new_code_category=On new code
component_measures.facet_category.overall_category=Overall
component_measures.facet_category.overall_category.estimated=Estimated after merge
component_measures.facet_category.tests_category=Tests
component_measures.bubble_chart.zoom_level=Current zoom level. Scroll on the chart to zoom or unzoom, click here to reset.


Loading…
Cancel
Save