<commit_before>import React from 'react'
import DropdownMenu from '../progress_reports/dropdown_filter'

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

    this.state = {
      firstName: '',
      lastName: '',
      email: '',
      school: {
        value: '',
        name: ''
      }
    }

    this.updateField = this.updateField.bind(this)
    this.updateSchool = this.updateSchool.bind(this)
    this.schoolsList = this.schoolsList.bind(this)
    this.schoolOptions = this.schoolOptions.bind(this)
    this.addTeacherAccount = this.addTeacherAccount.bind(this)
    this.renderMessage = this.renderMessage.bind(this)
    this.renderError = this.renderError.bind(this)
  }

  updateField(e, fieldName) {
    this.setState({[fieldName]: e.target.value})
  }

  updateSchool(school) {
    this.setState({school: school})
  }

  schoolsList() {
    return this.props.schools.map(school =>
      <div className="school" key={school.id}><img src="https://assets.quill.org/images/icons/school_icon_admin.svg"/>{school.name}</div>
    )
  }

  schoolOptions() {
    return this.props.schools.map(school => {
      return {
        name: school.name,
        value: school.id
      }
    })
  }

  addTeacherAccount() {
    const data = {
      teacher: {
        first_name: this.state.firstName,
        last_name: this.state.lastName,
        email: this.state.email
      },
      id: this.state.school.value
    }
    this.props.addTeacherAccount(data)
  }

  renderError() {
    if (this.props.error) {
      return <div className="error">{this.props.error}</div>
    }
  }

  renderMessage() {
    if (this.props.message) {
      return <div className="message">{this.props.message}</div>
    }
  }

  render() {
    return <div id="create_new_accounts">
      <div className="header">
        <h2>Create New Accounts and Link Existing Teachers</h2>
        <a className="green-link" href="mailto:<EMAIL>?subject=Bulk Upload Teachers via CSV&body=Please attach your CSV file to this email.">
          <button className="bg-white text-black">Upload Teachers via CSV</button>
        </a>
      </div>
      <p><span>Teachers New to Quill?</span> Input their information to create new Quill accounts.</p>
      <p>
        <span>Teachers Have Quill Accounts?</span> When you submit their information, they will receive an email instructing them to link their accounts to your school. Teachers can link to their school from the My Account page.
        <a className="green-link" href="http://support.quill.org/getting-started-for-teachers/manage-classes/how-can-i-connect-my-account-to-my-school" target="_blank"> Here's the guide.</a>
      </p>
      <div className="form-and-schools-list">
        <div className="form">
          <div className="first-line">
            <input className="first-name" value={this.state.firstName} onChange={(e) => this.updateField(e, 'firstName')} placeholder="First Name" type="text"></input>
            <input className="last-name" value={this.state.lastName} onChange={(e) => this.updateField(e, 'lastName')} placeholder="Last Name" type="text"></input>
            <input className="email" value={this.state.email} onChange={(e) => this.updateField(e, 'email')} placeholder="Email Address" type="text"></input>
          </div>
          <DropdownMenu
            className='second-line'
            options={this.schoolOptions()}
            selectedOption={this.state.school}
            selectOption={this.updateSchool}
            placeholder='Select School for Teacher'
          />
          <button className="button-green pull-right" onClick={this.addTeacherAccount}>Add Teacher Account</button>
        </div>
        <div className="schools">
          <p>You have admin access to these schools:</p>
          <div className="schools-list">
            {this.schoolsList()}
          </div>
          <p className="need-access pull-right">Need access to additional schools? <a className="green-link" href="mailto:<EMAIL>">Email Becca</a></p>
        </div>
      </div>
      {this.renderError()}
      {this.renderMessage()}
    </div>
  }
}
<commit_msg>Update email link<commit_after>import React from 'react'
import DropdownMenu from '../progress_reports/dropdown_filter'

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

    this.state = {
      firstName: '',
      lastName: '',
      email: '',
      school: {
        value: '',
        name: ''
      }
    }

    this.updateField = this.updateField.bind(this)
    this.updateSchool = this.updateSchool.bind(this)
    this.schoolsList = this.schoolsList.bind(this)
    this.schoolOptions = this.schoolOptions.bind(this)
    this.addTeacherAccount = this.addTeacherAccount.bind(this)
    this.renderMessage = this.renderMessage.bind(this)
    this.renderError = this.renderError.bind(this)
  }

  updateField(e, fieldName) {
    this.setState({[fieldName]: e.target.value})
  }

  updateSchool(school) {
    this.setState({school: school})
  }

  schoolsList() {
    return this.props.schools.map(school =>
      <div className="school" key={school.id}><img src="https://assets.quill.org/images/icons/school_icon_admin.svg"/>{school.name}</div>
    )
  }

  schoolOptions() {
    return this.props.schools.map(school => {
      return {
        name: school.name,
        value: school.id
      }
    })
  }

  addTeacherAccount() {
    const data = {
      teacher: {
        first_name: this.state.firstName,
        last_name: this.state.lastName,
        email: this.state.email
      },
      id: this.state.school.value
    }
    this.props.addTeacherAccount(data)
  }

  renderError() {
    if (this.props.error) {
      return <div className="error">{this.props.error}</div>
    }
  }

  renderMessage() {
    if (this.props.message) {
      return <div className="message">{this.props.message}</div>
    }
  }

  render() {
    return <div id="create_new_accounts">
      <div className="header">
        <h2>Create New Accounts and Link Existing Teachers</h2>
        <a className="green-link" href="mailto:<EMAIL>?subject=Bulk Upload Teachers via CSV&body=Please attach your CSV file to this email.">
          <button className="bg-white text-black">Upload Teachers via CSV</button>
        </a>
      </div>
      <p><span>Teachers New to Quill?</span> Input their information to create new Quill accounts.</p>
      <p>
        <span>Teachers Have Quill Accounts?</span> When you submit their information, they will receive an email instructing them to link their accounts to your school. Teachers can link to their school from the My Account page.
        <a className="green-link" href="http://support.quill.org/getting-started-for-teachers/manage-classes/how-can-i-connect-my-account-to-my-school" target="_blank"> Here's the guide.</a>
      </p>
      <div className="form-and-schools-list">
        <div className="form">
          <div className="first-line">
            <input className="first-name" value={this.state.firstName} onChange={(e) => this.updateField(e, 'firstName')} placeholder="First Name" type="text"></input>
            <input className="last-name" value={this.state.lastName} onChange={(e) => this.updateField(e, 'lastName')} placeholder="Last Name" type="text"></input>
            <input className="email" value={this.state.email} onChange={(e) => this.updateField(e, 'email')} placeholder="Email Address" type="text"></input>
          </div>
          <DropdownMenu
            className='second-line'
            options={this.schoolOptions()}
            selectedOption={this.state.school}
            selectOption={this.updateSchool}
            placeholder='Select School for Teacher'
          />
          <button className="button-green pull-right" onClick={this.addTeacherAccount}>Add Teacher Account</button>
        </div>
        <div className="schools">
          <p>You have admin access to these schools:</p>
          <div className="schools-list">
            {this.schoolsList()}
          </div>
          <p className="need-access pull-right">Need access to additional schools? <a className="green-link" href="mailto:<EMAIL>">Email Becca</a></p>
        </div>
      </div>
      {this.renderError()}
      {this.renderMessage()}
    </div>
  }
}

{'fraction_non_alphanumeric': 0.1426516422920163, 'fraction_numerical': 0.0004795013186286262, 'mean_word_length': 2.8642890226956923, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 121, 'https://': 2, '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': '4630442', 'n_tokens_mistral': 2533, 'n_tokens_neox': 2486, 'n_words': 508}