<commit_before>import React, {PropTypes} from 'react';
import DefaultInputComponent from './input';
import DefaultDisplayComponent from './display';
import DefaultSelectComponent from './select';
import DefaultListComponent from './list';
import DefaultTextComponent from './text';

const FieldLabelValueComponent = ({label, ValueComponent}) => (
    <div className='field'>
        <div><b>{label}</b></div>
        {ValueComponent}
    </div>
);
FieldLabelValueComponent.displayName = 'FieldLabelValueComponent';


function Field({textOnly, multiple, list, fieldForLine, ...otherProps}) {
    otherProps.value = otherProps.rawInputValue; //https://github.com/get-focus/focus-redux/issues/39 compatibility with focus components
    const {TextComponent = DefaultTextComponent, DisplayComponent = DefaultDisplayComponent, InputComponent = DefaultInputComponent, SelectComponent = DefaultSelectComponent, ListComponent = DefaultListComponent} = otherProps.metadata;
    const renderConsult = () => (list ? <ListComponent fieldForLine={fieldForLine} values={otherProps.formattedInputValue} {...otherProps}/> : (textOnly ? <TextComponent {...otherProps} /> : <DisplayComponent {...otherProps} />));
    const renderEdit = () => list ? <ListComponent fieldForLine={fieldForLine} values={otherProps.formattedInputValue} {...otherProps}/> : (multiple ? <SelectComponent {...otherProps}/> : <InputComponent {...otherProps}/>);
    const ValueComponent = otherProps.editing ? renderEdit() : renderConsult();
    return textOnly ? ValueComponent : <FieldLabelValueComponent name={otherProps.name} ValueComponent={ValueComponent} />;
}

Field.displayName = 'Field';
Field.propTypes = {
    error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
    name: PropTypes.string.isRequired,
    multiple: PropTypes.bool
};

export default Field;<commit_msg>fix label name of the field<commit_after>import React, {PropTypes} from 'react';
import DefaultInputComponent from './input';
import DefaultDisplayComponent from './display';
import DefaultSelectComponent from './select';
import DefaultListComponent from './list';
import DefaultTextComponent from './text';

const FieldLabelValueComponent = ({label, ValueComponent}) => (
    <div className='field'>
        <div><b>{label}</b></div>
        {ValueComponent}
    </div>
);
FieldLabelValueComponent.displayName = 'FieldLabelValueComponent';


function Field({textOnly, multiple, list, fieldForLine, ...otherProps}) {
    otherProps.value = otherProps.rawInputValue; //https://github.com/get-focus/focus-redux/issues/39 compatibility with focus components
    const {TextComponent = DefaultTextComponent, DisplayComponent = DefaultDisplayComponent, InputComponent = DefaultInputComponent, SelectComponent = DefaultSelectComponent, ListComponent = DefaultListComponent} = otherProps.metadata;
    const renderConsult = () => (list ? <ListComponent fieldForLine={fieldForLine} values={otherProps.formattedInputValue} {...otherProps}/> : (textOnly ? <TextComponent {...otherProps} /> : <DisplayComponent {...otherProps} />));
    const renderEdit = () => list ? <ListComponent fieldForLine={fieldForLine} values={otherProps.formattedInputValue} {...otherProps}/> : (multiple ? <SelectComponent {...otherProps}/> : <InputComponent {...otherProps}/>);
    const ValueComponent = otherProps.editing ? renderEdit() : renderConsult();
    return textOnly ? ValueComponent : <FieldLabelValueComponent label={otherProps.name} ValueComponent={ValueComponent} />;
}

Field.displayName = 'Field';
Field.propTypes = {
    error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
    name: PropTypes.string.isRequired,
    multiple: PropTypes.bool
};

export default Field;
{'fraction_non_alphanumeric': 0.13573929437112847, 'fraction_numerical': 0.0010772959870724481, 'mean_word_length': 5.538732394366197, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 35, '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': '3590704', 'n_tokens_mistral': 950, 'n_tokens_neox': 952, 'n_words': 222}