From 5da5c0bbfb80cb5c9cf2699f42d17decc2d60f5b Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Tue, 1 Aug 2017 11:06:53 -0400
Subject: PLT-6987 User access token UI (#7007)

* Add user access token UI

* Fix enter press and update mattermost-redux

* Updating UI for access token stuff (#7066)

* Revert segment key
---
 .../admin_console/custom_integrations_settings.jsx  | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

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

diff --git a/webapp/components/admin_console/custom_integrations_settings.jsx b/webapp/components/admin_console/custom_integrations_settings.jsx
index 18fdd22fd..3b5c51171 100644
--- a/webapp/components/admin_console/custom_integrations_settings.jsx
+++ b/webapp/components/admin_console/custom_integrations_settings.jsx
@@ -25,6 +25,7 @@ export default class WebhookSettings extends AdminSettings {
         config.ServiceSettings.EnablePostUsernameOverride = this.state.enablePostUsernameOverride;
         config.ServiceSettings.EnablePostIconOverride = this.state.enablePostIconOverride;
         config.ServiceSettings.EnableOAuthServiceProvider = this.state.enableOAuthServiceProvider;
+        config.ServiceSettings.EnableUserAccessTokens = this.state.enableUserAccessTokens;
 
         return config;
     }
@@ -37,7 +38,8 @@ export default class WebhookSettings extends AdminSettings {
             enableOnlyAdminIntegrations: config.ServiceSettings.EnableOnlyAdminIntegrations,
             enablePostUsernameOverride: config.ServiceSettings.EnablePostUsernameOverride,
             enablePostIconOverride: config.ServiceSettings.EnablePostIconOverride,
-            enableOAuthServiceProvider: config.ServiceSettings.EnableOAuthServiceProvider
+            enableOAuthServiceProvider: config.ServiceSettings.EnableOAuthServiceProvider,
+            enableUserAccessTokens: config.ServiceSettings.EnableUserAccessTokens
         };
     }
 
@@ -172,6 +174,23 @@ export default class WebhookSettings extends AdminSettings {
                     value={this.state.enablePostIconOverride}
                     onChange={this.handleChange}
                 />
+                <BooleanSetting
+                    id='enableUserAccessTokens'
+                    label={
+                        <FormattedMessage
+                            id='admin.service.userAccessTokensTitle'
+                            defaultMessage='Enable User Access Tokens: '
+                        />
+                    }
+                    helpText={
+                        <FormattedHTMLMessage
+                            id='admin.service.userAccessTokensDescription'
+                            defaultMessage='When true, users can create <a href="https://about.mattermost.com/default-user-access-tokens" target="_blank">user access tokens</a> for integrations in <strong>Account Settings > Security</strong>. They can be used to authenticate against the API and give full access to the account.<br/><br/>To manage who can create user access tokens, go to the <strong>System Console > Users</strong> page.'
+                        />
+                    }
+                    value={this.state.enableUserAccessTokens}
+                    onChange={this.handleChange}
+                />
             </SettingsGroup>
         );
     }
-- 
cgit v1.2.3-1-g7c22

