<commit_before>import React from 'react';

import ApiMixin from '../mixins/apiMixin';
import InactivePlugins from './inactivePlugins';
import IndicatorStore from '../stores/indicatorStore';
import PluginConfig from './pluginConfig';
import {t} from '../locale';

export default React.createClass({
  propTypes: {
    organization: React.PropTypes.object.isRequired,
    project: React.PropTypes.object.isRequired,
    pluginList: React.PropTypes.array.isRequired,
    onDisablePlugin: React.PropTypes.func.isRequired,
    onEnablePlugin: React.PropTypes.func.isRequired
  },

  mixins: [ApiMixin],

  enablePlugin(plugin) {
    let loadingIndicator = IndicatorStore.add(t('Saving changes..'));
    let {organization, project} = this.props;
    this.api.request(
      `/projects/${organization.slug}/${project.slug}/plugins/${plugin.id}/`,
      {
        method: 'POST',
        success: () => this.props.onEnablePlugin(plugin),
        error: error => {
          IndicatorStore.add(t('Unable to save changes. Please try again.'), 'error');
        },
        complete: () => {
          IndicatorStore.remove(loadingIndicator);
        }
      }
    );
  },

  onDisablePlugin(plugin) {
    this.props.onDisablePlugin(plugin);
  },

  render() {
    let {organization, pluginList, project} = this.props;

    if (!pluginList.length) {
      return (
        <div className="panel panel-default">
          <div className="panel-body">
            <p>{"Oops! Looks like there aren't any availble integrations installed."}</p>
          </div>
        </div>
      );
    }

    return (
      <div>
        {pluginList.filter(p => p.enabled).map(data => {
          return (
            <PluginConfig
              data={data}
              organization={organization}
              project={project}
              key={data.id}
              onDisablePlugin={this.onDisablePlugin.bind(this, data)}
            />
          );
        })}
        <InactivePlugins
          plugins={pluginList.filter(p => !p.enabled)}
          onEnablePlugin={this.enablePlugin}
        />
      </div>
    );
  }
});
<commit_msg>fix bottom margin<commit_after>import React from 'react';

import ApiMixin from '../mixins/apiMixin';
import InactivePlugins from './inactivePlugins';
import IndicatorStore from '../stores/indicatorStore';
import PluginConfig from './pluginConfig';
import {t} from '../locale';

export default React.createClass({
  propTypes: {
    organization: React.PropTypes.object.isRequired,
    project: React.PropTypes.object.isRequired,
    pluginList: React.PropTypes.array.isRequired,
    onDisablePlugin: React.PropTypes.func.isRequired,
    onEnablePlugin: React.PropTypes.func.isRequired
  },

  mixins: [ApiMixin],

  enablePlugin(plugin) {
    let loadingIndicator = IndicatorStore.add(t('Saving changes..'));
    let {organization, project} = this.props;
    this.api.request(
      `/projects/${organization.slug}/${project.slug}/plugins/${plugin.id}/`,
      {
        method: 'POST',
        success: () => this.props.onEnablePlugin(plugin),
        error: error => {
          IndicatorStore.add(t('Unable to save changes. Please try again.'), 'error');
        },
        complete: () => {
          IndicatorStore.remove(loadingIndicator);
        }
      }
    );
  },

  onDisablePlugin(plugin) {
    this.props.onDisablePlugin(plugin);
  },

  render() {
    let {organization, pluginList, project} = this.props;

    if (!pluginList.length) {
      return (
        <div className="panel panel-default">
          <div className="panel-body p-b-0">
            <p>{"Oops! Looks like there aren't any availble integrations installed."}</p>
          </div>
        </div>
      );
    }

    return (
      <div>
        {pluginList.filter(p => p.enabled).map(data => {
          return (
            <PluginConfig
              data={data}
              organization={organization}
              project={project}
              key={data.id}
              onDisablePlugin={this.onDisablePlugin.bind(this, data)}
            />
          );
        })}
        <InactivePlugins
          plugins={pluginList.filter(p => !p.enabled)}
          onEnablePlugin={this.enablePlugin}
        />
      </div>
    );
  }
});

{'fraction_non_alphanumeric': 0.14043355325164938, 'fraction_numerical': 0.000235626767200754, 'mean_word_length': 2.3320251177394034, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3628464', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1213, 'n_words': 225}