<commit_before>var publishNumberStyle = {
  width: '50px',
}, publishFieldLabelStyle = {
  display: 'inline-block',
  width: '118px',
  textAlign: 'right',
  verticalAlign: 'top',
}, publishFieldStyle = {
  width: '330px',
};

var PublishPage = React.createClass({
  _requiredFields: ['name', 'file', 'meta_title', 'meta_author', 'meta_license', 'meta_description'],

  handleSubmit: function() {
    this.setState({
      submitting: true,
    });

    var missingFieldFound = false;
    for (let fieldName of this._requiredFields) {
      var field = this.refs[fieldName];
      if (field.getValue() == '') {
        field.warnRequired();
        if (!missingFieldFound) {
          field.focus();
          missingFieldFound = true;
        }
      }
    }

    if (missingFieldFound) {
      this.setState({
        submitting: false,
      });
      //return;
    }
<commit_msg>In PublishPage.handleSubmit(), return right away when data is missing<commit_after>var publishNumberStyle = {
  width: '50px',
}, publishFieldLabelStyle = {
  display: 'inline-block',
  width: '118px',
  textAlign: 'right',
  verticalAlign: 'top',
}, publishFieldStyle = {
  width: '330px',
};

var PublishPage = React.createClass({
  _requiredFields: ['name', 'file', 'meta_title', 'meta_author', 'meta_license', 'meta_description'],

  handleSubmit: function() {
    this.setState({
      submitting: true,
    });

    var missingFieldFound = false;
    for (let fieldName of this._requiredFields) {
      var field = this.refs[fieldName];
      if (field.getValue() == '') {
        field.warnRequired();
        if (!missingFieldFound) {
          field.focus();
          missingFieldFound = true;
        }
      }
    }

    if (missingFieldFound) {
      this.setState({
        submitting: false,
      });
      return;
    }

{'fraction_non_alphanumeric': 0.14395604395604394, 'fraction_numerical': 0.008791208791208791, 'mean_word_length': 2.809623430962343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2925964', 'n_tokens_mistral': 563, 'n_tokens_neox': 551, 'n_words': 120}