cc: Add dummy code to frontend to check if ransomware report tab should be showed

This commit is contained in:
Shreya 2021-07-06 15:44:40 +05:30
parent 2f090f0060
commit 231fa6f99f
1 changed files with 8 additions and 3 deletions

View File

@ -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);
}