From 2f090f006094300d292f1c369722afd5d8e8dcbf Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 5 Jul 2021 15:04:10 +0530 Subject: [PATCH] cc: Only show ransomware report tab if `show` in ransomware report telemetry is `true` --- .../cc/ui/src/components/pages/ReportPage.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 dae6e676e..9138764fd 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -26,8 +26,7 @@ class ReportPageComponent extends AuthComponent { selectedSection: ReportPageComponent.selectReport(this.sectionsOrder), sections: [{key: 'security', title: 'Security report'}, {key: 'zeroTrust', title: 'Zero trust report'}, - {key: 'attack', title: 'ATT&CK report'}, - {key: 'ransomware', title: 'Ransomware report'}] + {key: 'attack', title: 'ATT&CK report'}] }; } @@ -60,8 +59,8 @@ class ReportPageComponent extends AuthComponent { this.setState({zeroTrustReport: ztReport}) }); this.setState({ - ransomwareReport: {'report': ''} - }); + ransomwareReport: {'report': '', + 'show': true}}) // this.authFetch('/api/report/ransomware') // .then(res => res.json()) // .then(res => { @@ -69,6 +68,9 @@ class ReportPageComponent extends AuthComponent { // ransomwareReport: res // }); // }); + if (this.state.ransomwareReport['show'] === true) { + this.state.sections.push({key: 'ransomware', title: 'Ransomware report'}) + } } }