<commit_before>import FilterBox from "./box";
import TenderPrice from "../../filters/tender-price";
import AwardValue from "../../filters/award-value";

class ValueAmount extends FilterBox{
  getTitle(){
    return 'Value amount';
  }

  renderChild(slug, Component){
    const {state, onUpdate, translations} = this.props;
    const minValue = state.get('min'+slug);
    const maxValue = state.get('max'+slug);
    return <Component
               translations={translations}
               minValue={minValue}
               maxValue={maxValue}
               onUpdate={({min, max}) => {
                   minValue != min && onUpdate("min"+slug, min);
                   maxValue != max && onUpdate("max"+slug, max);
                 }}
    />
  }

  getBox(){
    return (
      <div className="box-content">
        {this.renderChild("TenderValue", TenderPrice)}
        {this.renderChild("AwardValue", AwardValue)}
      </div>
    )
  }
}

export default ValueAmount;<commit_msg>OCE-249 Value amount box now prevents value filters being set if the selected value is same as [min, max]<commit_after>import FilterBox from "./box";
import TenderPrice from "../../filters/tender-price";
import AwardValue from "../../filters/award-value";

class ValueAmount extends FilterBox{
  getTitle(){
    return 'Value amount';
  }

  renderChild(slug, Component){
    const {state, onUpdate, translations} = this.props;
    const minValue = state.get('min'+slug);
    const maxValue = state.get('max'+slug);
    return (
			<Component
			translations={translations}
			minValue={minValue}
			maxValue={maxValue}
			onUpdate={({min, max}, {min: minPossibleValue, max: maxPossibleValue}) => {
				if(minValue != min){
					onUpdate("min"+slug, min == minPossibleValue ? "" : min)
				}
				if(maxValue != max){
					onUpdate("max"+slug, max == maxPossibleValue ? "" : max)
				}
			}}
			/>
		)
  }

  getBox(){
    return (
      <div className="box-content">
        {this.renderChild("TenderValue", TenderPrice)}
        {this.renderChild("AwardValue", AwardValue)}
      </div>
    )
  }
}

export default ValueAmount;
{'fraction_non_alphanumeric': 0.14947965941343425, 'fraction_numerical': 0.0014191106906338694, 'mean_word_length': 2.8176895306859207, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '927212', 'n_tokens_mistral': 668, 'n_tokens_neox': 631, 'n_words': 145}