woocommerce/plugins/woocommerce-admin/client/analytics/report/orders/index.js

70 lines
1.8 KiB
JavaScript
Raw Normal View History

/**
* External dependencies
*/
import { Component, Fragment } from '@wordpress/element';
2018-10-11 17:07:59 +00:00
import PropTypes from 'prop-types';
import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import { advancedFilters, charts, filters } from './config';
import getSelectedChart from '../../../lib/get-selected-chart';
import OrdersReportTable from './table';
import ReportChart from '../../components/report-chart';
import ReportSummary from '../../components/report-summary';
import ReportFilters from '../../components/report-filters';
import { ReportDateTour } from '~/guided-tours/report-date-tour';
export default class OrdersReport extends Component {
render() {
const { path, query } = this.props;
return (
<Fragment>
<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"
/>
<ReportSummary
charts={ charts }
endpoint="orders"
query={ query }
selectedChart={ getSelectedChart( query.chart, charts ) }
2019-03-21 03:25:05 +00:00
filters={ filters }
advancedFilters={ advancedFilters }
/>
<ReportChart
charts={ charts }
endpoint="orders"
path={ path }
query={ query }
selectedChart={ getSelectedChart( query.chart, charts ) }
2019-03-21 03:25:05 +00:00
filters={ filters }
advancedFilters={ advancedFilters }
/>
<OrdersReportTable
query={ query }
filters={ filters }
advancedFilters={ advancedFilters }
/>
<ReportDateTour
optionName="woocommerce_orders_report_date_tour_shown"
headingText={ __(
'Orders are now reported based on the payment dates ✅',
'woocommerce'
) }
/>
</Fragment>
);
}
}
2018-10-11 17:07:59 +00:00
OrdersReport.propTypes = {
path: PropTypes.string.isRequired,
query: PropTypes.object.isRequired,
};