From d52a6eab578460f83bd98a5e1d7fe38f41b8c897 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Mon, 19 Aug 2019 18:09:05 +0300 Subject: [PATCH] Separated sections to methods for readability --- .../components/pages/ZeroTrustReportPage.js | 81 ++++++++++--------- 1 file changed, 44 insertions(+), 37 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ZeroTrustReportPage.js b/monkey/monkey_island/cc/ui/src/components/pages/ZeroTrustReportPage.js index b859e306b..0b9855707 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ZeroTrustReportPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ZeroTrustReportPage.js @@ -61,44 +61,10 @@ class ZeroTrustReportPageComponent extends AuthComponent { if (this.stillLoadingDataFromServer()) { content = ; } else { - const overviewSection =
-

Overview

- - - - - - - - - - - - -
; - - const directivesSection =
-

Directives

- { - Object.keys(this.state.directives).map((pillar) => - - ) - } -
; - - const findingSection =
-

Findings

- -
; - content =
- {overviewSection} - {directivesSection} - {findingSection} + {this.generateOverviewSection()} + {this.generateDirectivesSection()} + {this.generateFindingsSection()}
; } @@ -119,6 +85,47 @@ class ZeroTrustReportPageComponent extends AuthComponent { ) } + generateFindingsSection() { + return (
+

Findings

+ +
); + } + + generateDirectivesSection() { + return (
+

Directives

+ { + Object.keys(this.state.directives).map((pillar) => + + ) + } +
); + } + + generateOverviewSection() { + return (
+

Overview

+ + + + + + + + + + + + +
); + } + stillLoadingDataFromServer() { return typeof this.state.findings === "undefined" || typeof this.state.pillars === "undefined" || typeof this.state.directives === "undefined"; }