2018-12-06 22:21:46 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { Component, Fragment } from '@wordpress/element';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WooCommerce dependencies
|
|
|
|
*/
|
|
|
|
import { ReportFilters } from '@woocommerce/components';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-12-10 20:01:22 +00:00
|
|
|
import { filters, advancedFilters } from './config';
|
2018-12-06 22:21:46 +00:00
|
|
|
import CustomersReportTable from './table';
|
|
|
|
|
|
|
|
export default class CustomersReport extends Component {
|
|
|
|
render() {
|
2019-02-26 09:28:50 +00:00
|
|
|
const { isRequesting, query, path } = this.props;
|
2019-01-10 00:43:39 +00:00
|
|
|
const tableQuery = {
|
2019-01-23 18:08:27 +00:00
|
|
|
orderby: 'date_last_active',
|
2019-01-10 00:43:39 +00:00
|
|
|
order: 'desc',
|
|
|
|
...query,
|
|
|
|
};
|
2018-12-06 22:21:46 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Fragment>
|
|
|
|
<ReportFilters
|
|
|
|
query={ query }
|
|
|
|
path={ path }
|
|
|
|
filters={ filters }
|
2018-12-10 20:01:22 +00:00
|
|
|
showDatePicker={ false }
|
|
|
|
advancedFilters={ advancedFilters }
|
2018-12-06 22:21:46 +00:00
|
|
|
/>
|
2019-02-26 09:28:50 +00:00
|
|
|
<CustomersReportTable isRequesting={ isRequesting } query={ tableQuery } />
|
2018-12-06 22:21:46 +00:00
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CustomersReport.propTypes = {
|
|
|
|
query: PropTypes.object.isRequired,
|
|
|
|
};
|