2018-12-06 22:21:46 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { Component, Fragment } from '@wordpress/element';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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';
|
2020-08-13 02:05:22 +00:00
|
|
|
import ReportFilters from '../../components/report-filters';
|
2018-12-06 22:21:46 +00:00
|
|
|
|
|
|
|
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 }
|
2019-06-27 02:44:39 +00:00
|
|
|
report="customers"
|
2018-12-06 22:21:46 +00:00
|
|
|
/>
|
2019-03-21 03:25:05 +00:00
|
|
|
<CustomersReportTable
|
|
|
|
isRequesting={ isRequesting }
|
|
|
|
query={ tableQuery }
|
|
|
|
filters={ filters }
|
|
|
|
advancedFilters={ advancedFilters }
|
|
|
|
/>
|
2018-12-06 22:21:46 +00:00
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CustomersReport.propTypes = {
|
|
|
|
query: PropTypes.object.isRequired,
|
|
|
|
};
|