<commit_before>import Alert from 'react-bootstrap/lib/Alert';
import Col from 'react-bootstrap/lib/Col';
import React, { Component, PropTypes } from 'react';
import Row from 'react-bootstrap/lib/Row';

import WorkshopPickerItem from './workshopPickerItem';

export default class WorkshopPicker extends Component {
  constructor() {
    super();
    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(value) {
    this.props.onChange(this.props.name, value);
  }

  render() {
    const { disabled, error, workshops, value } = this.props;
    return (
      <Row>
        {workshops
          .filter(workshop => !workshop.fullyAssigned)
          .map(workshop => (
            <Col key={workshop.id} sm={6} lg={4}>
              <WorkshopPickerItem
                assigned={workshop.assigned}
                capacity={workshop.capacity}
                disabled={disabled || workshop.fullyReserved}
                freeSpots={workshop.freeSpots}
                id={workshop.id}
                lectors={workshop.lectors}
                name={workshop.name}
                onChange={this.handleChange}
                reserved={workshop.reserved}
                selected={value === workshop.id}
              />
            </Col>
          ))
        }
        {error ? (
          <Col xs={12}>
            <Alert bsStyle="danger">{error}</Alert>
          </Col>
        ) : null}
      </Row>
    );
  }
}

WorkshopPicker.propTypes = {
  disabled: PropTypes.bool,
  error: PropTypes.string,
  name: PropTypes.string.isRequired,
  onChange: PropTypes.func.isRequired,
  value: PropTypes.number,
  workshops: PropTypes.arrayOf(PropTypes.object).isRequired,
};

WorkshopPicker.defaultProps = {
  disabled: false,
  error: null,
  value: null,
};
<commit_msg>Don't hide workshops when fully assigned<commit_after>import Alert from 'react-bootstrap/lib/Alert';
import Col from 'react-bootstrap/lib/Col';
import React, { Component, PropTypes } from 'react';
import Row from 'react-bootstrap/lib/Row';

import WorkshopPickerItem from './workshopPickerItem';

export default class WorkshopPicker extends Component {
  constructor() {
    super();
    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(value) {
    this.props.onChange(this.props.name, value);
  }

  render() {
    const { disabled, error, workshops, value } = this.props;
    return (
      <Row>
        {workshops
          .map(workshop => (
            <Col key={workshop.id} sm={6} lg={4}>
              <WorkshopPickerItem
                assigned={workshop.assigned}
                capacity={workshop.capacity}
                disabled={disabled || workshop.fullyAssigned || workshop.fullyReserved}
                freeSpots={workshop.freeSpots}
                id={workshop.id}
                lectors={workshop.lectors}
                name={workshop.name}
                onChange={this.handleChange}
                reserved={workshop.reserved}
                selected={value === workshop.id}
              />
            </Col>
          ))
        }
        {error ? (
          <Col xs={12}>
            <Alert bsStyle="danger">{error}</Alert>
          </Col>
        ) : null}
      </Row>
    );
  }
}

WorkshopPicker.propTypes = {
  disabled: PropTypes.bool,
  error: PropTypes.string,
  name: PropTypes.string.isRequired,
  onChange: PropTypes.func.isRequired,
  value: PropTypes.number,
  workshops: PropTypes.arrayOf(PropTypes.object).isRequired,
};

WorkshopPicker.defaultProps = {
  disabled: false,
  error: null,
  value: null,
};

{'fraction_non_alphanumeric': 0.1247896803140774, 'fraction_numerical': 0.002243409983174425, 'mean_word_length': 2.225135623869801, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 24, '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': '3000453', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1016, 'n_words': 192}