<commit_before>import React from 'react';
import UserActionsCreator from '../../actions/UserActionsCreator';

let tabTitle = {
  'fontSize': '2rem',
  'color': 'rgb(180, 180, 180)',
  'borderBottom': '1px solid rgb(180, 180, 180)',
  'textAlign': 'center',
  'marginBottom': '15px',
  'paddingBottom': '15px'
}
let buttonStyle = {
  'verticalAlign': 'top',
  'marginRight': '10px'
}

export default class EditDevSummary extends React.Component {
  updateUser(e) {
    e.preventDefault();
    let newAttributes = {}
    let currentUser = this.props.userData.currentUser.username;
    Object.keys(this.refs).forEach(key => newAttributes[key] = this.refs[key].getDOMNode().value);
    UserActionsCreator.updateUserInfo(newAttributes, currentUser);
  }
  componentDidMount() {
    let location = this.props.userData.currentUser.currentLocation ||
                   this.props.userData.currentUser.githubData.location || '';
    if (this.props.userData.currentUser.devTitle) {
      $('#user-title').select().focus().val(this.props.userData.currentUser.devTitle);
    }
    if (location) {
      $('#user-current-location').select().focus().val(location);
    }
    if (this.props.userData.currentUser.topTech1) {
      $('#tech1-input').select().focus().val(this.props.userData.currentUser.topTech1);
    }
    if (this.props.userData.currentUser.topTech2) {
      $('#tech2-input').select().focus().val(this.props.userData.currentUser.topTech2);
    }
    if (this.props.userData.currentUser.topTech3) {
      $('#tech3-input').select().focus().val(this.props.userData.currentUser.topTech3);
    }
    if (this.props.userData.currentUser.desiredLocation1) {
      $('#location1-input').select().focus().val(this.props.userData.currentUser.desiredLocation1);
    }
    if (this.props.userData.currentUser.desiredLocation1) {
      $('#location2-input').select().focus().val(this.props.userData.currentUser.desiredLocation1);
    }
    if (this.props.userData.currentUser.desiredLocation1) {
      $('#location3-input').select().focus().val(this.props.userData.currentUser.desiredLocation1);
    }
  }
  render() {
    return (
      <form className="col s12 edit-dev-summary" onSubmit={this.updateUser.bind(this)}>
        <div className="row">
          <div className="tab-title" style={tabTitle}>
            Developer Summary
          </div>
          <div className="col s12">
            <strong>Title</strong>
          </div>
          <div className="input-field col s12">
            <input id="user-title" type="text" className="validate" ref="devTitle" />
            <label htmlFor="user-title">Title (eg. Full stack developer, iOS Engineer, etc.)</label>
          </div>
          <div className="col s12">
            <strong>Current location</strong>
          </div>
          <div className="input-field col s12">
            <input id="user-current-location" type="text" className="validate" ref="currentLocation"/>
            <label htmlFor="user-title">Location</label>
          </div>
          <div className="col s12">
            <strong>Top technologies (programming languages, frameworks, UI design, Photoshop, etc.)</strong>
          </div><commit_msg>Fix autofill destination typo<commit_after>import React from 'react';
import UserActionsCreator from '../../actions/UserActionsCreator';

let tabTitle = {
  'fontSize': '2rem',
  'color': 'rgb(180, 180, 180)',
  'borderBottom': '1px solid rgb(180, 180, 180)',
  'textAlign': 'center',
  'marginBottom': '15px',
  'paddingBottom': '15px'
}
let buttonStyle = {
  'verticalAlign': 'top',
  'marginRight': '10px'
}

export default class EditDevSummary extends React.Component {
  updateUser(e) {
    e.preventDefault();
    let newAttributes = {}
    let currentUser = this.props.userData.currentUser.username;
    Object.keys(this.refs).forEach(key => newAttributes[key] = this.refs[key].getDOMNode().value);
    UserActionsCreator.updateUserInfo(newAttributes, currentUser);
  }
  componentDidMount() {
    let location = this.props.userData.currentUser.currentLocation ||
                   this.props.userData.currentUser.githubData.location || '';
    if (this.props.userData.currentUser.devTitle) {
      $('#user-title').select().focus().val(this.props.userData.currentUser.devTitle);
    }
    if (location) {
      $('#user-current-location').select().focus().val(location);
    }
    if (this.props.userData.currentUser.topTech1) {
      $('#tech1-input').select().focus().val(this.props.userData.currentUser.topTech1);
    }
    if (this.props.userData.currentUser.topTech2) {
      $('#tech2-input').select().focus().val(this.props.userData.currentUser.topTech2);
    }
    if (this.props.userData.currentUser.topTech3) {
      $('#tech3-input').select().focus().val(this.props.userData.currentUser.topTech3);
    }
    if (this.props.userData.currentUser.desiredLocation1) {
      $('#location1-input').select().focus().val(this.props.userData.currentUser.desiredLocation1);
    }
    if (this.props.userData.currentUser.desiredLocation2) {
      $('#location2-input').select().focus().val(this.props.userData.currentUser.desiredLocation2);
    }
    if (this.props.userData.currentUser.desiredLocation3) {
      $('#location3-input').select().focus().val(this.props.userData.currentUser.desiredLocation3);
    }
  }
  render() {
    return (
      <form className="col s12 edit-dev-summary" onSubmit={this.updateUser.bind(this)}>
        <div className="row">
          <div className="tab-title" style={tabTitle}>
            Developer Summary
          </div>
          <div className="col s12">
            <strong>Title</strong>
          </div>
          <div className="input-field col s12">
            <input id="user-title" type="text" className="validate" ref="devTitle" />
            <label htmlFor="user-title">Title (eg. Full stack developer, iOS Engineer, etc.)</label>
          </div>
          <div className="col s12">
            <strong>Current location</strong>
          </div>
          <div className="input-field col s12">
            <input id="user-current-location" type="text" className="validate" ref="currentLocation"/>
            <label htmlFor="user-title">Location</label>
          </div>
          <div className="col s12">
            <strong>Top technologies (programming languages, frameworks, UI design, Photoshop, etc.)</strong>
          </div>
{'fraction_non_alphanumeric': 0.16363636363636364, 'fraction_numerical': 0.01755485893416928, 'mean_word_length': 3.231432360742706, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2009146', 'n_tokens_mistral': 1986, 'n_tokens_neox': 1925, 'n_words': 304}