From d03f3e955352dbd18ccad33d51cf58e6fdd4dbc6 Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Wed, 8 Jul 2020 12:38:50 +1200 Subject: [PATCH] fix staticParams (https://github.com/woocommerce/woocommerce-admin/pull/4704) --- .../analytics/report/categories/config.js | 2 +- .../client/analytics/report/coupons/config.js | 2 +- .../analytics/report/customers/config.js | 28 +------------------ .../analytics/report/downloads/config.js | 14 +--------- .../client/analytics/report/orders/config.js | 16 +---------- .../analytics/report/products/config.js | 2 +- .../client/analytics/report/taxes/config.js | 2 +- 7 files changed, 7 insertions(+), 59 deletions(-) diff --git a/plugins/woocommerce-admin/client/analytics/report/categories/config.js b/plugins/woocommerce-admin/client/analytics/report/categories/config.js index a8381afe2f0..445db4e5e57 100644 --- a/plugins/woocommerce-admin/client/analytics/report/categories/config.js +++ b/plugins/woocommerce-admin/client/analytics/report/categories/config.js @@ -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: [ 'chartType', 'paged', 'per_page', 'categories' ], + staticParams: [ 'chartType', 'paged', 'per_page' ], param: 'filter', showFilters: () => true, filters: [ diff --git a/plugins/woocommerce-admin/client/analytics/report/coupons/config.js b/plugins/woocommerce-admin/client/analytics/report/coupons/config.js index dc72e9238a8..43f56c14235 100644 --- a/plugins/woocommerce-admin/client/analytics/report/coupons/config.js +++ b/plugins/woocommerce-admin/client/analytics/report/coupons/config.js @@ -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: [ 'chartType', 'paged', 'per_page', 'coupons' ], + staticParams: [ 'chartType', 'paged', 'per_page' ], param: 'filter', showFilters: () => true, filters: [ diff --git a/plugins/woocommerce-admin/client/analytics/report/customers/config.js b/plugins/woocommerce-admin/client/analytics/report/customers/config.js index aa14fcf7eaa..b502148d52d 100644 --- a/plugins/woocommerce-admin/client/analytics/report/customers/config.js +++ b/plugins/woocommerce-admin/client/analytics/report/customers/config.js @@ -22,33 +22,7 @@ const CUSTOMERS_REPORT_ADVANCED_FILTERS_FILTER = export const filters = applyFilters( CUSTOMERS_REPORT_FILTERS_FILTER, [ { label: __( 'Show', 'woocommerce-admin' ), - staticParams: [ - 'paged', - 'per_page', - 'name_includes', - 'name_excludes', - 'country_includes', - 'country_excludes', - 'username_includes', - 'username_excludes', - 'email_includes', - 'email_excludes', - 'orders_count_min', - 'orders_count_max', - 'orders_count_between', - 'total_spend_min', - 'total_spend_max', - 'total_spend_between', - 'avg_order_value_min', - 'avg_order_value_max', - 'avg_order_value_between', - 'registered_before', - 'registered_after', - 'registered_between', - 'last_active_before', - 'last_active_after', - 'last_active_between', - ], + staticParams: [ 'paged', 'per_page' ], param: 'filter', showFilters: () => true, filters: [ diff --git a/plugins/woocommerce-admin/client/analytics/report/downloads/config.js b/plugins/woocommerce-admin/client/analytics/report/downloads/config.js index 13464aa0028..de07d1dde8c 100644 --- a/plugins/woocommerce-admin/client/analytics/report/downloads/config.js +++ b/plugins/woocommerce-admin/client/analytics/report/downloads/config.js @@ -27,19 +27,7 @@ export const charts = applyFilters( DOWLOADS_REPORT_CHARTS_FILTER, [ export const filters = applyFilters( DOWLOADS_REPORT_FILTERS_FILTER, [ { label: __( 'Show', 'woocommerce-admin' ), - staticParams: [ - 'chartType', - 'paged', - 'per_page', - 'product_includes', - 'product_excludes', - 'customer_includes', - 'customer_excludes', - 'order_includes', - 'order_excludes', - 'ip_address_includes', - 'ip_address_excludes', - ], + staticParams: [ 'chartType', 'paged', 'per_page' ], param: 'filter', showFilters: () => true, filters: [ diff --git a/plugins/woocommerce-admin/client/analytics/report/orders/config.js b/plugins/woocommerce-admin/client/analytics/report/orders/config.js index fc1351b5802..46b28cfc4a4 100644 --- a/plugins/woocommerce-admin/client/analytics/report/orders/config.js +++ b/plugins/woocommerce-admin/client/analytics/report/orders/config.js @@ -49,21 +49,7 @@ export const charts = applyFilters( ORDERS_REPORT_CHARTS_FILTER, [ export const filters = applyFilters( ORDERS_REPORT_FILTERS_FILTER, [ { label: __( 'Show', 'woocommerce-admin' ), - staticParams: [ - 'chartType', - 'paged', - 'per_page', - 'product_includes', - 'product_excludes', - 'status_is', - 'status_is_not', - 'coupon_includes', - 'coupon_excludes', - 'refunds', - 'tax_rate_includes', - 'tax_rate_excludes', - 'customer_type', - ], + staticParams: [ 'chartType', 'paged', 'per_page' ], param: 'filter', showFilters: () => true, filters: [ diff --git a/plugins/woocommerce-admin/client/analytics/report/products/config.js b/plugins/woocommerce-admin/client/analytics/report/products/config.js index 133f0aafc16..d9530958cc2 100644 --- a/plugins/woocommerce-admin/client/analytics/report/products/config.js +++ b/plugins/woocommerce-admin/client/analytics/report/products/config.js @@ -42,7 +42,7 @@ export const charts = applyFilters( PRODUCTS_REPORT_CHARTS_FILTER, [ const filterConfig = { label: __( 'Show', 'woocommerce-admin' ), - staticParams: [ 'chartType', 'paged', 'per_page', 'products' ], + staticParams: [ 'chartType', 'paged', 'per_page' ], param: 'filter', showFilters: () => true, filters: [ diff --git a/plugins/woocommerce-admin/client/analytics/report/taxes/config.js b/plugins/woocommerce-admin/client/analytics/report/taxes/config.js index 3d0c6ba295b..0734fc1b62d 100644 --- a/plugins/woocommerce-admin/client/analytics/report/taxes/config.js +++ b/plugins/woocommerce-admin/client/analytics/report/taxes/config.js @@ -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: [ 'chartType', 'paged', 'per_page', 'taxes' ], + staticParams: [ 'chartType', 'paged', 'per_page' ], param: 'filter', showFilters: () => true, filters: [