Merge pull request woocommerce/woocommerce-admin#1833 from woocommerce/fix/table-links-wc-admnin

Fix table links to internal reports
This commit is contained in:
Paul Sealock 2019-03-19 16:21:17 +13:00 committed by GitHub
commit 36a60c59d5
7 changed files with 9 additions and 9 deletions

View File

@ -56,7 +56,7 @@ export default class CategoryBreadcrumbs extends Component {
<div className="woocommerce-table__breadcrumbs"> <div className="woocommerce-table__breadcrumbs">
{ this.getCategoryAncestors( category, categories ) } { this.getCategoryAncestors( category, categories ) }
<Link <Link
href={ getNewPath( persistedQuery, 'categories', { href={ getNewPath( persistedQuery, '/analytics/categories', {
filter: 'single_category', filter: 'single_category',
categories: category.id, categories: category.id,
} ) } } ) }

View File

@ -92,7 +92,7 @@ class CategoriesReportTable extends Component {
{ {
display: category && ( display: category && (
<Link <Link
href={ getNewPath( persistedQuery, 'categories', { href={ getNewPath( persistedQuery, '/analytics/categories', {
filter: 'single_category', filter: 'single_category',
categories: category.id, categories: category.id,
} ) } } ) }

View File

@ -83,7 +83,7 @@ export default class CouponsReportTable extends Component {
} = download; } = download;
const { name: productName } = _embedded.product[ 0 ]; const { name: productName } = _embedded.product[ 0 ];
const productLink = getNewPath( persistedQuery, 'products', { const productLink = getNewPath( persistedQuery, '/analytics/products', {
filter: 'single_product', filter: 'single_product',
products: product_id, products: product_id,
} ); } );

View File

@ -112,7 +112,7 @@ export default class OrdersReportTable extends Component {
.map( item => ( { .map( item => ( {
label: item.name, label: item.name,
quantity: item.quantity, quantity: item.quantity,
href: getNewPath( persistedQuery, 'products', { href: getNewPath( persistedQuery, '/analytics/products', {
filter: 'single_product', filter: 'single_product',
products: item.id, products: item.id,
} ), } ),
@ -120,7 +120,7 @@ export default class OrdersReportTable extends Component {
const formattedCoupons = coupons.map( coupon => ( { const formattedCoupons = coupons.map( coupon => ( {
label: coupon.code, label: coupon.code,
href: getNewPath( persistedQuery, 'coupons', { href: getNewPath( persistedQuery, '/analytics/coupons', {
filter: 'single_coupon', filter: 'single_coupon',
coupons: coupon.id, coupons: coupon.id,
} ), } ),

View File

@ -85,7 +85,7 @@ export default class VariationsReportTable extends Component {
const extended_info = row.extended_info || {}; const extended_info = row.extended_info || {};
const { stock_status, stock_quantity, low_stock_amount, sku } = extended_info; const { stock_status, stock_quantity, low_stock_amount, sku } = extended_info;
const name = get( row, [ 'extended_info', 'name' ], '' ); const name = get( row, [ 'extended_info', 'name' ], '' );
const ordersLink = getNewPath( persistedQuery, 'orders', { const ordersLink = getNewPath( persistedQuery, '/analytics/orders', {
filter: 'advanced', filter: 'advanced',
product_includes: query.products, product_includes: query.products,
} ); } );

View File

@ -108,11 +108,11 @@ class ProductsReportTable extends Component {
stock_quantity, stock_quantity,
variations = [], variations = [],
} = extended_info; } = extended_info;
const ordersLink = getNewPath( persistedQuery, 'orders', { const ordersLink = getNewPath( persistedQuery, '/analytics/orders', {
filter: 'advanced', filter: 'advanced',
product_includes: product_id, product_includes: product_id,
} ); } );
const productDetailLink = getNewPath( persistedQuery, 'products', { const productDetailLink = getNewPath( persistedQuery, '/analytics/products', {
filter: 'single_product', filter: 'single_product',
products: product_id, products: product_id,
} ); } );

View File

@ -62,7 +62,7 @@ export default class StockReportTable extends Component {
return products.map( product => { return products.map( product => {
const { id, manage_stock, name, parent_id, sku, stock_quantity, stock_status } = 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', filter: 'single_product',
products: parent_id || id, products: parent_id || id,
} ); } );