<commit_before>'use strict';

import React, { PropTypes } from 'react';
import store from '../app/store';
import { push } from 'react-router-redux';

class SWAPIPage extends React.Component {
    constructor (props) {
        super(props);
        console.log(`SWAPI PARAMS: ${JSON.stringify(props.params)}`)
        this.state = {
            currentPerson: {},
            loading: false,
            currentId: (props.params || {}).personId || 1
        }
        this.getPerson = this.getPerson.bind(this);
        this.setCurrentId = this.setCurrentId.bind(this);    
        this.trySubmit = this.trySubmit.bind(this);        
    }
    componentDidMount () { 
        this.getPerson();
    }    
    componentWillReceiveProps (nextProps) {
        console.log(JSON.stringify(nextProps));
        if ((nextProps.params || {}).personId !== this.state.currentId) {
            this.setState({ currentId: nextProps.params.personId });
            this.getPerson();
        }
    }
    render () {
        const { currentPerson } = this.state;
        const setCurrentId = this.setCurrentId;
        return (
            <div className='flex-container'>
                <p className='-text'>SWAPI Playground</p>
                <div className='input-group'>
                    <input className='form-control' type='text' value={this.state.currentId} onChange={(e) => { setCurrentId(e.target.value); }} onKeyUp={this.trySubmit}></input>
                    <div className='input-group-addon btn' onClick={this.getPerson}>Get Person...</div>
                </div>
                <hr /><commit_msg>removed excess logs.<commit_after>'use strict';

import React, { PropTypes } from 'react';
import store from '../app/store';
import { push } from 'react-router-redux';

class SWAPIPage extends React.Component {
    constructor (props) {
        super(props);        
        this.state = {
            currentPerson: {},
            loading: false,
            currentId: (props.params || {}).personId || 1
        }
        this.getPerson = this.getPerson.bind(this);
        this.setCurrentId = this.setCurrentId.bind(this);    
        this.trySubmit = this.trySubmit.bind(this);        
    }
    componentDidMount () { 
        this.getPerson();
    }    
    componentWillReceiveProps (nextProps) {        
        if ((nextProps.params || {}).personId !== this.state.currentId) {
            this.setState({ currentId: nextProps.params.personId });
            this.getPerson();
        }
    }
    render () {
        const { currentPerson } = this.state;
        const setCurrentId = this.setCurrentId;
        return (
            <div className='flex-container'>
                <p className='-text'>SWAPI Playground</p>
                <div className='input-group'>
                    <input className='form-control' type='text' value={this.state.currentId} onChange={(e) => { setCurrentId(e.target.value); }} onKeyUp={this.trySubmit}></input>
                    <div className='input-group-addon btn' onClick={this.getPerson}>Get Person...</div>
                </div>
                <hr />
{'fraction_non_alphanumeric': 0.14198325820991628, 'fraction_numerical': 0.000643915003219575, 'mean_word_length': 2.079286422200198, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '3196468', 'n_tokens_mistral': 866, 'n_tokens_neox': 854, 'n_words': 160}