<commit_before>/* globals UI */

var C = UI.Views.Connector;

class EditForm extends C.View {
  constructor(props) {
    super(props);
    this.state = {
      events: []
    };
    if (!props.connector) {
      this.state.mode = 'connect';
    }
  }
  connect() {
    this.props.onConnect();
  }
  render() {
    return (
      <C.Page default="setup" {...this.props}>
        <C.Panel name="Setup" slug="setup">
          <UI.FormElements.Button text={this.props.connectorInstance ? 'Reauthorize' : 'Connect'} type="large" onClick={()=>{
              return this.connect();
            }} />
        </C.Panel>
        {this.props.connectorInstance ? <C.Panel name="Events" slug="events">
        <C.PageHeader
          title="Check the boxes of the events you want to subscribe to."
          subTitle="Checking a box will automatically subscribe you to that event." />
          <C.CheckboxGrid
            items={this.props.connectorPrototype.events}
            checked={this.props.connectorInstance.events}
            onChange={this.props.onSubscribe} />
        </C.Panel> : <C.Panel name="Events" slug="events">
          <C.PageHeader
            title="Events are available once you've connected." />
        </C.Panel>}
      </C.Page>
    );
  }
}

export default EditForm;
global.EditForm = EditForm;<commit_msg>events<commit_after>/* globals UI */

var C = UI.Views.Connector;

class EditForm extends C.View {
  constructor(props) {
    super(props);
    this.state = {
      events: []
    };
    if (!props.connector) {
      this.state.mode = 'connect';
    }
  }
  connect() {
    this.props.onConnect();
  }
  render() {
    return (
      <C.Page default="setup" {...this.props}>
        <C.Panel name="Setup" slug="setup">
          <UI.FormElements.Button text={this.props.connectorInstance ? 'Reauthorize' : 'Connect'} type="large" onClick={()=>{
              return this.connect();
            }} />
        </C.Panel>
        {this.props.connectorInstance ? <C.Panel name="Events" slug="events">
        <C.PageHeader
          title="Check the boxes of the events you want to subscribe to."
          subTitle="Checking a box will automatically subscribe you to that event." />
          <C.CheckboxGrid
            items={this.props.connectorInstance.events}
            checked={this.props.connectorInstance.subscribedEvents}
            onChange={this.props.onSubscribe} />
        </C.Panel> : <C.Panel name="Events" slug="events">
          <C.PageHeader
            title="Events are available once you've connected." />
        </C.Panel>}
      </C.Page>
    );
  }
}

export default EditForm;
global.EditForm = EditForm;
{'fraction_non_alphanumeric': 0.14736842105263157, 'fraction_numerical': 0.0, 'mean_word_length': 2.249084249084249, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, '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': '3902164', 'n_tokens_mistral': 787, 'n_tokens_neox': 778, 'n_words': 169}