<commit_before>import FilterBox from "./box";

import MultipleSelect from "../../filters/inputs/multiple-select";

class ProcurementMethod extends MultipleSelect{
  getTitle(t){
    return 'Procurement method';
  }

  getId(option){
    return option.get('_id');
  }

  getLabel(option){
    return option.get('_id');
  }

  transform(data){
    return data.filter(({_id}) => !!_id);
  }
}

ProcurementMethod.ENDPOINT = 'ocds/procurementMethod/all';

class ProcurementMethodBox extends FilterBox{
  getTitle(){
    return 'Procurement Method';
  }

  getBox(){
    return (
      <div className="box-content">
        {this.renderChild(ProcurementMethod, 'procurementMethod')}
      </div>
    )
  }
}

export default ProcurementMethodBox;
<commit_msg>OCE-254 Procurement Method filter now notifies whether it's active<commit_after>import FilterBox from "./box";
import MultipleSelect from "../../filters/inputs/multiple-select";
import {Set} from "immutable";

class ProcurementMethod extends MultipleSelect{
  getTitle(t){
    return 'Procurement method';
  }

  getId(option){
    return option.get('_id');
  }

  getLabel(option){
    return option.get('_id');
  }

  transform(data){
    return data.filter(({_id}) => !!_id);
  }
}

ProcurementMethod.ENDPOINT = 'ocds/procurementMethod/all';

class ProcurementMethodBox extends FilterBox{
  isActive(){
    const {appliedFilters} = this.props;
    return appliedFilters.get('procurementMethod', Set()).count() > 0;
  }

  getTitle(){
    return 'Procurement Method';
  }

  getBox(){
    return (
      <div className="box-content">
        {this.renderChild(ProcurementMethod, 'procurementMethod')}
      </div>
    )
  }
}

export default ProcurementMethodBox;

{'fraction_non_alphanumeric': 0.13911525029103608, 'fraction_numerical': 0.002328288707799767, 'mean_word_length': 3.8016759776536313, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, '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': '3014557', 'n_tokens_mistral': 570, 'n_tokens_neox': 549, 'n_words': 112}