From 5d7f2399620281dde1f4f85e1812aac9f18c96f9 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Thu, 1 Sep 2016 17:05:20 -0400
Subject: Adding LDAP test connection button. Reordering LDAP settings. (#3912)

---
 webapp/components/admin_console/admin_settings.jsx | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'webapp/components/admin_console/admin_settings.jsx')

diff --git a/webapp/components/admin_console/admin_settings.jsx b/webapp/components/admin_console/admin_settings.jsx
index 8601722eb..9975a3975 100644
--- a/webapp/components/admin_console/admin_settings.jsx
+++ b/webapp/components/admin_console/admin_settings.jsx
@@ -21,6 +21,7 @@ export default class AdminSettings extends React.Component {
 
         this.handleChange = this.handleChange.bind(this);
         this.handleSubmit = this.handleSubmit.bind(this);
+        this.doSubmit = this.doSubmit.bind(this);
 
         this.state = Object.assign(this.getStateFromConfig(props.config), {
             saveNeeded: false,
@@ -39,6 +40,10 @@ export default class AdminSettings extends React.Component {
     handleSubmit(e) {
         e.preventDefault();
 
+        this.doSubmit();
+    }
+
+    doSubmit(callback) {
         this.setState({
             saving: true,
             serverError: null
@@ -59,12 +64,20 @@ export default class AdminSettings extends React.Component {
                     saveNeeded: false,
                     saving: false
                 });
+
+                if (callback) {
+                    callback();
+                }
             },
             (err) => {
                 this.setState({
                     saving: false,
                     serverError: err.message
                 });
+
+                if (callback) {
+                    callback();
+                }
             }
         );
     }
-- 
cgit v1.2.3-1-g7c22

