From 231fa6f99f485d9560de2bb5370dfa8f0240bc12 Mon Sep 17 00:00:00 2001 From: Shreya Date: Tue, 6 Jul 2021 15:44:40 +0530 Subject: [PATCH] cc: Add dummy code to frontend to check if ransomware report tab should be showed --- .../cc/ui/src/components/pages/ReportPage.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js index 9138764fd..6548f5de1 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -59,8 +59,7 @@ class ReportPageComponent extends AuthComponent { this.setState({zeroTrustReport: ztReport}) }); this.setState({ - ransomwareReport: {'report': '', - 'show': true}}) + ransomwareReport: {'report': ''}}) // this.authFetch('/api/report/ransomware') // .then(res => res.json()) // .then(res => { @@ -68,7 +67,7 @@ class ReportPageComponent extends AuthComponent { // ransomwareReport: res // }); // }); - if (this.state.ransomwareReport['show'] === true) { + if (this.shouldShowRansomwareReport(this.state.ransomwareReport)) { this.state.sections.push({key: 'ransomware', title: 'Ransomware report'}) } } @@ -99,6 +98,12 @@ class ReportPageComponent extends AuthComponent { return ztReport }; + shouldShowRansomwareReport(report) { // TODO: Add proper check + if (report) { + return true; + } + } + componentWillUnmount() { clearInterval(this.state.ztReportRefreshInterval); }