Made the test cell of the recommendation table a list instead of raw JSON
This commit is contained in:
parent
96eb705b9c
commit
1a2d61e3a1
|
@ -19041,7 +19041,6 @@
|
|||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
|
@ -19211,7 +19210,7 @@
|
|||
"bundled": true,
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "1.1.11"
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
|
|
|
@ -22,7 +22,6 @@ const columns = [
|
|||
},
|
||||
{ Header: 'Tests', id:"Tests",
|
||||
accessor: x => {
|
||||
console.log(x.Tests);
|
||||
return <TestsStatus tests={x.Tests} />;
|
||||
}
|
||||
}
|
||||
|
@ -32,10 +31,35 @@ const columns = [
|
|||
|
||||
class TestsStatus extends AuthComponent {
|
||||
render() {
|
||||
const positiveStatus = "Positive";
|
||||
const conclusiveStatus = "Conclusive";
|
||||
const inconclusiveStatus = "Inconclusive";
|
||||
const unexecutedStatus = "Unexecuted";
|
||||
|
||||
return (
|
||||
<pre>{JSON.stringify(this.props.tests,null,2)}</pre>
|
||||
<div>
|
||||
{this.getTestsOfStatusIfAny(conclusiveStatus)}
|
||||
{this.getTestsOfStatusIfAny(inconclusiveStatus)}
|
||||
{this.getTestsOfStatusIfAny(positiveStatus)}
|
||||
{this.getTestsOfStatusIfAny(unexecutedStatus)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
getTestsOfStatusIfAny(statusToFilter) {
|
||||
const filteredTests = this.props.tests.filter((test) => {
|
||||
return (test.Status === statusToFilter);
|
||||
}
|
||||
);
|
||||
|
||||
if (filteredTests.length > 0) {
|
||||
const listItems = filteredTests.map((test) => {
|
||||
return (<li key={test.Test}>{test.Test}</li>)
|
||||
});
|
||||
return <div>{statusToFilter}<ul>{listItems}</ul></div>;
|
||||
}
|
||||
return <div/>;
|
||||
}
|
||||
}
|
||||
|
||||
export class RecommendationsStatusTable extends AuthComponent {
|
||||
|
|
Loading…
Reference in New Issue