From 4cd803466ab75d3e3c36c9fdffcbde82cb621fd6 Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Thu, 17 Jan 2019 08:57:41 +1300 Subject: [PATCH] updateFilter --- .../packages/components/src/filters/advanced/date-filter.js | 4 ++-- .../packages/components/src/filters/advanced/index.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/woocommerce-admin/packages/components/src/filters/advanced/date-filter.js b/plugins/woocommerce-admin/packages/components/src/filters/advanced/date-filter.js index 0100b5213b2..98faedce7f7 100644 --- a/plugins/woocommerce-admin/packages/components/src/filters/advanced/date-filter.js +++ b/plugins/woocommerce-admin/packages/components/src/filters/advanced/date-filter.js @@ -172,10 +172,10 @@ class DateFilter extends Component { } onRuleChange( value ) { - const { onFilterChange, filter, replaceFilter } = this.props; + const { onFilterChange, filter, updateFilter } = this.props; const { before } = this.state; if ( 'between' === filter.rule && 'between' !== value ) { - replaceFilter( { + updateFilter( { key: filter.key, rule: value, value: before ? before.format( isoDateFormat ) : undefined, diff --git a/plugins/woocommerce-admin/packages/components/src/filters/advanced/index.js b/plugins/woocommerce-admin/packages/components/src/filters/advanced/index.js index 7d978dab1b8..3893040d0a0 100644 --- a/plugins/woocommerce-admin/packages/components/src/filters/advanced/index.js +++ b/plugins/woocommerce-admin/packages/components/src/filters/advanced/index.js @@ -55,7 +55,7 @@ class AdvancedFilters extends Component { this.removeFilter = this.removeFilter.bind( this ); this.clearFilters = this.clearFilters.bind( this ); this.getUpdateHref = this.getUpdateHref.bind( this ); - this.replaceFilter = this.replaceFilter.bind( this ); + this.updateFilter = this.updateFilter.bind( this ); } componentDidUpdate( prevProps ) { @@ -86,7 +86,7 @@ class AdvancedFilters extends Component { this.setState( { activeFilters } ); } - replaceFilter( filter ) { + updateFilter( filter ) { const activeFilters = this.state.activeFilters.map( activeFilter => { if ( filter.key === activeFilter.key ) { return filter; @@ -230,7 +230,7 @@ class AdvancedFilters extends Component { onFilterChange={ this.onFilterChange } isEnglish={ isEnglish } query={ query } - replaceFilter={ this.replaceFilter } + updateFilter={ this.updateFilter } /> ) }