<commit_before>import React from 'react';
import BaseEditor from './BaseEditor';
import NumberFormGroup from './NumberFormGroup';
import RankFormGroup from './RankFormGroup';
import TextAreaFormGroup from './TextAreaFormGroup';
import TextFormGroup from './TextFormGroup';

export default class PowerEditor extends React.Component {

	descriptionChange = e => this.props.onChange(Object.assign({}, this.props.item, {description: e.target.value}), this.props.index);
	durationChange    = e => this.props.onChange(Object.assign({}, this.props.item, {duration: e.target.value}), this.props.index);
	nameChange        = e => this.props.onChange(Object.assign({}, this.props.item, {name: e.target.value}), this.props.index);
	onDelete          = event => {
		event.preventDefault();
		this.props.onDelete(this.props.index);
	};
	powerPointChange  = e => this.props.onChange(Object.assign({}, this.props.item, {powerPoints: parseInt(e.target.value, 10)}), this.props.index);
	rangeChange       = e => this.props.onChange(Object.assign({}, this.props.item, {range: e.target.value}), this.props.index);
	rankChange        = e => this.props.onChange(Object.assign({}, this.props.item, {rank: e.target.value}), this.props.index);

	render() {
		return (
				<BaseEditor id={this.props.id} onDelete={this.onDelete}>
					<TextFormGroup id='powerName' label='Name' onChange={this.nameChange} required={true}
					               value={this.props.item.name}/>
					<TextAreaFormGroup id={"powerDescription"}
					                   label="Description"
					                   onChange={this.descriptionChange}
					                   value={this.props.item.description}/>
					<RankFormGroup id={'powerRank'} onChange={this.rankChange} rank={this.props.item.rank} required={true}/>
					<NumberFormGroup id={'powerPowerPoints'} label={'Power Points'} onChange={this.powerPointChange}
					                 required={true} value={this.props.item.powerPoints}/>
					<TextFormGroup id='powerRange' label='Range' onChange={this.rangeChange} required={true}
					               value={this.props.item.range}/>
					<TextFormGroup id='powerDuration' label='Duration' onChange={this.durationChange} required={true}
					               value={this.props.item.duration}/>
				</BaseEditor>
		);
	}
}<commit_msg>Added rank to a power.<commit_after>import React from 'react';
import BaseEditor from './BaseEditor';
import NumberFormGroup from './NumberFormGroup';
import RankSelectFormGroup from './RankSelectFormGroup';
import TextAreaFormGroup from './TextAreaFormGroup';
import TextFormGroup from './TextFormGroup';

export default class PowerEditor extends React.Component {

	descriptionChange = e => this.props.onChange(Object.assign({}, this.props.item, {description: e.target.value}), this.props.index);
	durationChange    = e => this.props.onChange(Object.assign({}, this.props.item, {duration: e.target.value}), this.props.index);
	nameChange        = e => this.props.onChange(Object.assign({}, this.props.item, {name: e.target.value}), this.props.index);
	onDelete          = event => {
		event.preventDefault();
		this.props.onDelete(this.props.index);
	};
	powerPointChange  = e => this.props.onChange(Object.assign({}, this.props.item, {powerPoints: parseInt(e.target.value, 10)}), this.props.index);
	rangeChange       = e => this.props.onChange(Object.assign({}, this.props.item, {range: e.target.value}), this.props.index);
	rankChange        = e => this.props.onChange(Object.assign({}, this.props.item, {rank: e.target.value}), this.props.index);

	render() {
		return (
				<BaseEditor id={this.props.id} onDelete={this.onDelete}>
					<TextFormGroup id='powerName' label='Name' onChange={this.nameChange} required={true}
					               value={this.props.item.name}/>
					<TextAreaFormGroup id={"powerDescription"}
					                   label="Description"
					                   onChange={this.descriptionChange}
					                   value={this.props.item.description}/>
					<RankSelectFormGroup id={'powerRank'} onChange={this.rankChange} rank={this.props.item.rank} required={true}/>
					<NumberFormGroup id={'powerPowerPoints'} label={'Power Points'} onChange={this.powerPointChange}
					                 required={true} value={this.props.item.powerPoints}/>
					<TextFormGroup id='powerRange' label='Range' onChange={this.rangeChange} required={true}
					               value={this.props.item.range}/>
					<TextFormGroup id='powerDuration' label='Duration' onChange={this.durationChange} required={true}
					               value={this.props.item.duration}/>
				</BaseEditor>
		);
	}
}
{'fraction_non_alphanumeric': 0.15606685478619492, 'fraction_numerical': 0.0008682439765574126, 'mean_word_length': 3.682926829268293, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 33, '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': '5985742', 'n_tokens_mistral': 1448, 'n_tokens_neox': 1316, 'n_words': 240}