2018-12-17 20:50:45 +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-19 11:18:43 +00:00
|
|
|
import { charts, filters, advancedFilters } from './config';
|
|
|
|
import DownloadsReportTable from './table';
|
|
|
|
import getSelectedChart from 'lib/get-selected-chart';
|
|
|
|
import ReportChart from 'analytics/components/report-chart';
|
|
|
|
import ReportSummary from 'analytics/components/report-summary';
|
2018-12-17 20:50:45 +00:00
|
|
|
|
|
|
|
export default class DownloadsReport extends Component {
|
|
|
|
render() {
|
|
|
|
const { query, path } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Fragment>
|
|
|
|
<ReportFilters
|
|
|
|
query={ query }
|
|
|
|
path={ path }
|
|
|
|
filters={ filters }
|
|
|
|
advancedFilters={ advancedFilters }
|
|
|
|
/>
|
2018-12-19 11:18:43 +00:00
|
|
|
<ReportSummary
|
|
|
|
charts={ charts }
|
|
|
|
endpoint="downloads"
|
|
|
|
query={ query }
|
|
|
|
selectedChart={ getSelectedChart( query.chart, charts ) }
|
|
|
|
/>
|
|
|
|
<ReportChart
|
|
|
|
charts={ charts }
|
|
|
|
endpoint="downloads"
|
|
|
|
path={ path }
|
|
|
|
query={ query }
|
|
|
|
selectedChart={ getSelectedChart( query.chart, charts ) }
|
|
|
|
/>
|
|
|
|
<DownloadsReportTable query={ query } />
|
2018-12-17 20:50:45 +00:00
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DownloadsReport.propTypes = {
|
|
|
|
query: PropTypes.object.isRequired,
|
|
|
|
};
|