From af6e2c29eb0a8610fe218e8ec85e739433eac729 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Thu, 1 Oct 2015 14:07:20 -0400
Subject: Implement outgoing webhooks.

---
 .../components/admin_console/service_settings.jsx  | 36 +++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

(limited to 'web/react/components/admin_console/service_settings.jsx')

diff --git a/web/react/components/admin_console/service_settings.jsx b/web/react/components/admin_console/service_settings.jsx
index 4105ba6da..53c89a942 100644
--- a/web/react/components/admin_console/service_settings.jsx
+++ b/web/react/components/admin_console/service_settings.jsx
@@ -36,6 +36,7 @@ export default class ServiceSettings extends React.Component {
         config.ServiceSettings.SegmentDeveloperKey = ReactDOM.findDOMNode(this.refs.SegmentDeveloperKey).value.trim();
         config.ServiceSettings.GoogleDeveloperKey = ReactDOM.findDOMNode(this.refs.GoogleDeveloperKey).value.trim();
         config.ServiceSettings.EnableIncomingWebhooks = ReactDOM.findDOMNode(this.refs.EnableIncomingWebhooks).checked;
+        config.ServiceSettings.EnableOutgoingWebhooks = React.findDOMNode(this.refs.EnableOutgoingWebhooks).checked;
         config.ServiceSettings.EnablePostUsernameOverride = ReactDOM.findDOMNode(this.refs.EnablePostUsernameOverride).checked;
         config.ServiceSettings.EnablePostIconOverride = ReactDOM.findDOMNode(this.refs.EnablePostIconOverride).checked;
         config.ServiceSettings.EnableTesting = ReactDOM.findDOMNode(this.refs.EnableTesting).checked;
@@ -207,7 +208,40 @@ export default class ServiceSettings extends React.Component {
                         </div>
                     </div>
 
-                     <div className='form-group'>
+                    <div className='form-group'>
+                        <label
+                            className='control-label col-sm-4'
+                            htmlFor='EnableOutgoingWebhooks'
+                        >
+                            {'Enable Outgoing Webhooks: '}
+                        </label>
+                        <div className='col-sm-8'>
+                            <label className='radio-inline'>
+                                <input
+                                    type='radio'
+                                    name='EnableOutgoingWebhooks'
+                                    value='true'
+                                    ref='EnableOutgoingWebhooks'
+                                    defaultChecked={this.props.config.ServiceSettings.EnableOutgoingWebhooks}
+                                    onChange={this.handleChange}
+                                />
+                                    {'true'}
+                            </label>
+                            <label className='radio-inline'>
+                                <input
+                                    type='radio'
+                                    name='EnableOutgoingWebhooks'
+                                    value='false'
+                                    defaultChecked={!this.props.config.ServiceSettings.EnableOutgoingWebhooks}
+                                    onChange={this.handleChange}
+                                />
+                                    {'false'}
+                            </label>
+                            <p className='help-text'>{'When true, outgoing webhooks will be allowed.'}</p>
+                        </div>
+                    </div>
+
+                    <div className='form-group'>
                         <label
                             className='control-label col-sm-4'
                             htmlFor='EnablePostUsernameOverride'
-- 
cgit v1.2.3-1-g7c22

