This commit is contained in:
Albert Juhé Lluveras 2019-03-22 09:48:20 +01:00 committed by GitHub
parent 17bcf29a74
commit a7af5e4603
4 changed files with 15 additions and 10 deletions

View File

@ -12,6 +12,11 @@ import interpolateComponents from 'interpolate-components';
*/
import { Link } from '@woocommerce/components';
/**
* Internal dependencies
*/
import { DEFAULT_ACTIONABLE_STATUSES } from 'wc-api/constants';
const SETTINGS_FILTER = 'woocommerce_admin_analytics_settings';
const defaultOrderStatuses = [
@ -122,6 +127,6 @@ export const analyticsSettings = applyFilters( SETTINGS_FILTER, [
'woocommerce-admin'
),
initialValue: wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || [],
defaultValue: [ 'processing', 'on-hold' ],
defaultValue: DEFAULT_ACTIONABLE_STATUSES,
},
] );

View File

@ -15,6 +15,7 @@ import { partial, uniqueId, find } from 'lodash';
*/
import './style.scss';
import ActivityPanelToggleBubble from './toggle-bubble';
import { DEFAULT_ACTIONABLE_STATUSES } from 'wc-api/constants';
import { H, Section } from '@woocommerce/components';
import InboxPanel from './panels/inbox';
import OrdersPanel from './panels/orders';
@ -277,10 +278,8 @@ export default withSelect( select => {
isGetReviewsRequesting,
} = select( 'wc-api' );
const userData = getCurrentUserData();
const orderStatuses = wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || [
'processing',
'on-hold',
];
const orderStatuses =
wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || DEFAULT_ACTIONABLE_STATUSES;
const notesQuery = {
page: 1,

View File

@ -32,7 +32,7 @@ import { getAdminLink, getNewPath } from '@woocommerce/navigation';
import { ActivityCard, ActivityCardPlaceholder } from '../activity-card';
import ActivityHeader from '../activity-header';
import ActivityOutboundLink from '../activity-outbound-link';
import { QUERY_DEFAULTS } from 'wc-api/constants';
import { DEFAULT_ACTIONABLE_STATUSES, QUERY_DEFAULTS } from 'wc-api/constants';
import withSelect from 'wc-api/with-select';
function OrdersPanel( { orders, isRequesting, isError, orderStatuses } ) {
@ -220,10 +220,9 @@ export default compose(
withSelect( ( select, props ) => {
const { getReportItems, getReportItemsError, isReportItemsRequesting } = select( 'wc-api' );
const { isEmpty } = props;
const orderStatuses = wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || [
'processing',
'on-hold',
];
const orderStatuses =
wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses ||
DEFAULT_ACTIONABLE_STATUSES;
if ( ! orderStatuses.length ) {
return { orders: [], isError: true, isRequesting: false, orderStatuses };

View File

@ -14,6 +14,8 @@ export const DEFAULT_REQUIREMENT = {
// WordPress & WooCommerce both set a hard limit of 100 for the per_page parameter
export const MAX_PER_PAGE = 100;
export const DEFAULT_ACTIONABLE_STATUSES = [ 'processing', 'on-hold' ];
export const QUERY_DEFAULTS = {
pageSize: 25,
period: 'month',