Add single customer filter and hook up customer link (https://github.com/woocommerce/woocommerce-admin/pull/1798)
* Add a single customer filter to the customers report * Hook up activity panel orders customer link to customer report * Use customer name for label instead of username
This commit is contained in:
parent
f08fda5271
commit
b1dd517eb6
|
@ -19,6 +19,28 @@ export const filters = [
|
|||
showFilters: () => true,
|
||||
filters: [
|
||||
{ label: __( 'All Customers', 'woocommerce-admin' ), value: 'all' },
|
||||
{
|
||||
label: __( 'Single Customer', 'woocommerce-admin' ),
|
||||
value: 'select_customer',
|
||||
chartMode: 'item-comparison',
|
||||
subFilters: [
|
||||
{
|
||||
component: 'Search',
|
||||
value: 'single_customer',
|
||||
chartMode: 'item-comparison',
|
||||
path: [ 'select_customer' ],
|
||||
settings: {
|
||||
type: 'customers',
|
||||
param: 'customers',
|
||||
getLabels: getCustomerLabels,
|
||||
labels: {
|
||||
placeholder: __( 'Type to search for a customer', 'woocommerce-admin' ),
|
||||
button: __( 'Single Customer', 'woocommerce-admin' ),
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{ label: __( 'Advanced Filters', 'woocommerce-admin' ), value: 'advanced' },
|
||||
],
|
||||
},
|
||||
|
|
|
@ -107,7 +107,7 @@ function OrdersPanel( { orders, isRequesting, isError, orderStatuses } ) {
|
|||
const customerUrl = customer.customer_id
|
||||
? getNewPath( {}, '/analytics/customers', {
|
||||
filter: 'single_customer',
|
||||
customer_id: customer.customer_id,
|
||||
customers: customer.customer_id,
|
||||
} )
|
||||
: null;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ export const getCouponLabels = getRequestByIdString( NAMESPACE + '/coupons', cou
|
|||
|
||||
export const getCustomerLabels = getRequestByIdString( NAMESPACE + '/customers', customer => ( {
|
||||
id: customer.id,
|
||||
label: customer.username,
|
||||
label: customer.name,
|
||||
} ) );
|
||||
|
||||
export const getProductLabels = getRequestByIdString( NAMESPACE + '/products', product => ( {
|
||||
|
|
Loading…
Reference in New Issue