<commit_before>import React, { PropTypes } from 'react';
import classNames from 'classnames';
import styles from './Widget.css';
import { logger } from '../../commons';
import Autocomplete from './Autocomplete';
import Categories from './Categories';
import PureComponent from 'react-pure-render/component';


export default class Filters extends PureComponent {
  constructor(properties) {
    super(properties);
    this.state = properties.location.query;
    this.handleChange = this.handleChange.bind(this);
  }
  handleChange(e){
    const val = e.currentTarget.value;
    const name = e.currentTarget.name;
    this.setState({[name]:val});
    document.getElementById('plugin-search-form').dispatchEvent(new Event("submit"));
  }
  render() {
    const {categories, labels, location, handleChecks, router, showResults} = this.props;
    return (
        <div className={classNames(styles.FiltersBox)}>
        <div className={classNames(styles.filters, 'filters', ((showResults)? 'col-md-2' :'container'))}>
          <div className={classNames(styles.Header,'row')}>
            <div className={(showResults)?'col-md-12':'col-md-3'}>
              <fieldset>
                <legend>Sort {location.query.sort}</legend>
                <label><input type="radio" name="sort" value="name" checked = {this.state.sort === 'name' || !this.state.sort} onChange={this.handleChange} /> Relevance</label>
                <label><input type="radio" name="sort" value="trend" checked = {this.state.sort === 'trend'} onChange={this.handleChange}  /> Trend</label>
                <label><input type="radio" name="sort" value="installed" checked = {this.state.sort === 'installed'} onChange={this.handleChange}  /> Installed</label>
                <label><input type="radio" name="sort" value="title" checked = {this.state.sort === 'title'} onChange={this.handleChange}  /> Title</label>
                <label><input type="radio" name="sort" value="updated" checked = {this.state.sort === 'updated'} onChange={this.handleChange}  /> Updated date</label>
                <label><input type="radio" name="sort" value="created" checked = {this.state.sort === 'created'}  onChange={this.handleChange}  /> Created date</label>
              </fieldset>
              <fieldset>
                <legend>Filters <button onClickCapture={this.handleChange} name="clear" value="core,maintainers" className={classNames('btn btn-secondary btn-sm')}>Clear all</button></legend>
                <Autocomplete
                  label="Maintainers"
                  name="maintainers"
                  placeholder="Plugin maintainers"
                />

                <Autocomplete<commit_msg>[CBN-320] fixing filter names and labels<commit_after>import React, { PropTypes } from 'react';
import classNames from 'classnames';
import styles from './Widget.css';
import { logger } from '../../commons';
import Autocomplete from './Autocomplete';
import Categories from './Categories';
import PureComponent from 'react-pure-render/component';


export default class Filters extends PureComponent {
  constructor(properties) {
    super(properties);
    this.state = properties.location.query;
    this.handleChange = this.handleChange.bind(this);
  }
  handleChange(e){
    const val = e.currentTarget.value;
    const name = e.currentTarget.name;
    this.setState({[name]:val});
    document.getElementById('plugin-search-form').dispatchEvent(new Event("submit"));
  }
  render() {
    const {categories, labels, location, handleChecks, router, showResults} = this.props;
    return (
        <div className={classNames(styles.FiltersBox)}>
        <div className={classNames(styles.filters, 'filters', ((showResults)? 'col-md-2' :'container'))}>
          <div className={classNames(styles.Header,'row')}>
            <div className={(showResults)?'col-md-12':'col-md-3'}>
              <fieldset>
                <legend>Sort {location.query.sort}</legend>
                <label><input type="radio" name="sort" value="relevance" checked = {this.state.sort === 'relevance' || !this.state.sort} onChange={this.handleChange} /> Relevance</label>
                <label><input type="radio" name="sort" value="installed" checked = {this.state.sort === 'installed'} onChange={this.handleChange}  /> Most installed</label>
                <label><input type="radio" name="sort" value="trend" checked = {this.state.sort === 'trend'} onChange={this.handleChange}  /> Recently installed</label>
                <label><input type="radio" name="sort" value="title" checked = {this.state.sort === 'title'} onChange={this.handleChange}  /> Title</label>
                <label><input type="radio" name="sort" value="updated" checked = {this.state.sort === 'updated'} onChange={this.handleChange}  /> Release date</label>
              </fieldset>
              <fieldset>
                <legend>Filters <button onClickCapture={this.handleChange} name="clear" value="core,maintainers" className={classNames('btn btn-secondary btn-sm')}>Clear all</button></legend>
                <Autocomplete
                  label="Maintainers"
                  name="maintainers"
                  placeholder="Plugin maintainers"
                />

                <Autocomplete
{'fraction_non_alphanumeric': 0.1567804691970246, 'fraction_numerical': 0.002098035475872592, 'mean_word_length': 3.2392886014551334, 'pattern_counts': {'":': 0, '<': 66, '<?xml version=': 0, '>': 64, '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': '7299028', 'n_tokens_mistral': 1453, 'n_tokens_neox': 1403, 'n_words': 296}