<commit_before>import classNames from 'classnames';
import moment from 'moment';
import React from 'react';
import {Table} from 'reactjs-components';

const taskStatus = ['running','healthy','unhealthy','staged'];
const keyCaptionMap = {
  startedAfterLastScaling: 'Started After Last Scaling',
  withLatestConfig: 'With Latest Config',
  withOutdatedConfig: 'With Outdated Config',
  totalSummary: 'Total Summary'
};

class TaskStatsTable extends React.Component {
  getTaskStats() {
    let {taskStats} = this.props;

    let data = [];
    Object.keys(keyCaptionMap).forEach(function (key) {
      if (!taskStats[key]) {
        return;
      }

      data.push(Object.assign({}, {caption: keyCaptionMap[key]}, taskStats[key].stats));
    });

    return data;
  }

  getClassName(prop, sortBy, row) {
    return classNames({
      'highlight': prop === sortBy.prop,
      'clickable': row == null, // this is a header
      'text-align-right': taskStatus.includes(prop),
      'hidden-mini': taskStatus.includes(prop)
    });
  }

  getColumns() {<commit_msg>Remove clickable class, since we cannot sort<commit_after>import classNames from 'classnames';
import moment from 'moment';
import React from 'react';
import {Table} from 'reactjs-components';

const taskStatus = ['running','healthy','unhealthy','staged'];
const keyCaptionMap = {
  startedAfterLastScaling: 'Started After Last Scaling',
  withLatestConfig: 'With Latest Config',
  withOutdatedConfig: 'With Outdated Config',
  totalSummary: 'Total Summary'
};

class TaskStatsTable extends React.Component {
  getTaskStats() {
    let {taskStats} = this.props;

    let data = [];
    Object.keys(keyCaptionMap).forEach(function (key) {
      if (!taskStats[key]) {
        return;
      }

      data.push(Object.assign({}, {caption: keyCaptionMap[key]}, taskStats[key].stats));
    });

    return data;
  }

  getClassName(prop, sortBy, row) {
    return classNames({
      'highlight': prop === sortBy.prop,
      'text-align-right': taskStatus.includes(prop),
      'hidden-mini': taskStatus.includes(prop)
    });
  }

  getColumns() {
{'fraction_non_alphanumeric': 0.14109263657957244, 'fraction_numerical': 0.0, 'mean_word_length': 3.9669811320754715, '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': '2870060', 'n_tokens_mistral': 650, 'n_tokens_neox': 631, 'n_words': 156}