Filters: Fix static query parameters (https://github.com/woocommerce/woocommerce-admin/pull/4458)
* 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:
parent
c7aeeb8b8c
commit
7a62d36516
|
@ -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: [
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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: [
|
||||
{
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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'
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue