forked from p15670423/monkey
Added table for pillar grades
This commit is contained in:
parent
683e945506
commit
a337bb5800
|
@ -35,7 +35,7 @@ class ZeroTrustReportPageComponent extends AuthComponent {
|
|||
generateReportContent() {
|
||||
let content;
|
||||
|
||||
if (typeof this.state.findings === "undefined") {
|
||||
if (this.stillLoadingDataFromServer()) {
|
||||
content = "Still empty";
|
||||
} else {
|
||||
content = <div>
|
||||
|
@ -76,6 +76,10 @@ class ZeroTrustReportPageComponent extends AuthComponent {
|
|||
)
|
||||
}
|
||||
|
||||
stillLoadingDataFromServer() {
|
||||
return typeof this.state.findings === "undefined" || typeof this.state.pillars === "undefined" || typeof this.state.tests === "undefined";
|
||||
}
|
||||
|
||||
print() {
|
||||
alert("unimplemented");
|
||||
}
|
||||
|
|
|
@ -1,18 +1,38 @@
|
|||
import React, {Component} from "react";
|
||||
import ZeroTrustPillars from "./ZeroTrustPillars";
|
||||
import ReactTable from "react-table";
|
||||
|
||||
export class PillarGrades extends Component {
|
||||
const columns = [
|
||||
{
|
||||
Header: 'Pillar Grading',
|
||||
columns: [
|
||||
{ Header: 'Pillar', accessor: 'Pillar'},
|
||||
{ Header: 'Conclusive', accessor: 'Conclusive'},
|
||||
{ Header: 'Inconclusive', accessor: 'Inconclusive'},
|
||||
{ Header: 'Unexecuted', accessor: 'Unexecuted'},
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
const pageSize = 10;
|
||||
|
||||
class PillarGrades extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div id="pillar-grades">
|
||||
<p>
|
||||
TODO: table with conditional colouring.
|
||||
</p>
|
||||
<pre>
|
||||
{JSON.stringify(this.props.pillars, undefined, 2)}
|
||||
</pre>
|
||||
</div>
|
||||
)
|
||||
if (this.props.pillars.length > 0) {
|
||||
let defaultPageSize = this.props.pillars.length > pageSize ? pageSize : this.props.pillars.length;
|
||||
let showPagination = this.props.pillars.length > pageSize;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<ReactTable
|
||||
columns={columns}
|
||||
data={this.props.pillars}
|
||||
showPagination={showPagination}
|
||||
defaultPageSize={defaultPageSize}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
else { return (<div><pre>BAYAZ</pre></div>);}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue