<commit_before>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { reduxForm, initialize } from 'redux-form';
import UserSettings from '../components/UserSettings';
import { updateUser } from '../actions/UserActions';


function validateContact(data) {
  const errors = {};
  if (!data.username) {
    errors.username = 'Required';
  }
  if (!data.firstName) {
    errors.firstName = 'Required';
  }
  if (!data.lastName) {
    errors.lastName = 'Required';
  }
  if (!data.email) {
    errors.email = 'Required';
  } else if (!data.email.match('.+\@.+\..+')) {
    errors.email = 'Invalid email';
  }
  return errors;
}


@connect(
  state => ({ user: state.auth.username ? state.users[state.auth.username] : {} }),
  { initialize, updateUser }
)
@reduxForm({
  form: 'contact',
  fields: ['username', 'firstName', 'lastName', 'email'],
  validate: validateContact
})
export default class UserSettingsWrapper extends Component {
  static propTypes = {
    user: PropTypes.object.isRequired,
    fields: PropTypes.object.isRequired,
    handleSubmit: PropTypes.func.isRequired,
    initialize: PropTypes.func.isRequired,
    updateUser: PropTypes.func.isRequired
  };

  componentWillReceiveProps(newProps) {<commit_msg>Update decorator order to fix user settings page<commit_after>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { reduxForm, initialize } from 'redux-form';
import UserSettings from '../components/UserSettings';
import { updateUser } from '../actions/UserActions';


function validateContact(data) {
  const errors = {};
  if (!data.username) {
    errors.username = 'Required';
  }
  if (!data.firstName) {
    errors.firstName = 'Required';
  }
  if (!data.lastName) {
    errors.lastName = 'Required';
  }
  if (!data.email) {
    errors.email = 'Required';
  } else if (!data.email.match('.+\@.+\..+')) {
    errors.email = 'Invalid email';
  }
  return errors;
}


@reduxForm({
  form: 'contact',
  fields: ['username', 'firstName', 'lastName', 'email'],
  validate: validateContact
})
@connect(
  state => ({ user: state.auth.username ? state.users[state.auth.username] : {} }),
  { initialize, updateUser }
)
export default class UserSettingsWrapper extends Component {
  static propTypes = {
    user: PropTypes.object.isRequired,
    fields: PropTypes.object.isRequired,
    handleSubmit: PropTypes.func.isRequired,
    initialize: PropTypes.func.isRequired,
    updateUser: PropTypes.func.isRequired
  };

  componentWillReceiveProps(newProps) {
{'fraction_non_alphanumeric': 0.1515740380878352, 'fraction_numerical': 0.0, 'mean_word_length': 4.007782101167315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1866630', 'n_tokens_mistral': 775, 'n_tokens_neox': 780, 'n_words': 181}