// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. var SettingItemMin = require('../setting_item_min.jsx'); var SettingItemMax = require('../setting_item_max.jsx'); var ManageIncomingHooks = require('./manage_incoming_hooks.jsx'); var ManageOutgoingHooks = require('./manage_outgoing_hooks.jsx'); export default class UserSettingsIntegrationsTab extends React.Component { constructor(props) { super(props); this.updateSection = this.updateSection.bind(this); this.state = {}; } updateSection(section) { this.props.updateSection(section); } render() { let incomingHooksSection; let outgoingHooksSection; var inputs = []; if (global.window.mm_config.EnableIncomingWebhooks === 'true') { if (this.props.activeSection === 'incoming-hooks') { inputs.push( ); incomingHooksSection = ( { this.updateSection(''); e.preventDefault(); }} /> ); } else { incomingHooksSection = ( { this.updateSection('incoming-hooks'); }} /> ); } } if (global.window.mm_config.EnableOutgoingWebhooks === 'true') { if (this.props.activeSection === 'outgoing-hooks') { inputs.push( ); outgoingHooksSection = ( { this.updateSection(''); e.preventDefault(); }} /> ); } else { outgoingHooksSection = ( { this.updateSection('outgoing-hooks'); }} /> ); } } return (

{'Integration Settings'}

{'Integration Settings'}

{incomingHooksSection}
{outgoingHooksSection}
); } } UserSettingsIntegrationsTab.propTypes = { user: React.PropTypes.object, updateSection: React.PropTypes.func, updateTab: React.PropTypes.func, activeSection: React.PropTypes.string, closeModal: React.PropTypes.func.isRequired, collapseModal: React.PropTypes.func.isRequired };