aboutsummaryrefslogtreecommitdiff
path: root/src/Report.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/Report.js')
-rw-r--r--src/Report.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Report.js b/src/Report.js
index ac7dfac..955c97d 100644
--- a/src/Report.js
+++ b/src/Report.js
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20import React, { Component } from 'react'; 20import React, { Component } from 'react';
21import { Counters, SessionInfo, PackagesCoverage, PackagesSourceCoverage } from './listComponents.js'; 21import { Counters, SessionInfo, GroupsCoverage, PackagesCoverage, GroupsSourceCoverage, PackagesSourceCoverage } from './listComponents.js';
22 22
23export class Report extends Component { 23export class Report extends Component {
24 _renderAppInfo() { 24 _renderAppInfo() {
@@ -37,6 +37,18 @@ export class Report extends Component {
37 ); 37 );
38 } 38 }
39 39
40 _renderCoverageTree() {
41 return this.props.report.group
42 ? (<GroupsCoverage groups={this.props.report.group} />)
43 : (<PackagesCoverage packages={this.props.report.package} />);
44 }
45
46 _renderSourceCoverage() {
47 return this.props.report.group
48 ? (<GroupsSourceCoverage groups={this.props.report.group} sourceSet={this.props.sourceSet} />)
49 : (<PackagesSourceCoverage packages={this.props.report.package} sourceSet={this.props.sourceSet} />);
50 }
51
40 _renderReport() { 52 _renderReport() {
41 return ( 53 return (
42 <div> 54 <div>
@@ -54,12 +66,12 @@ export class Report extends Component {
54 66
55 <section> 67 <section>
56 <h3>Coverage tree</h3> 68 <h3>Coverage tree</h3>
57 <PackagesCoverage packages={this.props.report.package} /> 69 {this._renderCoverageTree()}
58 </section> 70 </section>
59 71
60 <section> 72 <section>
61 <h3>Source coverage</h3> 73 <h3>Source coverage</h3>
62 <PackagesSourceCoverage packages={this.props.report.package} sourceSet={this.props.sourceSet} /> 74 {this._renderSourceCoverage()}
63 </section> 75 </section>
64 </div> 76 </div>
65 ); 77 );