* Fix Filters' staticParams

* Don't update report table page when chart type is changed or filter menu has been opened.

Co-authored-by: Jeff Stieler <jeff.m.stieler@gmail.com>
This commit is contained in:
Paul Sealock 2020-06-02 11:03:26 +12:00 committed by GitHub
parent c7aeeb8b8c
commit 7a62d36516
9 changed files with 13 additions and 9 deletions

View File

@ -43,7 +43,7 @@ export const charts = applyFilters( CATEGORY_REPORT_CHARTS_FILTER, [
export const filters = applyFilters( CATEGORY_REPORT_FILTERS_FILTER, [
{
label: __( 'Show', 'woocommerce-admin' ),
staticParams: [],
staticParams: [ 'chartType', 'paged', 'per_page' ],
param: 'filter',
showFilters: () => true,
filters: [

View File

@ -34,7 +34,7 @@ export const charts = applyFilters( COUPON_REPORT_CHARTS_FILTER, [
export const filters = applyFilters( COUPON_REPORT_FILTERS_FILTER, [
{
label: __( 'Show', 'woocommerce-admin' ),
staticParams: [],
staticParams: [ 'chartType', 'paged', 'per_page' ],
param: 'filter',
showFilters: () => true,
filters: [

View File

@ -22,7 +22,7 @@ const CUSTOMERS_REPORT_ADVANCED_FILTERS_FILTER =
export const filters = applyFilters( CUSTOMERS_REPORT_FILTERS_FILTER, [
{
label: __( 'Show', 'woocommerce-admin' ),
staticParams: [],
staticParams: [ 'paged', 'per_page' ],
param: 'filter',
showFilters: () => true,
filters: [

View File

@ -27,7 +27,7 @@ export const charts = applyFilters( DOWLOADS_REPORT_CHARTS_FILTER, [
export const filters = applyFilters( DOWLOADS_REPORT_FILTERS_FILTER, [
{
label: __( 'Show', 'woocommerce-admin' ),
staticParams: [],
staticParams: [ 'chartType', 'paged', 'per_page' ],
param: 'filter',
showFilters: () => true,
filters: [

View File

@ -49,7 +49,7 @@ export const charts = applyFilters( ORDERS_REPORT_CHARTS_FILTER, [
export const filters = applyFilters( ORDERS_REPORT_FILTERS_FILTER, [
{
label: __( 'Show', 'woocommerce-admin' ),
staticParams: [ 'chart' ],
staticParams: [ 'chartType', 'paged', 'per_page' ],
param: 'filter',
showFilters: () => true,
filters: [

View File

@ -42,7 +42,7 @@ export const charts = applyFilters( PRODUCTS_REPORT_CHARTS_FILTER, [
const filterConfig = {
label: __( 'Show', 'woocommerce-admin' ),
staticParams: [],
staticParams: [ 'chartType', 'paged', 'per_page' ],
param: 'filter',
showFilters: () => true,
filters: [
@ -102,7 +102,7 @@ const variationsConfig = {
query.filter === 'single_product' &&
!! query.products &&
query[ 'is-variable' ],
staticParams: [ 'filter', 'products' ],
staticParams: [ 'filter', 'products', 'chartType', 'paged', 'per_page' ],
param: 'filter-variations',
filters: [
{

View File

@ -13,7 +13,7 @@ export const showDatePicker = false;
export const filters = applyFilters( STOCK_REPORT_FILTERS_FILTER, [
{
label: __( 'Show', 'woocommerce-admin' ),
staticParams: [],
staticParams: [ 'paged', 'per_page' ],
param: 'type',
showFilters: () => true,
filters: [

View File

@ -50,7 +50,7 @@ export const charts = applyFilters( TAXES_REPORT_CHARTS_FILTER, [
export const filters = applyFilters( TAXES_REPORT_FILTERS_FILTER, [
{
label: __( 'Show', 'woocommerce-admin' ),
staticParams: [ 'chart' ],
staticParams: [ 'chartType', 'paged', 'per_page' ],
param: 'filter',
showFilters: () => true,
filters: [

View File

@ -186,10 +186,14 @@ export class Controller extends Component {
const prevQuery = this.getQuery( prevProps.location.search );
const prevBaseQuery = omit(
this.getQuery( prevProps.location.search ),
'chartType',
'filter',
'paged'
);
const baseQuery = omit(
this.getQuery( this.props.location.search ),
'chartType',
'filter',
'paged'
);