<commit_before>import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'

import ReduxFormWrapper from 'shared/components/form/ReduxFormWrapper'
import { Multiselect } from 'shared/components/form/Inputs'
import Modal from 'shared/components/modal/Modal'

import { updateProject, getProjectCategoriesByGuid } from 'redux/rootReducer'


const EditProjectCategoriesModal = (props) => {
  const categories = Object.values(props.projectCategoriesByGuid).map((projectCategory) => {
    return { value: projectCategory.guid, text: projectCategory.name, key: projectCategory.guid }
  })
  const NAME = `editProjectCategories-${props.project.projectGuid}`
  return (
    <Modal trigger={props.trigger} popup={props.popup} title="Edit Project Categories" modalName={NAME}>
      <ReduxFormWrapper
        initialValues={{
          categories: props.project.projectCategoryGuids,
          projectGuid: props.project.projectGuid,
          projectField: 'categories',
        }}
        onSubmit={props.updateProject}
        form={NAME}
        fields={[
          {
            name: 'categories',
            options: categories,
            component: Multiselect,
            additionLabel: 'Category: ',
            placeholder: 'Project categories',
            color: 'blue',
          },
        ]}
      />
    </Modal>
  )
}

EditProjectCategoriesModal.propTypes = {
  trigger: PropTypes.node,
  project: PropTypes.object,
  projectCategoriesByGuid: PropTypes.object,
  updateProject: PropTypes.func,
  popup: PropTypes.object,
}

const mapStateToProps = state => ({<commit_msg>use camelcase for variable<commit_after>import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'

import ReduxFormWrapper from 'shared/components/form/ReduxFormWrapper'
import { Multiselect } from 'shared/components/form/Inputs'
import Modal from 'shared/components/modal/Modal'

import { updateProject, getProjectCategoriesByGuid } from 'redux/rootReducer'


const EditProjectCategoriesModal = (props) => {
  const categories = Object.values(props.projectCategoriesByGuid).map((projectCategory) => {
    return { value: projectCategory.guid, text: projectCategory.name, key: projectCategory.guid }
  })
  const formName = `editProjectCategories-${props.project.projectGuid}`
  return (
    <Modal trigger={props.trigger} popup={props.popup} title="Edit Project Categories" modalName={formName}>
      <ReduxFormWrapper
        initialValues={{
          categories: props.project.projectCategoryGuids,
          projectGuid: props.project.projectGuid,
          projectField: 'categories',
        }}
        onSubmit={props.updateProject}
        form={formName}
        fields={[
          {
            name: 'categories',
            options: categories,
            component: Multiselect,
            additionLabel: 'Category: ',
            placeholder: 'Project categories',
            color: 'blue',
          },
        ]}
      />
    </Modal>
  )
}

EditProjectCategoriesModal.propTypes = {
  trigger: PropTypes.node,
  project: PropTypes.object,
  projectCategoriesByGuid: PropTypes.object,
  updateProject: PropTypes.func,
  popup: PropTypes.object,
}

const mapStateToProps = state => ({
{'fraction_non_alphanumeric': 0.10835629017447199, 'fraction_numerical': 0.0, 'mean_word_length': 3.3, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '830959', 'n_tokens_mistral': 884, 'n_tokens_neox': 877, 'n_words': 187}