summaryrefslogtreecommitdiffstats
path: root/web/react/components/user_settings/user_settings_integrations.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-11 12:31:13 -0600
committer=Corey Hulen <corey@hulen.com>2016-01-11 12:31:13 -0600
commit0b986ed3147c885af6b2f33e1ff3eb6754e8f274 (patch)
tree1863e639b0b53d8fbf7ea0ed31baebc19336131c /web/react/components/user_settings/user_settings_integrations.jsx
parent2fd597043b45a75495164915ba6c41d5ab18c5ae (diff)
downloadchat-0b986ed3147c885af6b2f33e1ff3eb6754e8f274.tar.gz
chat-0b986ed3147c885af6b2f33e1ff3eb6754e8f274.tar.bz2
chat-0b986ed3147c885af6b2f33e1ff3eb6754e8f274.zip
Adding UI
Diffstat (limited to 'web/react/components/user_settings/user_settings_integrations.jsx')
-rw-r--r--web/react/components/user_settings/user_settings_integrations.jsx35
1 files changed, 35 insertions, 0 deletions
diff --git a/web/react/components/user_settings/user_settings_integrations.jsx b/web/react/components/user_settings/user_settings_integrations.jsx
index a86510eb3..bcd1be13d 100644
--- a/web/react/components/user_settings/user_settings_integrations.jsx
+++ b/web/react/components/user_settings/user_settings_integrations.jsx
@@ -5,6 +5,7 @@ import SettingItemMin from '../setting_item_min.jsx';
import SettingItemMax from '../setting_item_max.jsx';
import ManageIncomingHooks from './manage_incoming_hooks.jsx';
import ManageOutgoingHooks from './manage_outgoing_hooks.jsx';
+import ManageCommandHooks from './manage_command_hooks.jsx';
export default class UserSettingsIntegrationsTab extends React.Component {
constructor(props) {
@@ -20,6 +21,7 @@ export default class UserSettingsIntegrationsTab extends React.Component {
render() {
let incomingHooksSection;
let outgoingHooksSection;
+ let commandHooksSection;
var inputs = [];
if (global.window.mm_config.EnableIncomingWebhooks === 'true') {
@@ -84,6 +86,37 @@ export default class UserSettingsIntegrationsTab extends React.Component {
}
}
+ if (global.window.mm_config.EnableCommands === 'true') {
+ if (this.props.activeSection === 'command-hooks') {
+ inputs.push(
+ <ManageCommandHooks key='command-hook-ui' />
+ );
+
+ commandHooksSection = (
+ <SettingItemMax
+ title='Commands'
+ width='medium'
+ inputs={inputs}
+ updateSection={(e) => {
+ this.updateSection('');
+ e.preventDefault();
+ }}
+ />
+ );
+ } else {
+ commandHooksSection = (
+ <SettingItemMin
+ title='Commands'
+ width='medium'
+ describe='Manage your commands'
+ updateSection={() => {
+ this.updateSection('command-hooks');
+ }}
+ />
+ );
+ }
+ }
+
return (
<div>
<div className='modal-header'>
@@ -114,6 +147,8 @@ export default class UserSettingsIntegrationsTab extends React.Component {
<div className='divider-light'/>
{outgoingHooksSection}
<div className='divider-dark'/>
+ {commandHooksSection}
+ <div className='divider-dark'/>
</div>
</div>
);