diff options
Diffstat (limited to 'src/Report.js')
-rw-r--r-- | src/Report.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/Report.js b/src/Report.js new file mode 100644 index 0000000..e79b832 --- /dev/null +++ b/src/Report.js | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * JaCoCo Report Viewer, a web-based coverage report viewer | ||
3 | * Copyright (C) 2018 Pacien TRAN-GIRARD | ||
4 | * Adam NAILI | ||
5 | * | ||
6 | * This program is free software: you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation, either version 3 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
18 | */ | ||
19 | |||
20 | import React, { Component } from 'react'; | ||
21 | import { Counters, SessionInfo, PackagesCoverage, PackagesSourceCoverage } from './Blocks.js'; | ||
22 | |||
23 | export class Report extends Component { | ||
24 | _renderNone() { | ||
25 | return (<span>Please provide a JaCoCo XML report file to visualise.</span>); | ||
26 | } | ||
27 | |||
28 | _renderReport() { | ||
29 | return ( | ||
30 | <div> | ||
31 | <h2>Viewing report: "{this.props.report.$.name}"</h2> | ||
32 | |||
33 | <section> | ||
34 | <h3>Session info</h3> | ||
35 | <SessionInfo data={this.props.report.sessioninfo} /> | ||
36 | </section> | ||
37 | |||
38 | <section> | ||
39 | <h3>Global coverage</h3> | ||
40 | <Counters data={this.props.report.counter} /> | ||
41 | </section> | ||
42 | |||
43 | <section> | ||
44 | <h3>Coverage tree</h3> | ||
45 | <PackagesCoverage packages={this.props.report.package} /> | ||
46 | </section> | ||
47 | |||
48 | <section> | ||
49 | <h3>Source coverage</h3> | ||
50 | <PackagesSourceCoverage packages={this.props.report.package} sourceSet={this.props.sourceSet} /> | ||
51 | </section> | ||
52 | </div> | ||
53 | ); | ||
54 | } | ||
55 | |||
56 | render() { | ||
57 | return this.props.report ? this._renderReport() : this._renderNone(); | ||
58 | } | ||
59 | } | ||