<commit_before>import React from "react";
import {Field} from "redux-form";
import {connect} from 'react-redux';
import {Button} from "react-bootstrap";
import {InputFieldGroup} from "../court-case/FieldGroup";

const SearchForm = ({searchCases, searchCasesOnEnter}) =>
    <div>
        <Field name="searchTerms" id="searchTerms" label="Search by case number and party"
               onKeyDown={searchCasesOnEnter} component={InputFieldGroup}/>
        <div className="pull-right">
            <Button bsStyle="primary" onClick={searchCases}>Search</Button>
        </div>
    </div>;

SearchForm.propTypes = {
    searchCases: React.PropTypes.func.isRequired,
    searchCasesOnEnter: React.PropTypes.func.isRequired
};

const mapDispatchToProps = (dispatch, props) => ({
    searchCasesOnEnter: (e) => e.key === "Enter" ? props.searchCases() : undefined
});

export default connect(undefined, mapDispatchToProps)(SearchForm);<commit_msg>Use keycode instead.<commit_after>import React from "react";
import {Field} from "redux-form";
import {connect} from 'react-redux';
import {Button} from "react-bootstrap";
import {InputFieldGroup} from "../court-case/FieldGroup";

const SearchForm = ({searchCases, searchCasesOnEnter}) =>
    <div>
        <Field name="searchTerms" id="searchTerms" label="Search by case number and party"
               onKeyDown={searchCasesOnEnter} component={InputFieldGroup}/>
        <div className="pull-right">
            <Button bsStyle="primary" onClick={searchCases}>Search</Button>
        </div>
    </div>;

SearchForm.propTypes = {
    searchCases: React.PropTypes.func.isRequired,
    searchCasesOnEnter: React.PropTypes.func.isRequired
};

const mapDispatchToProps = (dispatch, props) => ({
    searchCasesOnEnter: (e) => e.keyCode === 13 ? props.searchCases() : undefined
});

export default connect(undefined, mapDispatchToProps)(SearchForm);
{'fraction_non_alphanumeric': 0.14050901378579003, 'fraction_numerical': 0.0010604453870625664, 'mean_word_length': 4.453757225433526, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, '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': '5301760', 'n_tokens_mistral': 559, 'n_tokens_neox': 554, 'n_words': 125}