<commit_before>import React, { PropTypes } from 'react';
import ComputationFieldBasic from '../computation-field-basic';
import ComputationFieldCovariates from '../computation-field-covariates';
import { round } from 'lodash';

export default function ConsortiumComputationFields(props) {
  const {
    activeComputationInputs,
    fields,
    isOwner,
    updateComputationField,
  } = props;

  return (
    <ol className="list-unstyled">
      {fields.map(
        (
          {
            help,
            label,
            max,
            min,
            step,
            type,
            values,
          },
          fieldIndex
        ) => {
          const fieldProps = {
            disabled: !isOwner,
            fieldIndex,
            help,
            label,
            onChange: null,
            type,
            value: null,
          };
          let computationField;

          if (type === 'covariates') {
            /**
             * Handle covariate field changes.
             *<commit_msg>Add docblock to consortium computation fields component.<commit_after>import React, { PropTypes } from 'react';
import ComputationFieldBasic from '../computation-field-basic';
import ComputationFieldCovariates from '../computation-field-covariates';
import { round } from 'lodash';

/**
 * Consortium computation fields.
 *
 * @param {Object} props
 * @param {Array} props.activeComputationInputs Collection of inputs, matched
 * with `props.fields` by array index
 * @param {Object[]} props.fields Collection of field description objects
 * @param {boolean} props.isOwner
 * @param {Function} props.updateComputationField Handler for field changes
 * @returns {React.Component}
 */
export default function ConsortiumComputationFields({
  activeComputationInputs,
  fields,
  isOwner,
  updateComputationField,
}) {
  return (
    <ol className="list-unstyled">
      {fields.map(
        (
          {
            help,
            label,
            max,
            min,
            step,
            type,
            values,
          },
          fieldIndex
        ) => {
          const fieldProps = {
            disabled: !isOwner,
            fieldIndex,
            help,
            label,
            onChange: null,
            type,
            value: null,
          };
          let computationField;

          if (type === 'covariates') {
            /**
             * Handle covariate field changes.
             *
{'fraction_non_alphanumeric': 0.09541209906617945, 'fraction_numerical': 0.0, 'mean_word_length': 1.7226519337016575, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2409130', 'n_tokens_mistral': 632, 'n_tokens_neox': 623, 'n_words': 162}