<commit_before>/**
  * HistoryTable.jsx
  * Created by <NAME> 6/12/17
  */

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

import * as ReviewHelper from '../../helpers/reviewHelper';

const propTypes = {
    submissionID: PropTypes.string,
    type: PropTypes.string
};

const defaultProps = {
    submissionID: ''
};

export default class HistoryHeader extends React.Component {
    constructor(props) {
        super(props);

        this.isUnmounted = false;

        this.state = {
            metadata: null
        };
    }

    componentDidMount() {
        ReviewHelper.fetchSubmissionMetadata(this.props.submissionID, this.props.type)
            .then((response) => {
                this.setState({ metadata: response });
            })
            .catch((err) => {
                console.error(err);
            });
        this.isUnmounted = false;
    }

    componentWillUnmount() {
        this.isUnmounted = false;
    }

    render() {
        if (!this.state.metadata) {
            return null;
        }
        const lastValidated = moment.utc(this.state.metadata.last_validated).local().format('MM/DD/YYYY h:mm a');
        const createdOn = moment.utc(this.state.metadata.created_on).local().format('MM/DD/YYYY');
        return (
            <div className="container">
                <div className="row header">
                    <div className="col-xs-6">
                        <p className="metadata">Agency: {this.state.metadata.agency_name}</p>
                        <p className="metadata">
                            Reporting Period Start: {this.state.metadata.reporting_period}
                        </p>
                        <p className="metadata">
                            Reporting Period End: {this.state.metadata.reporting_period}
                        </p>
                    </div>
                    <div className="col-xs-6">
                        <p className="metadata">Created: {createdOn}</p>
                        <p className="metadata">Last Validated: {lastValidated}</p>
                    </div>
                    <div className="col-xs-12">
                        <hr />
                    </div>
                </div>
            </div>
        );
    }
}

HistoryHeader.propTypes = propTypes;
HistoryHeader.defaultProps = defaultProps;<commit_msg>Cleaning up the history page to make a little more sense<commit_after>/**
  * HistoryTable.jsx
  * Created by <NAME> 6/12/17
  */

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

import * as ReviewHelper from '../../helpers/reviewHelper';

const propTypes = {
    submissionID: PropTypes.string,
    type: PropTypes.string
};

const defaultProps = {
    submissionID: ''
};

export default class HistoryHeader extends React.Component {
    constructor(props) {
        super(props);

        this.isUnmounted = false;

        this.state = {
            metadata: null
        };
    }

    componentDidMount() {
        ReviewHelper.fetchSubmissionMetadata(this.props.submissionID, this.props.type)
            .then((response) => {
                this.setState({ metadata: response });
            })
            .catch((err) => {
                console.error(err);
            });
        this.isUnmounted = false;
    }

    componentWillUnmount() {
        this.isUnmounted = false;
    }

    render() {
        if (!this.state.metadata) {
            return null;
        }
        const lastValidated = moment.utc(this.state.metadata.last_validated).local().format('MM/DD/YYYY h:mm a');
        const createdOn = moment.utc(this.state.metadata.created_on).local().format('MM/DD/YYYY');
        return (
            <div className="container">
                <div className="row header">
                    <div className="col-xs-6">
                        <p className="metadata">Agency: {this.state.metadata.agency_name}</p>
                        <p className="metadata">Reporting Period: {this.state.metadata.reporting_period}</p>
                    </div>
                    <div className="col-xs-6">
                        <p className="metadata">Created: {createdOn}</p>
                        <p className="metadata">Last Validated: {lastValidated}</p>
                    </div>
                    <div className="col-xs-12">
                        <hr />
                    </div>
                </div>
            </div>
        );
    }
}

HistoryHeader.propTypes = propTypes;
HistoryHeader.defaultProps = defaultProps;
{'fraction_non_alphanumeric': 0.12532751091703057, 'fraction_numerical': 0.003930131004366812, 'mean_word_length': 1.6556521739130434, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 49, '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': '5281178', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1195, 'n_words': 235}