<commit_before>import React from 'react';
import { Link } from 'react-router';

import throbber16 from '../../assets/images/throbber-16.gif';
import { preventDefault } from '../utils';

import GroupFeedTypePicker from './group-feed-type-picker';


export default class GroupCreateForm extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      username:     '',
      screenName:   '',
      description:  '',
      isPrivate:    '0',
      isRestricted: '0'
    };
  }

  handleChange = (property) => (event) => {
    const newState = {};
    newState[property] = event.target.value;
    this.setState(newState);
  };

  handlePrivacyTypeChange = (privacySettings) => {
    this.setState(privacySettings);
  };

  saveSettings = () => {
    if (this.props.status !== 'loading') {
      this.props.createGroup(this.state);
    }
  };

  componentWillUnmount() {
    this.props.resetGroupCreateForm();
  }

  render() {
    return (
      <div>
        {this.props.status !== 'success' ? (
          <form onSubmit={preventDefault(this.saveSettings)}>
            <div className="form-group">
              <label htmlFor="username">Username:</label>
              <input id="username" className="form-control" name="username" type="text" value={this.state.username} onChange={this.handleChange('username')} />
            </div>
            <div className="form-group">
              <label htmlFor="screenName">Display name:</label>
              <input id="screenName" className="form-control" name="screenName" type="text" value={this.state.screenName} onChange={this.handleChange('screenName')} />
            </div>
            <div className="form-group">
              <label htmlFor="description">Description:</label>
              <textarea id="description" className="form-control" name="description" value={this.state.description} onChange={this.handleChange('description')} maxLength="1500" />
            </div>
            <GroupFeedTypePicker
              isPrivate={this.state.isPrivate}
              isRestricted={this.state.isRestricted}
              updateGroupPrivacySettings={this.handlePrivacyTypeChange}
            />
            <p>
              <button className="btn btn-default" type="submit">Create</button>
              {this.props.status === 'loading' ? (
                <span className="settings-throbber">
                  <img width="16" height="16" src={throbber16} />
                </span>
              ) : false}
            </p>
          </form><commit_msg>Add missing props to the group privacy selector in group creation form<commit_after>import React from 'react';
import { Link } from 'react-router';

import throbber16 from '../../assets/images/throbber-16.gif';
import { preventDefault } from '../utils';

import GroupFeedTypePicker from './group-feed-type-picker';


export default class GroupCreateForm extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      username:     '',
      screenName:   '',
      description:  '',
      isPrivate:    '0',
      isProtected:  '0',
      isRestricted: '0'
    };
  }

  handleChange = (property) => (event) => {
    const newState = {};
    newState[property] = event.target.value;
    this.setState(newState);
  };

  handlePrivacyTypeChange = (privacySettings) => {
    this.setState(privacySettings);
  };

  saveSettings = () => {
    if (this.props.status !== 'loading') {
      this.props.createGroup(this.state);
    }
  };

  componentWillUnmount() {
    this.props.resetGroupCreateForm();
  }

  render() {
    return (
      <div>
        {this.props.status !== 'success' ? (
          <form onSubmit={preventDefault(this.saveSettings)}>
            <div className="form-group">
              <label htmlFor="username">Username:</label>
              <input id="username" className="form-control" name="username" type="text" value={this.state.username} onChange={this.handleChange('username')} />
            </div>
            <div className="form-group">
              <label htmlFor="screenName">Display name:</label>
              <input id="screenName" className="form-control" name="screenName" type="text" value={this.state.screenName} onChange={this.handleChange('screenName')} />
            </div>
            <div className="form-group">
              <label htmlFor="description">Description:</label>
              <textarea id="description" className="form-control" name="description" value={this.state.description} onChange={this.handleChange('description')} maxLength="1500" />
            </div>
            <GroupFeedTypePicker
              isPrivate={this.state.isPrivate}
              isProtected={this.state.isProtected}
              isRestricted={this.state.isRestricted}
              updateGroupPrivacySettings={this.handlePrivacyTypeChange}
            />
            <p>
              <button className="btn btn-default" type="submit">Create</button>
              {this.props.status === 'loading' ? (
                <span className="settings-throbber">
                  <img width="16" height="16" src={throbber16} />
                </span>
              ) : false}
            </p>
          </form>
{'fraction_non_alphanumeric': 0.14828313830807596, 'fraction_numerical': 0.006330328026088625, 'mean_word_length': 2.4529801324503313, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 63, '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': '2960647', 'n_tokens_mistral': 1453, 'n_tokens_neox': 1428, 'n_words': 251}