cc: Only show ransomware report tab if `show` in ransomware report telemetry is `true`

This commit is contained in:
Shreya 2021-07-05 15:04:10 +05:30
parent 46ac53c5d1
commit 2f090f0060
1 changed files with 6 additions and 4 deletions

View File

@ -26,8 +26,7 @@ class ReportPageComponent extends AuthComponent {
selectedSection: ReportPageComponent.selectReport(this.sectionsOrder), selectedSection: ReportPageComponent.selectReport(this.sectionsOrder),
sections: [{key: 'security', title: 'Security report'}, sections: [{key: 'security', title: 'Security report'},
{key: 'zeroTrust', title: 'Zero trust report'}, {key: 'zeroTrust', title: 'Zero trust report'},
{key: 'attack', title: 'ATT&CK report'}, {key: 'attack', title: 'ATT&CK report'}]
{key: 'ransomware', title: 'Ransomware report'}]
}; };
} }
@ -60,8 +59,8 @@ class ReportPageComponent extends AuthComponent {
this.setState({zeroTrustReport: ztReport}) this.setState({zeroTrustReport: ztReport})
}); });
this.setState({ this.setState({
ransomwareReport: {'report': ''} ransomwareReport: {'report': '',
}); 'show': true}})
// this.authFetch('/api/report/ransomware') // this.authFetch('/api/report/ransomware')
// .then(res => res.json()) // .then(res => res.json())
// .then(res => { // .then(res => {
@ -69,6 +68,9 @@ class ReportPageComponent extends AuthComponent {
// ransomwareReport: res // ransomwareReport: res
// }); // });
// }); // });
if (this.state.ransomwareReport['show'] === true) {
this.state.sections.push({key: 'ransomware', title: 'Ransomware report'})
}
} }
} }