From 57554ca4357c1229d6089d7d0eaa0bad6f76c0e1 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 29 Jan 2021 11:02:54 -0500 Subject: [PATCH] ui: fix some code cleanliness issues --- .../cc/ui/src/components/ui-components/AdvancedMultiSelect.js | 4 ++-- .../cc/ui/src/components/ui-components/InfoPane.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js b/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js index 5a6cc6fcd..4963aca7c 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/AdvancedMultiSelect.js @@ -104,7 +104,7 @@ class AdvancedMultiSelect extends React.Component { return MasterCheckboxState.NONE; } - if (selectValues.length != this.enumOptions.length) { + if (selectValues.length !== this.enumOptions.length) { return MasterCheckboxState.MIXED; } @@ -144,7 +144,7 @@ class AdvancedMultiSelect extends React.Component { title: definitionObj.title, content: definitionObj.info, link: definitionObj.link, - warningType: !(this.isSafe(itemKey)) ? WarningType.SINGLE : WarningType.NONE + warningType: this.isSafe(itemKey) ? WarningType.NONE : WarningType.SINGLE } } ); diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js b/monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js index 21686b468..902646068 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js @@ -62,7 +62,7 @@ function getSubtitle(props) { function getBody(props) { let body = [{props.body}]; - if (props.warningType != WarningType.NONE) { + if (props.warningType !== WarningType.NONE) { body.push(getWarning(props.warningType)); } @@ -74,7 +74,7 @@ function getBody(props) { } function getWarning(warningType) { - if (warningType == WarningType.SINGLE) { + if (warningType === WarningType.SINGLE) { var warning = This option may cause a system to become unstable or may change a system's state in undesirable ways. Therefore, this option is not recommended for use in production or other sensitive