2018-09-17 02:26:34 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { Component, Fragment } from '@wordpress/element';
|
2018-11-16 13:39:29 +00:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WooCommerce dependencies
|
|
|
|
*/
|
|
|
|
import { ReportFilters } from '@woocommerce/components';
|
2018-09-17 02:26:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-11-16 13:39:29 +00:00
|
|
|
import { charts, filters } from './config';
|
2018-11-16 03:35:10 +00:00
|
|
|
import CouponsReportTable from './table';
|
2018-11-16 13:39:29 +00:00
|
|
|
import getSelectedChart from 'lib/get-selected-chart';
|
|
|
|
import ReportChart from 'analytics/components/report-chart';
|
|
|
|
import ReportSummary from 'analytics/components/report-summary';
|
2018-09-17 02:26:34 +00:00
|
|
|
|
2018-11-16 13:39:29 +00:00
|
|
|
export default class CouponsReport extends Component {
|
2018-09-17 02:26:34 +00:00
|
|
|
render() {
|
|
|
|
const { query, path } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Fragment>
|
|
|
|
<ReportFilters query={ query } path={ path } filters={ filters } />
|
2018-11-16 13:39:29 +00:00
|
|
|
<ReportSummary
|
|
|
|
charts={ charts }
|
2018-12-21 02:13:57 +00:00
|
|
|
endpoint="coupons"
|
2018-11-16 13:39:29 +00:00
|
|
|
query={ query }
|
|
|
|
selectedChart={ getSelectedChart( query.chart, charts ) }
|
|
|
|
/>
|
|
|
|
<ReportChart
|
|
|
|
charts={ charts }
|
2018-12-21 02:13:57 +00:00
|
|
|
endpoint="coupons"
|
2018-11-16 13:39:29 +00:00
|
|
|
path={ path }
|
|
|
|
query={ query }
|
|
|
|
selectedChart={ getSelectedChart( query.chart, charts ) }
|
|
|
|
/>
|
2018-11-16 03:35:10 +00:00
|
|
|
<CouponsReportTable query={ query } />
|
2018-09-17 02:26:34 +00:00
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2018-11-16 13:39:29 +00:00
|
|
|
|
|
|
|
CouponsReport.propTypes = {
|
|
|
|
query: PropTypes.object.isRequired,
|
|
|
|
};
|