From 5dbf0d39a651e0efdc1d03fb6c56eb7eb565210d Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Wed, 27 Nov 2019 15:48:54 +0200 Subject: [PATCH] Added report loader to attack report --- .../components/report-components/AttackReport.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/AttackReport.js b/monkey/monkey_island/cc/ui/src/components/report-components/AttackReport.js index e73984058..ff02b03ac 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/AttackReport.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/AttackReport.js @@ -11,6 +11,7 @@ import {ScanStatus} from '../attack/techniques/Helpers'; import Matrix from './attack/ReportMatrix'; import SelectedTechnique from './attack/SelectedTechnique'; import TechniqueDropdowns from './attack/TechniqueDropdowns'; +import ReportLoader from './common/ReportLoader'; import T1210 from '../attack/techniques/T1210'; import T1197 from '../attack/techniques/T1197'; @@ -70,11 +71,13 @@ class AttackReport extends React.Component { constructor(props) { super(props); this.state = { - schema: this.props.report['schema'], - techniques: AttackReport.addLinksToTechniques(this.props.report['schema'], this.props.report['techniques']), - selectedTechnique: false, - collapseOpen: '', + selectedTechnique: false, + collapseOpen: '', }; + if (typeof this.props.report.schema !== 'undefined' && typeof this.props.report.techniques !== 'undefined'){ + this.state['schema'] = this.props.report['schema']; + this.state['techniques'] = AttackReport.addLinksToTechniques(this.props.report['schema'], this.props.report['techniques']); + } } componentDidUpdate(prevProps) { @@ -171,8 +174,8 @@ class AttackReport extends React.Component { } render() { - if (Object.keys(this.state.techniques).length === 0 && this.state.runStarted) { - return (

No techniques were scanned

); + if (typeof this.state.schema === 'undefined' || typeof this.state.techniques === 'undefined') { + return (); } else { return (
{this.generateReportContent()}
); }