<commit_before>import React, { Component } from 'react'
import { connect } from 'react-redux'
import Immutable from 'immutable'
import { push } from 'react-router-redux'
import store from '../store'

import * as actions from '../actions/report_details'
import LocationSelector from '../components/location_selector.js'
import UploadPhotoButton from '../components/upload_photo.js'
import Submit from '../components/submit.js'
import Input from '../components/input.js'
import Header from '../components/header.js'

import { goodmans_fields } from '../lib/siteData.js'

const optionsTree = Immutable.fromJS(goodmans_fields)

class ReportDetails extends Component {
  constructor(props) {
    super(props)
  }

  componentDidMount() {
    console.log()
    if (!this.props.reportType || !this.props.site) {
      store.dispatch(push('/site'))
    }
  }

  render() {
    const {
      name,
      description,
      setName,
      setDescription,
      locationSelectorProps,
      setPhoto,
      photoData,
      submitReport,
      isSubmitting
    } = this.props

    const allLocationSelectorProps = {
      optionsTree,
      ...locationSelectorProps
    }

    const canSend =
      description &&
      (locationSelectorProps.locationThree ||
        locationSelectorProps.locationOne === 'Other')
    return (
      <div className='w-100 center f_lato mb3'>
        <Header location={'UPLOAD'} />
        <UploadPhotoButton setPhoto={setPhoto} photoData={photoData} />
        <Input value={name} onChange={setName} label='Name (Optional)' />
        <LocationSelector {...allLocationSelectorProps} />
        <Input
          value={description}
          onChange={setDescription}
          label='This is what I saw...'
        />
        <Submit
          enabled={canSend}
          submit={submitReport}
          isSubmitting={isSubmitting}<commit_msg>WIP create link from dropdown items to the report page related to #113<commit_after>import React, { Component } from 'react'
import { connect } from 'react-redux'
import Immutable from 'immutable'
import { push } from 'react-router-redux'
import store from '../store'

import * as actions from '../actions/report_details'
import LocationSelector from '../components/location_selector.js'
import UploadPhotoButton from '../components/upload_photo.js'
import Submit from '../components/submit.js'
import Input from '../components/input.js'
import Header from '../components/header.js'

import * as siteData from '../lib/siteData.js'


class ReportDetails extends Component {
  constructor(props) {
    super(props)
  }

  componentDidMount() {
    console.log()
    if (!this.props.reportType || !this.props.site) {
      store.dispatch(push('/site'))
    }
  }

  render() {

    const {
      name,
      description,
      setName,
      setDescription,
      locationSelectorProps,
      setPhoto,
      photoData,
      submitReport,
      isSubmitting,
      match
    } = this.props

    console.log(match)

    const currentSite = Object.keys(siteData).find((key) => siteData[key].path === match.params.site)
    const optionsTree = Immutable.fromJS(currentSite.location);


    const allLocationSelectorProps = {
      optionsTree,
      ...locationSelectorProps
    }

    const canSend =
      description &&
      (locationSelectorProps.locationThree ||
        locationSelectorProps.locationOne === 'Other')
    return (
      <div className='w-100 center f_lato mb3'>
        <Header location={'UPLOAD'} />
        <UploadPhotoButton setPhoto={setPhoto} photoData={photoData} />
        <Input value={name} onChange={setName} label='Name (Optional)' />
        <LocationSelector {...allLocationSelectorProps} />
        <Input
          value={description}
          onChange={setDescription}
          label='This is what I saw...'
        />
        <Submit
          enabled={canSend}
          submit={submitReport}
          isSubmitting={isSubmitting}
{'fraction_non_alphanumeric': 0.11918678526048285, 'fraction_numerical': 0.0027954256670902162, 'mean_word_length': 2.8213592233009708, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 16, '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': '5436877', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1068, 'n_words': 253}