<commit_before>import React, {Component, PropTypes} from 'react';
import {Button} from 'react-bootstrap';

class EventInfo extends Component {

  formatInfo(eventData) {
    return(
      <div>
        <p>Type: <b>{eventData.type}</b></p>        
        <p>Emotion: <b>{eventData.emotion}</b></p>
        <p>Energy Level: <b>{eventData.energy}</b></p>
        <p>Description: <b>{eventData.text}</b></p>
        <p>Start Time: <b>{eventData.start.toLocaleString()}</b></p>
        <p>End Time: <b>{eventData.end.toLocaleString()}</b></p>
      </div>
    );
  }

  hideEventInfo() {
    this.props.setEventModal(false);
  }

  deleteEvent(event) {
    this.props.setEventModal(false);
    this.props.setConfirmModal(true);
  }

  editEvent() {
    this.props.setEventModal(false);
    this.props.setEditModal(true);
  }

  render() {
    return(
      <div>
        {this.formatInfo(this.props.activeEvent)}
        <Button
          onClick={this.deleteEvent.bind(this, this.props.activeEvent)}
          bsStyle='danger'
        >
          Delete
        </Button>

        <div style={{float: 'right'}}>
          <Button onClick={this.editEvent.bind(this)}>
            Edit
          </Button>
          <Button
            onClick={this.hideEventInfo.bind(this)}
            bsStyle='primary'
          >
            Close
          </Button>
        </div>

      </div>
    );
  }
}

EventInfo.propTypes = {
  setEventModal: PropTypes.func.isRequired,
  activeEvent: PropTypes.object.isRequired,
  deleteEvent: PropTypes.func.isRequired
}

export default EventInfo;<commit_msg>Add route from event info to analytics page<commit_after>import React, {Component, PropTypes} from 'react';
import {Button} from 'react-bootstrap';
import {browserHistory} from 'react-router';

class EventInfo extends Component {

  goToPage(route) {
    browserHistory.push(route);
  }

  formatInfo(eventData) {
    return(
      <div>
        <Button style={{float: 'right'}} 
                onClick={this.goToPage.bind(this, '/analytics')}>
          Go To Emotion Data 
        </Button>
        <p>Type: <b>{eventData.type}</b></p>  
        <p>Emotion: <b>{eventData.emotion}</b></p>
        <p>Energy Level: <b>{eventData.energy}</b></p>
        <p>Description: <b>{eventData.text}</b></p>
        <p>Start Time: <b>{eventData.start.toLocaleString()}</b></p>
        <p>End Time: <b>{eventData.end.toLocaleString()}</b></p>
      </div>
    );
  }

  hideEventInfo() {
    this.props.setEventModal(false);
  }

  deleteEvent(event) {
    this.props.setEventModal(false);
    this.props.setConfirmModal(true);
  }

  editEvent() {
    this.props.setEventModal(false);
    this.props.setEditModal(true);
  }

  render() {
    return(
      <div>
        {this.formatInfo(this.props.activeEvent)}
        <Button
          onClick={this.deleteEvent.bind(this, this.props.activeEvent)}
          bsStyle='danger'
        >
          Delete
        </Button>
        <div style={{float: 'right'}}>
          <Button onClick={this.editEvent.bind(this)}>
            Edit
          </Button>
          <Button
            onClick={this.hideEventInfo.bind(this)}
            bsStyle='primary'
          >
            Close
          </Button>
        </div>

      </div>
    );
  }
}

EventInfo.propTypes = {
  setEventModal: PropTypes.func.isRequired,
  activeEvent: PropTypes.object.isRequired,
  deleteEvent: PropTypes.func.isRequired
}

export default EventInfo;
{'fraction_non_alphanumeric': 0.1557163531114327, 'fraction_numerical': 0.0, 'mean_word_length': 2.355339805825243, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 77, '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': '3367699', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1107, 'n_words': 172}