<commit_before>/**
 * DashboardTable.jsx
 * Created by <NAME> 11/13/19
 */

import React from 'react';
import PropTypes from 'prop-types';
import { uniqueId } from 'lodash';

import DashboardTableHeader from 'components/dashboard/visualizations/DashboardTableHeader';

const propTypes = {
    results: PropTypes.array,
    inFlight: PropTypes.bool
};

const defaultProps = {
    results: [],
    inFlight: false
};

const tableHeaders = [
    {
        text: 'File',
        class: 'dashboard-table__file-column'
    },
    {
        text: 'Fiscal Year/ Quarter',
        class: 'dashboard-table__fyq-column'
    },
    {
        text: 'Warning Rule',
        class: 'dashboard-table__label-column'
    },
    {
        text: 'Number of Instances',
        class: 'dashboard-table__instances-column'
    },
    {
        text: 'Rule Description',
        class: null
    }
];

export default class DashboardTable extends React.Component {
    render() {
        const tableRows = this.props.results.map((row) => (
            <tr key={`dashboard-table-row-cell-${uniqueId()}`}>
                <td>
                    {row.fileLabel}
                </td><commit_msg>Removing the uniqueId and using data instead<commit_after>/**
 * DashboardTable.jsx
 * Created by <NAME> 11/13/19
 */

import React from 'react';
import PropTypes from 'prop-types';

import DashboardTableHeader from 'components/dashboard/visualizations/DashboardTableHeader';

const propTypes = {
    results: PropTypes.array,
    inFlight: PropTypes.bool
};

const defaultProps = {
    results: [],
    inFlight: false
};

const tableHeaders = [
    {
        text: 'File',
        class: 'dashboard-table__file-column'
    },
    {
        text: 'Fiscal Year/ Quarter',
        class: 'dashboard-table__fyq-column'
    },
    {
        text: 'Warning Rule',
        class: 'dashboard-table__label-column'
    },
    {
        text: 'Number of Instances',
        class: 'dashboard-table__instances-column'
    },
    {
        text: 'Rule Description',
        class: null
    }
];

export default class DashboardTable extends React.Component {
    render() {
        const tableRows = this.props.results.map((row) => (
            <tr key={`dashboard-table-row-${row.submission_id}-${row.rule_label}`}>
                <td>
                    {row.fileLabel}
                </td>
{'fraction_non_alphanumeric': 0.12670068027210885, 'fraction_numerical': 0.00510204081632653, 'mean_word_length': 2.290909090909091, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '979793', 'n_tokens_mistral': 712, 'n_tokens_neox': 716, 'n_words': 153}