2018-12-06 22:21:46 +00:00
/** @format */
/ * *
* External dependencies
* /
2018-12-10 20:01:22 +00:00
import { _ _ , _x } from '@wordpress/i18n' ;
import { getRequestByIdString } from '../../../lib/async-requests' ;
import { NAMESPACE } from '../../../store/constants' ;
2018-12-06 22:21:46 +00:00
export const filters = [
{
label : _ _ ( 'Show' , 'wc-admin' ) ,
staticParams : [ ] ,
param : 'filter' ,
showFilters : ( ) => true ,
2018-12-10 20:01:22 +00:00
filters : [
{ label : _ _ ( 'All Registered Customers' , 'wc-admin' ) , value : 'all' } ,
{ label : _ _ ( 'Advanced Filters' , 'wc-admin' ) , value : 'advanced' } ,
] ,
2018-12-06 22:21:46 +00:00
} ,
] ;
2018-12-10 20:01:22 +00:00
/*eslint-disable max-len*/
export const advancedFilters = {
title : _x (
'Customers Match {{select /}} Filters' ,
'A sentence describing filters for Customers. See screen shot for context: https://cloudup.com/cCsm3GeXJbE' ,
'wc-admin'
) ,
filters : {
name : {
labels : {
add : _ _ ( 'Name' , 'wc-admin' ) ,
placeholder : _ _ ( 'Search customer name' , 'wc-admin' ) ,
remove : _ _ ( 'Remove customer name filter' , 'wc-admin' ) ,
rule : _ _ ( 'Select a customer name filter match' , 'wc-admin' ) ,
2018-12-10 22:18:45 +00:00
/* translators: A sentence describing a Product filter. See screen shot for context: https://cloudup.com/cCsm3GeXJbE */
2018-12-10 20:01:22 +00:00
title : _ _ ( 'Name {{rule /}} {{filter /}}' , 'wc-admin' ) ,
filter : _ _ ( 'Select customer name' , 'wc-admin' ) ,
} ,
rules : [
{
value : 'includes' ,
2018-12-10 22:18:45 +00:00
/* translators: Sentence fragment, logical, "Includes" refers to customer names including a given name(s). Screenshot for context: https://cloudup.com/cCsm3GeXJbE */
2018-12-10 20:01:22 +00:00
label : _x ( 'Includes' , 'customer names' , 'wc-admin' ) ,
} ,
{
value : 'excludes' ,
2018-12-10 22:18:45 +00:00
/* translators: Sentence fragment, logical, "Excludes" refers to customer names excluding a given name(s). Screenshot for context: https://cloudup.com/cCsm3GeXJbE */
2018-12-10 20:01:22 +00:00
label : _x ( 'Excludes' , 'customer names' , 'wc-admin' ) ,
} ,
] ,
input : {
// Use products autocompleter for now, see https://github.com/woocommerce/wc-admin/issues/1029 for progress
component : 'Search' ,
type : 'products' ,
getLabels : getRequestByIdString ( NAMESPACE + 'products' , product => ( {
id : product . id ,
label : product . name ,
} ) ) ,
} ,
} ,
} ,
} ;
/*eslint-enable max-len*/