From 6d5484aa879109cb37bfe568278c58435037aebe Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Tue, 19 Mar 2019 14:27:31 +1300 Subject: [PATCH] Fix table links to internal reports --- .../client/analytics/report/categories/breadcrumbs.js | 2 +- .../client/analytics/report/categories/table.js | 2 +- .../client/analytics/report/downloads/table.js | 2 +- .../woocommerce-admin/client/analytics/report/orders/table.js | 4 ++-- .../client/analytics/report/products/table-variations.js | 2 +- .../client/analytics/report/products/table.js | 4 ++-- .../woocommerce-admin/client/analytics/report/stock/table.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/woocommerce-admin/client/analytics/report/categories/breadcrumbs.js b/plugins/woocommerce-admin/client/analytics/report/categories/breadcrumbs.js index 7566bc92fd6..287122b1cfa 100644 --- a/plugins/woocommerce-admin/client/analytics/report/categories/breadcrumbs.js +++ b/plugins/woocommerce-admin/client/analytics/report/categories/breadcrumbs.js @@ -56,7 +56,7 @@ export default class CategoryBreadcrumbs extends Component {
{ this.getCategoryAncestors( category, categories ) } ( { label: item.name, quantity: item.quantity, - href: getNewPath( persistedQuery, 'products', { + href: getNewPath( persistedQuery, '/analytics/products', { filter: 'single_product', products: item.id, } ), @@ -120,7 +120,7 @@ export default class OrdersReportTable extends Component { const formattedCoupons = coupons.map( coupon => ( { label: coupon.code, - href: getNewPath( persistedQuery, 'coupons', { + href: getNewPath( persistedQuery, '/analytics/coupons', { filter: 'single_coupon', coupons: coupon.id, } ), diff --git a/plugins/woocommerce-admin/client/analytics/report/products/table-variations.js b/plugins/woocommerce-admin/client/analytics/report/products/table-variations.js index 02cbfd65411..ebd0429320b 100644 --- a/plugins/woocommerce-admin/client/analytics/report/products/table-variations.js +++ b/plugins/woocommerce-admin/client/analytics/report/products/table-variations.js @@ -85,7 +85,7 @@ export default class VariationsReportTable extends Component { const extended_info = row.extended_info || {}; const { stock_status, stock_quantity, low_stock_amount, sku } = extended_info; const name = get( row, [ 'extended_info', 'name' ], '' ); - const ordersLink = getNewPath( persistedQuery, 'orders', { + const ordersLink = getNewPath( persistedQuery, '/analytics/orders', { filter: 'advanced', product_includes: query.products, } ); diff --git a/plugins/woocommerce-admin/client/analytics/report/products/table.js b/plugins/woocommerce-admin/client/analytics/report/products/table.js index 3e8a62246aa..b8eec9e9bda 100644 --- a/plugins/woocommerce-admin/client/analytics/report/products/table.js +++ b/plugins/woocommerce-admin/client/analytics/report/products/table.js @@ -108,11 +108,11 @@ class ProductsReportTable extends Component { stock_quantity, variations = [], } = extended_info; - const ordersLink = getNewPath( persistedQuery, 'orders', { + const ordersLink = getNewPath( persistedQuery, '/analytics/orders', { filter: 'advanced', product_includes: product_id, } ); - const productDetailLink = getNewPath( persistedQuery, 'products', { + const productDetailLink = getNewPath( persistedQuery, '/analytics/products', { filter: 'single_product', products: product_id, } ); diff --git a/plugins/woocommerce-admin/client/analytics/report/stock/table.js b/plugins/woocommerce-admin/client/analytics/report/stock/table.js index 29ee789fdeb..db575349b63 100644 --- a/plugins/woocommerce-admin/client/analytics/report/stock/table.js +++ b/plugins/woocommerce-admin/client/analytics/report/stock/table.js @@ -62,7 +62,7 @@ export default class StockReportTable extends Component { return products.map( product => { const { id, manage_stock, name, parent_id, sku, stock_quantity, stock_status } = product; - const productDetailLink = getNewPath( persistedQuery, 'products', { + const productDetailLink = getNewPath( persistedQuery, '/analytics/products', { filter: 'single_product', products: parent_id || id, } );