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() {
|
generateReportContent() {
|
||||||
let content;
|
let content;
|
||||||
|
|
||||||
if (typeof this.state.findings === "undefined") {
|
if (this.stillLoadingDataFromServer()) {
|
||||||
content = "Still empty";
|
content = "Still empty";
|
||||||
} else {
|
} else {
|
||||||
content = <div>
|
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() {
|
print() {
|
||||||
alert("unimplemented");
|
alert("unimplemented");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,38 @@
|
||||||
import React, {Component} from "react";
|
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() {
|
render() {
|
||||||
return (
|
if (this.props.pillars.length > 0) {
|
||||||
<div id="pillar-grades">
|
let defaultPageSize = this.props.pillars.length > pageSize ? pageSize : this.props.pillars.length;
|
||||||
<p>
|
let showPagination = this.props.pillars.length > pageSize;
|
||||||
TODO: table with conditional colouring.
|
|
||||||
</p>
|
return (
|
||||||
<pre>
|
<div>
|
||||||
{JSON.stringify(this.props.pillars, undefined, 2)}
|
<ReactTable
|
||||||
</pre>
|
columns={columns}
|
||||||
</div>
|
data={this.props.pillars}
|
||||||
)
|
showPagination={showPagination}
|
||||||
|
defaultPageSize={defaultPageSize}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else { return (<div><pre>BAYAZ</pre></div>);}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue