forked from p15670423/monkey
ui: extract UnsafeOptionsConfirmationModal JSX invocation into a function
This commit is contained in:
parent
5a9cb8b4af
commit
75bf30913a
|
@ -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 {
|
|||
</Modal>)
|
||||
};
|
||||
|
||||
renderUnsafeOptionsConfirmationModal() {
|
||||
return (
|
||||
<UnsafeOptionsConfirmationModal
|
||||
show={this.state.showUnsafeOptionsConfirmation}
|
||||
onCancelClick={this.onUnsafeConfirmationCancelClick}
|
||||
onContinueClick={this.onUnsafeConfirmationContinueClick}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
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()}
|
||||
<UnsafeOptionsConfirmationModal
|
||||
show={this.state.showUnsafeOptionsConfirmation}
|
||||
onCancelClick={this.onUnsafeConfirmationCancelClick}
|
||||
onContinueClick={this.onUnsafeConfirmationContinueClick}
|
||||
/>
|
||||
{this.renderUnsafeOptionsConfirmationModal()}
|
||||
<h1 className='page-title'>Monkey Configuration</h1>
|
||||
{this.renderNav()}
|
||||
{content}
|
||||
|
|
Loading…
Reference in New Issue