<commit_before>var React = require('react');
var Reflux = require('reflux');
var styleMixin = require('mixins/style-mixin');

var userDataStore = require('stores/user-data');
var userDataActions = require('actions/user-data');

var UserInfo = React.createClass({

  mixins: [
    styleMixin(require('./style.scss')),
    Reflux.listenTo(userDataStore, 'onUserDataChanged')
  ],

  getInitialState: function getInitialState () {
    return {
      model: {},
      error: {}
    };
  },

  componentWillMount: function componentWillMount () {
    userDataActions.fetchUserData();
  },

  onUserDataChanged: function onUserDataChanged (userData) {
    if (userData.model) {
      this.setState({
        model: userData.model
      });
    } else if (userData.error) {
      // TODO we can add more error handling login for the component
      this.setState({
        error: userData.error
      });
    }
  },

  render: function render () {
    return (
      <div className='cc-user-info grid-14'>
        <div className='cc-user-info-item row fixed-height-1'>
          <div className='cc-user-info-item__label columns medium-4'>
            <span className='cc-user-info-item__label-text'>
              Email
            </span>
          </div>

          <div className='cc-user-info-item__value columns medium-10'>
            <span className='cc-user-info-item__value-text'>
              {this.state.model.email}
            </span>
          </div>
        </div>

        <div className='cc-user-info-item row fixed-height-1'>
          <div className='cc-user-info-item__label columns medium-4'>
            <span className='cc-user-info-item__label-text'>
              Password
            </span>
          </div>

          <div className='cc-user-info-item__value columns medium-10'>
            <a href={window.yetu.config.authChangePasswordURL} target='_blank'>Change password</a>
          </div>
        </div>
      </div>
    );
  }
});

module.exports = UserInfo;<commit_msg>Display registration date in user settings<commit_after>var React = require('react');
var Reflux = require('reflux');
var styleMixin = require('mixins/style-mixin');

var userDataStore = require('stores/user-data');
var userDataActions = require('actions/user-data');

var UserInfo = React.createClass({

  mixins: [
    styleMixin(require('./style.scss')),
    Reflux.listenTo(userDataStore, 'onUserDataChanged')
  ],

  getInitialState: function getInitialState () {
    return {
      model: {},
      error: {}
    };
  },

  componentWillMount: function componentWillMount () {
    userDataActions.fetchUserData();
  },

  onUserDataChanged: function onUserDataChanged (userData) {
    if (userData.model) {
      this.setState({
        model: userData.model
      });
    } else if (userData.error) {
      // TODO we can add more error handling login for the component
      this.setState({
        error: userData.error
      });
    }
  },

  render: function render () {
    var emailRow = this.row('Email',
      (<span className='cc-user-info-item__value-text'>
        {this.state.model.email}
      </span>)
    );

    var registrationDateRow = this.row('Registration date',
      (<span className='cc-user-info-item__value-text'>
        {this.state.model.registrationDate}
      </span>)
    );

    var passwordRow = this.row('Password',
      (<a href={window.yetu.config.authChangePasswordURL} target='_blank'>Change password</a>)
    );

    return (
      <div className='cc-user-info grid-14'>
        {emailRow}
        {registrationDateRow}
        {passwordRow}
      </div>
    );
  },

  row: function row (label, value) {
    return (
      <div className='cc-user-info-item row fixed-height-1'>
        <div className='cc-user-info-item__label columns medium-4'>
            <span className='cc-user-info-item__label-text'>
              {label}
            </span>
        </div>
        <div className='cc-user-info-item__value columns medium-10'>
          {value}
        </div>
      </div>
    );
  }
});

module.exports = UserInfo;
{'fraction_non_alphanumeric': 0.14060963618485742, 'fraction_numerical': 0.003933136676499509, 'mean_word_length': 2.442470389170897, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '5527245', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1209, 'n_words': 237}