woocommerce/plugins/woocommerce-admin/client/analytics/report/customers/config.js

65 lines
2.1 KiB
JavaScript
Raw Normal View History

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*/