<commit_before>import React, {Component, PropTypes} from 'react';
import Icon from '../shared/Icon.jsx';
import {labels, iconStatus} from '../constants';
import Helpers from '../ComponentHelpers';

class ModulesTableRow extends Component {

  getRowClassNames() {
    let build = (this.props.module.inProgressBuild ? this.props.module.inProgressBuild : this.props.module.lastBuild);
    if (build.result === 'FAILED') {
      return 'bgc-danger';
    }
  }

  getBuildResult() {
    let build = (this.props.module.inProgressBuild ? this.props.module.inProgressBuild : this.props.module.lastBuild);
    let result = build.result;
    let classNames = `icon-roomy ${labels[result]}`;

    return (
      <Icon
        name={iconStatus[result]}
        classNames={classNames}
      />
    );
  }

  render() {
    let {
      lastBuild,
      inProgressBuild,
      module,
      gitInfo,
      modulePath
    } = this.props.module;

    let build = (inProgressBuild ? inProgressBuild : lastBuild);

    let commitLink = `https://${gitInfo.host}/${gitInfo.organization}/${gitInfo.repository}/commit/${build.sha}/`;
    let startTime = Helpers.timestampFormatted(build.startTime);
    let duration = build.duration;

    if (build.result === 'IN_PROGRESS') {
      duration = 'In Progress...';
    }

    return (
      <tr className={this.getRowClassNames()}>
      <td className='build-result-link'>
        {this.getBuildResult()}
        <a href={build.buildLink}>{build.buildNumber}</a>
      </td>
        <td>
          <a href={modulePath}>{module.name}</a>
        </td>
        <td>
          {startTime}
        </td>
        <td>
          {duration}
        </td>
        <td>
          <a href={commitLink} target="_blank">{build.sha}</a>
        </td><commit_msg>Fix start times<commit_after>import React, {Component, PropTypes} from 'react';
import Icon from '../shared/Icon.jsx';
import {labels, iconStatus} from '../constants';
import Helpers from '../ComponentHelpers';

class ModulesTableRow extends Component {

  getRowClassNames() {
    let build = (this.props.module.inProgressBuild ? this.props.module.inProgressBuild : this.props.module.lastBuild);
    if (build.result === 'FAILED') {
      return 'bgc-danger';
    }
  }

  getBuildResult() {
    let build = (this.props.module.inProgressBuild ? this.props.module.inProgressBuild : this.props.module.lastBuild);
    let result = build.result;
    let classNames = `icon-roomy ${labels[result]}`;

    return (
      <Icon
        name={iconStatus[result]}
        classNames={classNames}
      />
    );
  }

  render() {
    let {
      lastBuild,
      inProgressBuild,
      module,
      gitInfo,
      modulePath
    } = this.props.module;

    let build = (inProgressBuild ? inProgressBuild : lastBuild);

    let commitLink = `https://${gitInfo.host}/${gitInfo.organization}/${gitInfo.repository}/commit/${build.sha}/`;
    let startTime = Helpers.timestampFormatted(build.startTimestamp);
    let duration = build.duration;

    if (build.result === 'IN_PROGRESS') {
      duration = 'In Progress...';
    }

    return (
      <tr className={this.getRowClassNames()}>
      <td className='build-result-link'>
        {this.getBuildResult()}
        <a href={build.buildLink}>{build.buildNumber}</a>
      </td>
        <td>
          <a href={modulePath}>{module.name}</a>
        </td>
        <td>
          {startTime}
        </td>
        <td>
          {duration}
        </td>
        <td>
          <a href={commitLink} target="_blank">{build.sha}</a>
        </td>
{'fraction_non_alphanumeric': 0.15237559741355075, 'fraction_numerical': 0.0, 'mean_word_length': 2.5402985074626865, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 2, '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': '371070', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1085, 'n_words': 207}