2018-07-05 03:14:40 +00:00
|
|
|
/**
|
|
|
|
* 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';
|
2023-02-23 18:49:24 +00:00
|
|
|
import { __ } from '@wordpress/i18n';
|
2018-07-05 03:14:40 +00:00
|
|
|
|
2018-10-30 18:57:48 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-11-07 16:38:34 +00:00
|
|
|
import { advancedFilters, charts, filters } from './config';
|
2020-08-13 02:05:22 +00:00
|
|
|
import getSelectedChart from '../../../lib/get-selected-chart';
|
2018-10-11 08:30:51 +00:00
|
|
|
import OrdersReportTable from './table';
|
2020-08-13 02:05:22 +00:00
|
|
|
import ReportChart from '../../components/report-chart';
|
|
|
|
import ReportSummary from '../../components/report-summary';
|
|
|
|
import ReportFilters from '../../components/report-filters';
|
2023-02-23 18:49:24 +00:00
|
|
|
import { ReportDateTour } from '~/guided-tours/report-date-tour';
|
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 }
|
2019-06-27 02:44:39 +00:00
|
|
|
report="orders"
|
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
|
2020-03-31 15:08:40 +00:00
|
|
|
charts={ charts }
|
2018-11-07 16:38:34 +00:00
|
|
|
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
|
|
|
/>
|
2023-02-23 18:49:24 +00:00
|
|
|
<ReportDateTour
|
|
|
|
optionName="woocommerce_orders_report_date_tour_shown"
|
|
|
|
headingText={ __(
|
|
|
|
'Orders are now reported based on the payment dates ✅',
|
|
|
|
'woocommerce'
|
|
|
|
) }
|
|
|
|
/>
|
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,
|
|
|
|
};
|