2018-09-17 02:26:34 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { getRequestByIdString } from 'lib/async-requests';
|
|
|
|
import { NAMESPACE } from 'store/constants';
|
|
|
|
|
2018-11-16 13:39:29 +00:00
|
|
|
export const charts = [
|
|
|
|
{
|
2018-12-21 02:13:57 +00:00
|
|
|
key: 'orders_count',
|
2018-11-16 22:01:24 +00:00
|
|
|
label: __( 'Discounted Orders', 'wc-admin' ),
|
2018-11-16 13:39:29 +00:00
|
|
|
type: 'number',
|
|
|
|
},
|
|
|
|
{
|
2018-12-21 02:13:57 +00:00
|
|
|
key: 'amount',
|
|
|
|
label: __( 'Amount', 'wc-admin' ),
|
2018-11-16 13:39:29 +00:00
|
|
|
type: 'currency',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2018-09-17 02:26:34 +00:00
|
|
|
export const filters = [
|
|
|
|
{
|
2018-10-29 01:30:24 +00:00
|
|
|
label: __( 'Show', 'wc-admin' ),
|
|
|
|
staticParams: [],
|
|
|
|
param: 'filter',
|
|
|
|
showFilters: () => true,
|
|
|
|
filters: [
|
|
|
|
{ label: __( 'All Coupons', 'wc-admin' ), value: 'all' },
|
|
|
|
{
|
|
|
|
label: __( 'Comparison', 'wc-admin' ),
|
2018-11-16 13:39:29 +00:00
|
|
|
value: 'compare-coupons',
|
2018-10-29 01:30:24 +00:00
|
|
|
settings: {
|
|
|
|
type: 'coupons',
|
2018-11-16 13:39:29 +00:00
|
|
|
param: 'coupons',
|
2018-10-29 01:30:24 +00:00
|
|
|
getLabels: getRequestByIdString( NAMESPACE + 'coupons', coupon => ( {
|
|
|
|
id: coupon.id,
|
|
|
|
label: coupon.code,
|
|
|
|
} ) ),
|
|
|
|
labels: {
|
|
|
|
title: __( 'Compare Coupon Codes', 'wc-admin' ),
|
|
|
|
update: __( 'Compare', 'wc-admin' ),
|
2019-01-18 02:22:51 +00:00
|
|
|
helpText: __( 'Select at least two coupon codes to compare', 'wc-admin' ),
|
2018-10-29 01:30:24 +00:00
|
|
|
},
|
|
|
|
},
|
2018-09-17 02:26:34 +00:00
|
|
|
},
|
2018-10-29 01:30:24 +00:00
|
|
|
{ label: __( 'Top Coupons by Discounted Orders', 'wc-admin' ), value: 'top_orders' },
|
2018-12-21 02:13:57 +00:00
|
|
|
{ label: __( 'Top Coupons by Amount Discounted', 'wc-admin' ), value: 'top_discount' },
|
2018-10-29 01:30:24 +00:00
|
|
|
],
|
2018-09-17 02:26:34 +00:00
|
|
|
},
|
|
|
|
];
|