<commit_before>// 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');

export default class UserSettingsIntegrationsTab extends React.Component {
    constructor(props) {
        super(props);

        this.updateSection = this.updateSection.bind(this);
        this.handleClose = this.handleClose.bind(this);

        this.state = {};
    }
    updateSection(section) {
        this.props.updateSection(section);
    }
    handleClose() {
        this.updateSection('');
    }
    componentDidMount() {
        $('#user_settings').on('hidden.bs.modal', this.handleClose);
    }
    componentWillUnmount() {
        $('#user_settings').off('hidden.bs.modal', this.handleClose);
    }
    render() {
        let incomingHooksSection;
        var inputs = [];

        if (this.props.activeSection === 'incoming-hooks') {
            inputs.push(
                <ManageIncomingHooks />
            );

            incomingHooksSection = (
                <SettingItemMax
                    title='Incoming Webhooks'
                    inputs={inputs}
                    updateSection={function clearSection(e) {
                        this.updateSection('');
                        e.preventDefault();
                    }.bind(this)}
                />
            );
        } else {
            incomingHooksSection = (
                <SettingItemMin
                    title='Incoming Webhooks'
                    describe='Manage your incoming webhooks'
                    updateSection={function updateNameSection() {
                        this.updateSection('incoming-hooks');
                    }.bind(this)}
                />
            );
        }

        return (
            <div>
                <div className='modal-header'>
                    <button
                        type='button'
                        className='close'
                        data-dismiss='modal'
                        aria-label='Close'
                    >
                        <span aria-hidden='true'>{'×'}</span>
                    </button>
                    <h4
                        className='modal-title'
                        ref='title'
                    >
                        <i className='modal-back'></i>
                        {'Integration Settings'}<commit_msg>Update user_settings_integrations.jsx<commit_after>// 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');

export default class UserSettingsIntegrationsTab extends React.Component {
    constructor(props) {
        super(props);

        this.updateSection = this.updateSection.bind(this);
        this.handleClose = this.handleClose.bind(this);

        this.state = {};
    }
    updateSection(section) {
        this.props.updateSection(section);
    }
    handleClose() {
        this.updateSection('');
    }
    componentDidMount() {
        $('#user_settings').on('hidden.bs.modal', this.handleClose);
    }
    componentWillUnmount() {
        $('#user_settings').off('hidden.bs.modal', this.handleClose);
    }
    render() {
        let incomingHooksSection;
        var inputs = [];

        if (this.props.activeSection === 'incoming-hooks') {
            inputs.push(
                <ManageIncomingHooks />
            );

            incomingHooksSection = (
                <SettingItemMax
                    title='Incoming Webhooks'
                    inputs={inputs}
                    updateSection={function clearSection(e) {
                        this.updateSection('');
                        e.preventDefault();
                    }.bind(this)}
                />
            );
        } else {
            incomingHooksSection = (
                <SettingItemMin
                    title='Incoming Webhooks'
                    describe='Manage your incoming webhooks (Developer feature)'
                    updateSection={function updateNameSection() {
                        this.updateSection('incoming-hooks');
                    }.bind(this)}
                />
            );
        }

        return (
            <div>
                <div className='modal-header'>
                    <button
                        type='button'
                        className='close'
                        data-dismiss='modal'
                        aria-label='Close'
                    >
                        <span aria-hidden='true'>{'×'}</span>
                    </button>
                    <h4
                        className='modal-title'
                        ref='title'
                    >
                        <i className='modal-back'></i>
                        {'Integration Settings'}
{'fraction_non_alphanumeric': 0.11217323449083105, 'fraction_numerical': 0.0019508388607101053, 'mean_word_length': 1.3464530892448512, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2561056', 'n_tokens_mistral': 1267, 'n_tokens_neox': 1194, 'n_words': 198}