2018-06-14 20:15:11 +00:00
|
|
|
/** @format */
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { Component, Fragment } from '@wordpress/element';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
2018-10-30 18:57:48 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-11-12 16:27:19 +00:00
|
|
|
import { charts } from './config';
|
|
|
|
import getSelectedChart from 'lib/get-selected-chart';
|
|
|
|
import ReportChart from 'analytics/components/report-chart';
|
|
|
|
import ReportSummary from 'analytics/components/report-summary';
|
2018-10-23 08:07:23 +00:00
|
|
|
import RevenueReportTable from './table';
|
2019-06-27 02:44:39 +00:00
|
|
|
import ReportFilters from 'analytics/components/report-filters';
|
2018-06-20 15:09:37 +00:00
|
|
|
|
2018-10-29 07:57:05 +00:00
|
|
|
export default class RevenueReport extends Component {
|
Add loading indicators, error state, and EmptyContent to the revenue report. (#347, woocommerce/woocommerce-admin#348)
* Add loading indiciators for the revenue report.
* Improve accessibility, and fix up some documentation comments.
* Fix top border on mobile
* Add EmptyContent Component and revenue error/empty states. (https://github.com/woocommerce/woocommerce-admin/pull/348)
* Add EmptyContent Component and revenue error/empty states.
* Move relative image handling to ImageAsset, combine secondary and primary action rendering, add some missing isRequired proptypes, add empty error handling.
* Handle PR Feedback: Clean up button css, set a default for illustration, fix deprecation typo, some code cleanup.
2018-09-05 16:45:49 +00:00
|
|
|
render() {
|
2018-10-29 07:57:05 +00:00
|
|
|
const { path, query } = this.props;
|
2018-06-20 15:09:37 +00:00
|
|
|
|
2018-06-14 20:15:11 +00:00
|
|
|
return (
|
|
|
|
<Fragment>
|
2019-06-27 02:44:39 +00:00
|
|
|
<ReportFilters query={ query } path={ path } report="revenue" />
|
2018-11-12 16:27:19 +00:00
|
|
|
<ReportSummary
|
|
|
|
charts={ charts }
|
|
|
|
endpoint="revenue"
|
|
|
|
query={ query }
|
|
|
|
selectedChart={ getSelectedChart( query.chart, charts ) }
|
|
|
|
/>
|
|
|
|
<ReportChart
|
|
|
|
endpoint="revenue"
|
|
|
|
path={ path }
|
|
|
|
query={ query }
|
|
|
|
selectedChart={ getSelectedChart( query.chart, charts ) }
|
|
|
|
/>
|
2018-10-29 07:57:05 +00:00
|
|
|
<RevenueReportTable query={ query } />
|
2018-06-14 20:15:11 +00:00
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RevenueReport.propTypes = {
|
|
|
|
path: PropTypes.string.isRequired,
|
|
|
|
query: PropTypes.object.isRequired,
|
|
|
|
};
|