summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-08-03 12:19:27 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2016-08-03 13:19:27 -0400
commit5bc3cea6fe4a909735753692d0c4cd960e8ab516 (patch)
tree85715d9fcbc146a9672d84c9a1ea1e96b6e71231 /webapp/components/admin_console
parentea027c8de44d44b6ac4e66ab802e675d315b0be5 (diff)
downloadchat-5bc3cea6fe4a909735753692d0c4cd960e8ab516.tar.gz
chat-5bc3cea6fe4a909735753692d0c4cd960e8ab516.tar.bz2
chat-5bc3cea6fe4a909735753692d0c4cd960e8ab516.zip
PLT-3484 OAuth2 Service Provider (#3632)
* PLT-3484 OAuth2 Service Provider * PM text review for OAuth 2.0 Service Provider * PLT-3484 OAuth2 Service Provider UI tweaks (#3668) * Tweaks to help text * Pushing OAuth improvements (#3680) * Re-arrange System Console for OAuth 2.0 Provider
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r--webapp/components/admin_console/admin_settings.jsx17
-rw-r--r--webapp/components/admin_console/admin_sidebar.jsx6
-rw-r--r--webapp/components/admin_console/custom_integrations_settings.jsx (renamed from webapp/components/admin_console/webhook_settings.jsx)25
3 files changed, 26 insertions, 22 deletions
diff --git a/webapp/components/admin_console/admin_settings.jsx b/webapp/components/admin_console/admin_settings.jsx
index d670d599d..8601722eb 100644
--- a/webapp/components/admin_console/admin_settings.jsx
+++ b/webapp/components/admin_console/admin_settings.jsx
@@ -8,7 +8,6 @@ import Client from 'client/web_client.jsx';
import FormError from 'components/form_error.jsx';
import SaveButton from 'components/admin_console/save_button.jsx';
-import Constants from 'utils/constants.jsx';
export default class AdminSettings extends React.Component {
static get propTypes() {
@@ -22,7 +21,6 @@ export default class AdminSettings extends React.Component {
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
- this.onKeyDown = this.onKeyDown.bind(this);
this.state = Object.assign(this.getStateFromConfig(props.config), {
saveNeeded: false,
@@ -38,20 +36,6 @@ export default class AdminSettings extends React.Component {
});
}
- componentDidMount() {
- document.addEventListener('keydown', this.onKeyDown);
- }
-
- componentWillUnmount() {
- document.removeEventListener('keydown', this.onKeyDown);
- }
-
- onKeyDown(e) {
- if (e.keyCode === Constants.KeyCodes.ENTER) {
- this.handleSubmit(e);
- }
- }
-
handleSubmit(e) {
e.preventDefault();
@@ -118,6 +102,7 @@ export default class AdminSettings extends React.Component {
<form
className='form-horizontal'
role='form'
+ onSubmit={this.handleSubmit}
>
{this.renderSettings()}
<div className='form-group'>
diff --git a/webapp/components/admin_console/admin_sidebar.jsx b/webapp/components/admin_console/admin_sidebar.jsx
index d812b83fd..6634d4ac6 100644
--- a/webapp/components/admin_console/admin_sidebar.jsx
+++ b/webapp/components/admin_console/admin_sidebar.jsx
@@ -521,11 +521,11 @@ export default class AdminSidebar extends React.Component {
}
>
<AdminSidebarSection
- name='webhooks'
+ name='custom'
title={
<FormattedMessage
- id='admin.sidebar.webhooks'
- defaultMessage='Webhooks and Commands'
+ id='admin.sidebar.customIntegrations'
+ defaultMessage='Custom Integrations'
/>
}
/>
diff --git a/webapp/components/admin_console/webhook_settings.jsx b/webapp/components/admin_console/custom_integrations_settings.jsx
index ba2443442..cfa1a30ae 100644
--- a/webapp/components/admin_console/webhook_settings.jsx
+++ b/webapp/components/admin_console/custom_integrations_settings.jsx
@@ -24,6 +24,7 @@ export default class WebhookSettings extends AdminSettings {
config.ServiceSettings.EnableOnlyAdminIntegrations = this.state.enableOnlyAdminIntegrations;
config.ServiceSettings.EnablePostUsernameOverride = this.state.enablePostUsernameOverride;
config.ServiceSettings.EnablePostIconOverride = this.state.enablePostIconOverride;
+ config.ServiceSettings.EnableOAuthServiceProvider = this.state.enableOAuthServiceProvider;
return config;
}
@@ -35,7 +36,8 @@ export default class WebhookSettings extends AdminSettings {
enableCommands: config.ServiceSettings.EnableCommands,
enableOnlyAdminIntegrations: config.ServiceSettings.EnableOnlyAdminIntegrations,
enablePostUsernameOverride: config.ServiceSettings.EnablePostUsernameOverride,
- enablePostIconOverride: config.ServiceSettings.EnablePostIconOverride
+ enablePostIconOverride: config.ServiceSettings.EnablePostIconOverride,
+ enableOAuthServiceProvider: config.ServiceSettings.EnableOAuthServiceProvider
};
}
@@ -43,8 +45,8 @@ export default class WebhookSettings extends AdminSettings {
return (
<h3>
<FormattedMessage
- id='admin.integrations.webhook'
- defaultMessage='Webhooks and Commands'
+ id='admin.integrations.custom'
+ defaultMessage='Custom Integrations'
/>
</h3>
);
@@ -105,6 +107,23 @@ export default class WebhookSettings extends AdminSettings {
onChange={this.handleChange}
/>
<BooleanSetting
+ id='enableOAuthServiceProvider'
+ label={
+ <FormattedMessage
+ id='admin.oauth.providerTitle'
+ defaultMessage='Enable OAuth 2.0 Service Provider: '
+ />
+ }
+ helpText={
+ <FormattedMessage
+ id='admin.oauth.providerDescription'
+ defaultMessage='When true, Mattermost can act as an OAuth 2.0 service provider allowing external applications to authorize API requests to Mattermost.'
+ />
+ }
+ value={this.state.enableOAuthServiceProvider}
+ onChange={this.handleChange}
+ />
+ <BooleanSetting
id='enableOnlyAdminIntegrations'
label={
<FormattedMessage