<commit_before>import React, {Component, PropTypes} from 'react';
import {t} from '../../util.js';

import * as Control from '../../controls.js';
import {Col} from 'react-bootstrap';

export class EditClientRate extends Component {
  static propTypes = {
    rate: PropTypes.shape({
      type: PropTypes.oneOf(Control.invoiceLineTypes).isRequired,
      hoursInDay: PropTypes.number,
      value: PropTypes.number.isRequired, // TODO: rename to price?
      description: PropTypes.string,
    }).isRequired,
    onChange: PropTypes.func.isRequired,
  }
  render() {
    const {rate} = this.props;
    return (
      <div>
        <Col sm={4}>
          <Control.NumericInput
            prefix="€"
            label={t('client.rate.defaultPrice')}
            value={rate.value}
            onChange={value => this.props.onChange({...rate, value: value})}
            data-tst="client.rate.value"
          />
        </Col>

        <Col sm={4}>
          <Control.NumericInput
            label={t('client.rate.hoursInDay')}
            value={rate.hoursInDay}
            onChange={value => this.props.onChange({...rate, hoursInDay: value})}
            data-tst="client.rate.hoursInDay"<commit_msg>allow floats for default client rate<commit_after>import React, {Component, PropTypes} from 'react';
import {t} from '../../util.js';

import * as Control from '../../controls.js';
import {Col} from 'react-bootstrap';

export class EditClientRate extends Component {
  static propTypes = {
    rate: PropTypes.shape({
      type: PropTypes.oneOf(Control.invoiceLineTypes).isRequired,
      hoursInDay: PropTypes.number,
      value: PropTypes.number.isRequired, // TODO: rename to price?
      description: PropTypes.string,
    }).isRequired,
    onChange: PropTypes.func.isRequired,
  }
  render() {
    const {rate} = this.props;
    return (
      <div>
        <Col sm={4}>
          <Control.NumericInput
            prefix="€"
            label={t('client.rate.defaultPrice')}
            float
            value={rate.value}
            onChange={value => this.props.onChange({...rate, value: value})}
            data-tst="client.rate.value"
          />
        </Col>

        <Col sm={4}>
          <Control.NumericInput
            label={t('client.rate.hoursInDay')}
            value={rate.hoursInDay}
            onChange={value => this.props.onChange({...rate, hoursInDay: value})}
            data-tst="client.rate.hoursInDay"
{'fraction_non_alphanumeric': 0.14711892112791172, 'fraction_numerical': 0.0016346546791990192, 'mean_word_length': 2.330612244897959, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, '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': '3100420', 'n_tokens_mistral': 704, 'n_tokens_neox': 716, 'n_words': 147}