From 7eaeef69193e44011174b8f03ad50ccac7fc5ac9 Mon Sep 17 00:00:00 2001 From: Dhayalan Date: Wed, 13 Mar 2019 13:07:59 +0100 Subject: [PATCH 1/2] Update ReportPage.js Fix for issue #213 --- .../monkey_island/cc/ui/src/components/pages/ReportPage.js | 5 ++--- 1 file changed, 2 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 b5ab30581..e62bdcc59 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -403,9 +403,8 @@ class ReportPageComponent extends AuthComponent { generateReportRecommendationsSection() { return (
-

- Domain related recommendations -

+ {Object.keys(this.state.report.recommendations.domain_issues).length !=0 ? +

Domain related recommendations

: null }
{this.generateIssues(this.state.report.recommendations.domain_issues)}
From 93b0c34f07fc4157c16196c02835c81b78705c14 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Tue, 16 Apr 2019 16:36:43 +0300 Subject: [PATCH 2/2] Fixed comparison to be !== and not != also, fixed the same issue for machine-related issues and added documentation. --- .../cc/ui/src/components/pages/ReportPage.js | 11 +++++++---- 1 file changed, 7 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 873d31253..43be6367c 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -404,14 +404,17 @@ class ReportPageComponent extends AuthComponent { generateReportRecommendationsSection() { return (
- {Object.keys(this.state.report.recommendations.domain_issues).length !=0 ? + {/* Checks if there are any domain issues. If there are more then one: render the title. Otherwise, + * don't render it (since the issues themselves will be empty. */} + {Object.keys(this.state.report.recommendations.domain_issues).length !== 0 ?

Domain related recommendations

: null }
{this.generateIssues(this.state.report.recommendations.domain_issues)}
-

- Machine related Recommendations -

+ {/* Checks if there are any issues. If there are more then one: render the title. Otherwise, + * don't render it (since the issues themselves will be empty. */} + {Object.keys(this.state.report.recommendations.issues).length !== 0 ? +

Machine related recommendations

: null }
{this.generateIssues(this.state.report.recommendations.issues)}