From 75bf30913aa843cf57a4cf20180a81f55e661a3e Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 26 Feb 2021 11:19:33 -0500 Subject: [PATCH] ui: extract UnsafeOptionsConfirmationModal JSX invocation into a function --- .../cc/ui/src/components/pages/ConfigurePage.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 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 b3c509bec..c29fa4845 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -186,7 +186,6 @@ class ConfigurePageComponent extends AuthComponent { } configSubmit() { - // Submit monkey configuration if (!this.canSafelySubmitConfig(this.state.configuration)) { this.setState({showUnsafeOptionsConfirmation: true}); return; @@ -276,6 +275,16 @@ class ConfigurePageComponent extends AuthComponent { ) }; + renderUnsafeOptionsConfirmationModal() { + return ( + + ) + } + userChangedConfig() { if (JSON.stringify(this.state.configuration) === JSON.stringify(this.initialConfig)) { if (Object.keys(this.currentFormData).length === 0 || @@ -504,11 +513,7 @@ class ConfigurePageComponent extends AuthComponent { lg={{offset: 3, span: 8}} xl={{offset: 2, span: 8}} className={'main'}> {this.renderAttackAlertModal()} - + {this.renderUnsafeOptionsConfirmationModal()}

Monkey Configuration

{this.renderNav()} {content}