Rename dateRangeFilter.show to showDatePicker in filters config
This commit is contained in:
parent
44e97caeab
commit
93a18be2f0
|
@ -4,9 +4,7 @@
|
|||
*/
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
export const dateRangeFilter = {
|
||||
show: false,
|
||||
};
|
||||
export const showDatePicker = false;
|
||||
|
||||
export const filters = [
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ import { ReportFilters } from '@woocommerce/components';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { dateRangeFilter, filters } from './config';
|
||||
import { filters, showDatePicker } from './config';
|
||||
import CustomersReportTable from './table';
|
||||
|
||||
export default class CustomersReport extends Component {
|
||||
|
@ -25,8 +25,8 @@ export default class CustomersReport extends Component {
|
|||
<ReportFilters
|
||||
query={ query }
|
||||
path={ path }
|
||||
dateRangeFilter={ dateRangeFilter }
|
||||
filters={ filters }
|
||||
showDatePicker={ showDatePicker }
|
||||
/>
|
||||
<CustomersReportTable query={ query } />
|
||||
</Fragment>
|
||||
|
|
|
@ -57,13 +57,13 @@ class ReportFilters extends Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { dateRangeFilter, filters, query, path } = this.props;
|
||||
const { filters, query, path, showDatePicker } = this.props;
|
||||
return (
|
||||
<Fragment>
|
||||
<H className="screen-reader-text">{ __( 'Filters', 'wc-admin' ) }</H>
|
||||
<Section component="div" className="woocommerce-filters">
|
||||
<div className="woocommerce-filters__basic-filters">
|
||||
{ dateRangeFilter.show && (
|
||||
{ showDatePicker && (
|
||||
<DatePicker key={ JSON.stringify( query ) } query={ query } path={ path } />
|
||||
) }
|
||||
{ filters.map( config => {
|
||||
|
@ -91,15 +91,6 @@ ReportFilters.propTypes = {
|
|||
* Config option passed through to `AdvancedFilters`
|
||||
*/
|
||||
advancedFilters: PropTypes.object,
|
||||
/**
|
||||
* Config options for the date range picker.
|
||||
*/
|
||||
dateRangeFilter: PropTypes.shape( {
|
||||
/**
|
||||
* Whether the date range filter must be shown.
|
||||
*/
|
||||
show: PropTypes.bool,
|
||||
} ),
|
||||
/**
|
||||
* Config option passed through to `FilterPicker` - if not used, `FilterPicker` is not displayed.
|
||||
*/
|
||||
|
@ -112,15 +103,17 @@ ReportFilters.propTypes = {
|
|||
* The query string represented in object form
|
||||
*/
|
||||
query: PropTypes.object,
|
||||
/**
|
||||
* Whether the date picker must be shown..
|
||||
*/
|
||||
showDatePicker: PropTypes.bool,
|
||||
};
|
||||
|
||||
ReportFilters.defaultProps = {
|
||||
advancedFilters: {},
|
||||
dateRangeFilter: {
|
||||
show: true,
|
||||
},
|
||||
filters: [],
|
||||
query: {},
|
||||
showDatePicker: true,
|
||||
};
|
||||
|
||||
export default ReportFilters;
|
||||
|
|
Loading…
Reference in New Issue