From 95af08a5fadefc93aba8d3a328b8e2455d2f34c9 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 26 Feb 2021 11:26:05 -0500 Subject: [PATCH] ui: improve names in unsafeItemSelected --- .../ui/src/components/pages/ConfigurePage.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index c29fa4845..6466dfd50 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -18,17 +18,17 @@ const CONFIG_URL = '/api/configuration/island'; export const API_PBA_LINUX = '/api/fileUpload/PBAlinux'; export const API_PBA_WINDOWS = '/api/fileUpload/PBAwindows'; -function unsafeItemSelected(options, selectedOptions) { - let item_safety = new Map(); - options.forEach(i => item_safety[i.enum[0]] = i.safe); +function isUnsafeItemSelected(allOptions, selectedOptions) { + let optionSafety = new Map(); + allOptions.forEach(i => optionSafety[i.enum[0]] = i.safe); - for (let selected of selectedOptions) { - if (!item_safety[selected]) { - return true; - } - } + for (let selected of selectedOptions) { + if (!optionSafety[selected]) { + return true; + } + } - return false; + return false; } class ConfigurePageComponent extends AuthComponent { @@ -135,21 +135,21 @@ class ConfigurePageComponent extends AuthComponent { } unsafeExploiterSelected(config) { - return unsafeItemSelected( + return isUnsafeItemSelected( this.state.schema.definitions.exploiter_classes.anyOf, config.basic.exploiters.exploiter_classes ); } unsafePostBreachActionSelected(config) { - return unsafeItemSelected( + return isUnsafeItemSelected( this.state.schema.definitions.post_breach_actions.anyOf, config.monkey.post_breach.post_breach_actions ); } unsafeSystemInfoCollectorSelected(config) { - return unsafeItemSelected( + return isUnsafeItemSelected( this.state.schema.definitions.system_info_collector_classes.anyOf, config.monkey.system_info.system_info_collector_classes );