<commit_before>import React from 'react'
import { connect } from 'react-redux'
import { fetchFolders } from '../../redux/modules/folders'
import PendingFolders from '../../components/PendingFolders/PendingFolders'
import RecentlyCompleted from '../../components/RecentlyCompleted/RecentlyCompleted'
import ReportPreview from '../../components/ReportPreview/ReportPreview'
import Spinner from '../../components/Spinner/Spinner'

function ReportGenerator({
  fetchingFolders,
  pendingFolders,
  recentlyCompleted,
  currentReport,
  handleFetchClick,
  fetchError,
}) {
  return (
    <div>
      {fetchingFolders
        ? <Spinner show fetching item={'folders'} />
        : <Spinner hide />
      }
      {fetchError
        ? <div>{fetchError}</div>
        : (
          <div>
            <PendingFolders folders={pendingFolders} />
            <RecentlyCompleted folders={recentlyCompleted} />
            <ReportPreview report={currentReport} />
          </div>
        )
      }
      <button onClick={handleFetchClick}>Get Recent Folders</button>
    </div>
  )
}
const { array, object } = React.PropTypes
ReportGenerator.propTypes = {
  pendingFolders: array,
  recentlyCompleted: array,
  currentReport: object,
}

function mapStateToProps(state) {
  const folders = state.folders.list.reduce((acc, nextFolder) => {
    if (nextFolder.report) {
      return {
        pending: acc.pending,
        completed: acc.completed.concat([nextFolder]),
      }
    }
    return {
      pending: acc.pending.concat([nextFolder]),
      completed: acc.completed,
    }
  }, { pending: [], completed: [] })
  return {
    fetchingFolders: state.folders.isFetching,
    pendingFolders: folders.pending,
    recentlyCompleted: folders.completed,
    currrentFolder: state.currrentFolder,
    fetchError: folders.error,
  }
}

function mapDispatchToProps(dispatch) {
  return { handleFetchClick: () => dispatch(fetchFolders('Blackburn')) }
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(ReportGenerator)
<commit_msg>change test field for completed folders<commit_after>import React from 'react'
import { connect } from 'react-redux'
import { fetchFolders } from '../../redux/modules/folders'
import PendingFolders from '../../components/PendingFolders/PendingFolders'
import RecentlyCompleted from '../../components/RecentlyCompleted/RecentlyCompleted'
import ReportPreview from '../../components/ReportPreview/ReportPreview'
import Spinner from '../../components/Spinner/Spinner'

function ReportGenerator({
  fetchingFolders,
  pendingFolders,
  recentlyCompleted,
  currentReport,
  handleFetchClick,
  fetchError,
}) {
  return (
    <div>
      {fetchingFolders
        ? <Spinner show fetching item={'folders'} />
        : <Spinner hide />
      }
      {fetchError
        ? <div>{fetchError}</div>
        : (
          <div>
            <PendingFolders folders={pendingFolders} />
            <RecentlyCompleted folders={recentlyCompleted} />
            <ReportPreview report={currentReport} />
          </div>
        )
      }
      <button onClick={handleFetchClick}>Get Recent Folders</button>
    </div>
  )
}
const { array, object } = React.PropTypes
ReportGenerator.propTypes = {
  pendingFolders: array,
  recentlyCompleted: array,
  currentReport: object,
}

function mapStateToProps(state) {
  const folders = state.folders.list.reduce((acc, nextFolder) => {
    if (nextFolder.date_completed) {
      return {
        pending: acc.pending,
        completed: acc.completed.concat([nextFolder]),
      }
    }
    return {
      pending: acc.pending.concat([nextFolder]),
      completed: acc.completed,
    }
  }, { pending: [], completed: [] })
  return {
    fetchingFolders: state.folders.isFetching,
    pendingFolders: folders.pending,
    recentlyCompleted: folders.completed,
    currrentFolder: state.currrentFolder,
    fetchError: folders.error,
  }
}

function mapDispatchToProps(dispatch) {
  return { handleFetchClick: () => dispatch(fetchFolders('Blackburn')) }
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(ReportGenerator)

{'fraction_non_alphanumeric': 0.1232943469785575, 'fraction_numerical': 0.0, 'mean_word_length': 3.2232510288065845, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 33, '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': '2361603', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1191, 'n_words': 231}