<commit_before>require('style!./../../../../../css/components/ngFileUpload.css');
/**
 * @file AngularJS component displaying the capability of uploading an excel file
 * (via dropzone).
 */
const metadataUploader = {
  templateUrl: 'upload.component.tmpl.html',
  controller($state, $stateParams, sampleMetadataService) {
    // Display any errors if they were sent.
    this.errors = $stateParams.errors;

    this.uploadFiles = function(files) {
      sampleMetadataService.uploadMetadata(files[0])
        .then(() => {
          $state.go('sampleId');
        }, () => {
          this.badFile = true;
        });
    };
  }
};

export default metadataUploader;
<commit_msg>Added warm and fuzzy comments ;)<commit_after>require('style!./../../../../../css/components/ngFileUpload.css');
/**
 * @file AngularJS component displaying the capability of uploading an excel file
 * (via dropzone).
 */
const metadataUploader = {
  templateUrl: 'upload.component.tmpl.html',
  controller($state, $stateParams, sampleMetadataService) {
    // Display any errors if they were sent.
    this.errors = $stateParams.errors;

    this.uploadFiles = function(files) {
      sampleMetadataService.uploadMetadata(files[0])
        .then(() => {
          // If the response is 'success' go to the next stage
          // to select which column is the sample name
          $state.go('sampleId');
        }, () => {
          // If the response is 'error' stay on this stage
          // display the file warning message.
          this.badFile = true;
        });
    };
  }
};

export default metadataUploader;

{'fraction_non_alphanumeric': 0.14303560274828234, 'fraction_numerical': 0.0012492192379762648, 'mean_word_length': 2.63265306122449, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '145686', 'n_tokens_mistral': 446, 'n_tokens_neox': 432, 'n_words': 117}