Create DEFAULT_ACTIONABLE_STATUSES constant (https://github.com/woocommerce/woocommerce-admin/pull/1867)
This commit is contained in:
parent
17bcf29a74
commit
a7af5e4603
|
@ -12,6 +12,11 @@ import interpolateComponents from 'interpolate-components';
|
||||||
*/
|
*/
|
||||||
import { Link } from '@woocommerce/components';
|
import { Link } from '@woocommerce/components';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
import { DEFAULT_ACTIONABLE_STATUSES } from 'wc-api/constants';
|
||||||
|
|
||||||
const SETTINGS_FILTER = 'woocommerce_admin_analytics_settings';
|
const SETTINGS_FILTER = 'woocommerce_admin_analytics_settings';
|
||||||
|
|
||||||
const defaultOrderStatuses = [
|
const defaultOrderStatuses = [
|
||||||
|
@ -122,6 +127,6 @@ export const analyticsSettings = applyFilters( SETTINGS_FILTER, [
|
||||||
'woocommerce-admin'
|
'woocommerce-admin'
|
||||||
),
|
),
|
||||||
initialValue: wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || [],
|
initialValue: wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || [],
|
||||||
defaultValue: [ 'processing', 'on-hold' ],
|
defaultValue: DEFAULT_ACTIONABLE_STATUSES,
|
||||||
},
|
},
|
||||||
] );
|
] );
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { partial, uniqueId, find } from 'lodash';
|
||||||
*/
|
*/
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
import ActivityPanelToggleBubble from './toggle-bubble';
|
import ActivityPanelToggleBubble from './toggle-bubble';
|
||||||
|
import { DEFAULT_ACTIONABLE_STATUSES } from 'wc-api/constants';
|
||||||
import { H, Section } from '@woocommerce/components';
|
import { H, Section } from '@woocommerce/components';
|
||||||
import InboxPanel from './panels/inbox';
|
import InboxPanel from './panels/inbox';
|
||||||
import OrdersPanel from './panels/orders';
|
import OrdersPanel from './panels/orders';
|
||||||
|
@ -277,10 +278,8 @@ export default withSelect( select => {
|
||||||
isGetReviewsRequesting,
|
isGetReviewsRequesting,
|
||||||
} = select( 'wc-api' );
|
} = select( 'wc-api' );
|
||||||
const userData = getCurrentUserData();
|
const userData = getCurrentUserData();
|
||||||
const orderStatuses = wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || [
|
const orderStatuses =
|
||||||
'processing',
|
wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || DEFAULT_ACTIONABLE_STATUSES;
|
||||||
'on-hold',
|
|
||||||
];
|
|
||||||
|
|
||||||
const notesQuery = {
|
const notesQuery = {
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|
|
@ -32,7 +32,7 @@ import { getAdminLink, getNewPath } from '@woocommerce/navigation';
|
||||||
import { ActivityCard, ActivityCardPlaceholder } from '../activity-card';
|
import { ActivityCard, ActivityCardPlaceholder } from '../activity-card';
|
||||||
import ActivityHeader from '../activity-header';
|
import ActivityHeader from '../activity-header';
|
||||||
import ActivityOutboundLink from '../activity-outbound-link';
|
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';
|
import withSelect from 'wc-api/with-select';
|
||||||
|
|
||||||
function OrdersPanel( { orders, isRequesting, isError, orderStatuses } ) {
|
function OrdersPanel( { orders, isRequesting, isError, orderStatuses } ) {
|
||||||
|
@ -220,10 +220,9 @@ export default compose(
|
||||||
withSelect( ( select, props ) => {
|
withSelect( ( select, props ) => {
|
||||||
const { getReportItems, getReportItemsError, isReportItemsRequesting } = select( 'wc-api' );
|
const { getReportItems, getReportItemsError, isReportItemsRequesting } = select( 'wc-api' );
|
||||||
const { isEmpty } = props;
|
const { isEmpty } = props;
|
||||||
const orderStatuses = wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || [
|
const orderStatuses =
|
||||||
'processing',
|
wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses ||
|
||||||
'on-hold',
|
DEFAULT_ACTIONABLE_STATUSES;
|
||||||
];
|
|
||||||
|
|
||||||
if ( ! orderStatuses.length ) {
|
if ( ! orderStatuses.length ) {
|
||||||
return { orders: [], isError: true, isRequesting: false, orderStatuses };
|
return { orders: [], isError: true, isRequesting: false, orderStatuses };
|
||||||
|
|
|
@ -14,6 +14,8 @@ export const DEFAULT_REQUIREMENT = {
|
||||||
// WordPress & WooCommerce both set a hard limit of 100 for the per_page parameter
|
// WordPress & WooCommerce both set a hard limit of 100 for the per_page parameter
|
||||||
export const MAX_PER_PAGE = 100;
|
export const MAX_PER_PAGE = 100;
|
||||||
|
|
||||||
|
export const DEFAULT_ACTIONABLE_STATUSES = [ 'processing', 'on-hold' ];
|
||||||
|
|
||||||
export const QUERY_DEFAULTS = {
|
export const QUERY_DEFAULTS = {
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
period: 'month',
|
period: 'month',
|
||||||
|
|
Loading…
Reference in New Issue