2018-07-05 03:14:40 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2018-08-06 21:33:55 +00:00
|
|
|
import { Component, Fragment } from '@wordpress/element';
|
2018-10-11 17:07:59 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2018-07-05 03:14:40 +00:00
|
|
|
|
|
|
|
/**
|
2018-10-30 18:57:48 +00:00
|
|
|
* WooCommerce dependencies
|
2018-07-05 03:14:40 +00:00
|
|
|
*/
|
2018-10-29 07:57:05 +00:00
|
|
|
import { ReportFilters } from '@woocommerce/components';
|
2018-10-30 18:57:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-11-07 16:38:34 +00:00
|
|
|
import { advancedFilters, charts, filters } from './config';
|
2018-11-07 17:19:59 +00:00
|
|
|
import getSelectedChart from 'lib/get-selected-chart';
|
2018-10-11 08:30:51 +00:00
|
|
|
import OrdersReportTable from './table';
|
2018-11-07 16:38:34 +00:00
|
|
|
import ReportChart from 'analytics/components/report-chart';
|
|
|
|
import ReportSummary from 'analytics/components/report-summary';
|
2018-07-05 03:14:40 +00:00
|
|
|
|
2018-10-29 07:57:05 +00:00
|
|
|
export default class OrdersReport extends Component {
|
2018-07-05 03:14:40 +00:00
|
|
|
render() {
|
2018-10-29 07:57:05 +00:00
|
|
|
const { path, query } = this.props;
|
2018-10-11 08:30:51 +00:00
|
|
|
|
2018-07-05 03:14:40 +00:00
|
|
|
return (
|
|
|
|
<Fragment>
|
2018-08-08 21:24:48 +00:00
|
|
|
<ReportFilters
|
|
|
|
query={ query }
|
|
|
|
path={ path }
|
|
|
|
filters={ filters }
|
2018-10-29 01:30:24 +00:00
|
|
|
advancedFilters={ advancedFilters }
|
2018-08-08 21:24:48 +00:00
|
|
|
/>
|
2018-11-07 16:38:34 +00:00
|
|
|
<ReportSummary
|
|
|
|
charts={ charts }
|
|
|
|
endpoint="orders"
|
|
|
|
query={ query }
|
2018-11-07 17:19:59 +00:00
|
|
|
selectedChart={ getSelectedChart( query.chart, charts ) }
|
2019-03-21 03:25:05 +00:00
|
|
|
filters={ filters }
|
|
|
|
advancedFilters={ advancedFilters }
|
2018-11-07 16:38:34 +00:00
|
|
|
/>
|
|
|
|
<ReportChart
|
|
|
|
endpoint="orders"
|
|
|
|
path={ path }
|
|
|
|
query={ query }
|
2018-11-07 17:19:59 +00:00
|
|
|
selectedChart={ getSelectedChart( query.chart, charts ) }
|
2019-03-21 03:25:05 +00:00
|
|
|
filters={ filters }
|
|
|
|
advancedFilters={ advancedFilters }
|
|
|
|
/>
|
|
|
|
<OrdersReportTable
|
|
|
|
query={ query }
|
|
|
|
filters={ filters }
|
|
|
|
advancedFilters={ advancedFilters }
|
2018-11-07 16:38:34 +00:00
|
|
|
/>
|
2018-07-05 03:14:40 +00:00
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-11 17:07:59 +00:00
|
|
|
OrdersReport.propTypes = {
|
|
|
|
path: PropTypes.string.isRequired,
|
|
|
|
query: PropTypes.object.isRequired,
|
|
|
|
};
|