<commit_before>import React from 'react'
import request from 'request'

export default class PreviewOrLaunchModal extends React.Component {

  constructor(props) {
    super(props)

    this.launchLesson = this.launchLesson.bind(this)
  }

  launchLesson() {
    const {classroomActivityID, lessonUID, lessonID, unitID} = this.props
    if (classroomActivityID && lessonUID) {
      request.put({
        url: `${process.env.DEFAULT_URL}/teachers/classroom_activities/${classroomActivityID}/unlock_lesson`,
        json: {authenticity_token: $('meta[name=csrf-token]').attr('content')}
      }, (error, httpStatus, body) => {
        if (body.unlocked) {
          window.location = `http://connect.quill.org/#/teach/class-lessons/${lessonUID}?&classroom_activity_id=${classroomActivityID}`
        }
      })
    } else if (lessonID && unitID) {
      window.location = `/teachers/classrooms/activity_planner/lessons/${lessonID}/unit/${unitID}`
    }
  }

  render() {
    const {classroomActivityID, lessonUID} = this.props
    // TODO: preview link will not work without a classroomActivityID and lessonUID,
    // so it will not work from the modal that opens from the dashboard right now.
    // we need a generic preview link.
    return (
      <div>
        <div className="preview-or-launch-modal-background"></div>
        <div className="preview-or-launch-modal">
          <h1>Would you like to preview this lesson?</h1>
          <img alt="close-icon" src="/images/close_icon.svg" onClick={this.props.closeModal}/>
          <p>You can either preview this lesson or launch it, if you are in class with your students now.</p>
          <a href={`http://connect.quill.org/#/teach/class-lessons/${lessonUID}?&classroom_activity_id=${classroomActivityID}`} className="bg-quillgreen">Preview Lesson</a>
          <a onClick={this.launchLesson} className="bg-quillgreen">Launch Lesson</a>
        </div>
      </div>
    )
  }<commit_msg>change copy for preview or launch modal<commit_after>import React from 'react'
import request from 'request'

export default class PreviewOrLaunchModal extends React.Component {

  constructor(props) {
    super(props)

    this.launchLesson = this.launchLesson.bind(this)
  }

  launchLesson() {
    const {classroomActivityID, lessonUID, lessonID, unitID} = this.props
    if (classroomActivityID && lessonUID) {
      request.put({
        url: `${process.env.DEFAULT_URL}/teachers/classroom_activities/${classroomActivityID}/unlock_lesson`,
        json: {authenticity_token: $('meta[name=csrf-token]').attr('content')}
      }, (error, httpStatus, body) => {
        if (body.unlocked) {
          window.location = `http://connect.quill.org/#/teach/class-lessons/${lessonUID}?&classroom_activity_id=${classroomActivityID}`
        }
      })
    } else if (lessonID && unitID) {
      window.location = `/teachers/classrooms/activity_planner/lessons/${lessonID}/unit/${unitID}`
    }
  }

  render() {
    const {classroomActivityID, lessonUID} = this.props
    // TODO: preview link will not work without a classroomActivityID and lessonUID,
    // so it will not work from the modal that opens from the dashboard right now.
    // we need a generic preview link.
    return (
      <div>
        <div className="preview-or-launch-modal-background"></div>
        <div className="preview-or-launch-modal">
          <h1>Would you like to preview this lesson?</h1>
          <img alt="close-icon" src="/images/close_icon.svg" onClick={this.props.closeModal}/>
          <p>You can either preview this lesson or launch it. If you are ready to use this lesson with your students now, launch it.</p>
          <a href={`http://connect.quill.org/#/teach/class-lessons/${lessonUID}?&classroom_activity_id=${classroomActivityID}`} className="bg-quillgreen">Preview Lesson</a>
          <a onClick={this.launchLesson} className="bg-quillgreen">Launch Lesson</a>
        </div>
      </div>
    )
  }
{'fraction_non_alphanumeric': 0.13466903373066194, 'fraction_numerical': 0.001014455997971088, 'mean_word_length': 3.3198247535596934, 'pattern_counts': {'":': 0, '<': 33, '<?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': '7489877', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1193, 'n_words': 269}