Only show WCPay task in US based stores (https://github.com/woocommerce/woocommerce-admin/pull/4899)
This commit is contained in:
parent
a8275715e3
commit
2902b8871b
|
@ -26,6 +26,7 @@ import {
|
||||||
PLUGINS_STORE_NAME,
|
PLUGINS_STORE_NAME,
|
||||||
OPTIONS_STORE_NAME,
|
OPTIONS_STORE_NAME,
|
||||||
ONBOARDING_STORE_NAME,
|
ONBOARDING_STORE_NAME,
|
||||||
|
SETTINGS_STORE_NAME,
|
||||||
} from '@woocommerce/data';
|
} from '@woocommerce/data';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,6 +35,7 @@ import {
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
import CartModal from 'dashboard/components/cart-modal';
|
import CartModal from 'dashboard/components/cart-modal';
|
||||||
import { getAllTasks, recordTaskViewEvent } from './tasks';
|
import { getAllTasks, recordTaskViewEvent } from './tasks';
|
||||||
|
import { getCountryCode } from 'dashboard/utils';
|
||||||
import { recordEvent } from 'lib/tracks';
|
import { recordEvent } from 'lib/tracks';
|
||||||
import withSelect from 'wc-api/with-select';
|
import withSelect from 'wc-api/with-select';
|
||||||
|
|
||||||
|
@ -142,6 +144,7 @@ class TaskDashboard extends Component {
|
||||||
|
|
||||||
getAllTasks() {
|
getAllTasks() {
|
||||||
const {
|
const {
|
||||||
|
countryCode,
|
||||||
profileItems,
|
profileItems,
|
||||||
query,
|
query,
|
||||||
taskListPayments,
|
taskListPayments,
|
||||||
|
@ -153,6 +156,7 @@ class TaskDashboard extends Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return getAllTasks( {
|
return getAllTasks( {
|
||||||
|
countryCode,
|
||||||
profileItems,
|
profileItems,
|
||||||
taskListPayments,
|
taskListPayments,
|
||||||
query,
|
query,
|
||||||
|
@ -444,6 +448,7 @@ export default compose(
|
||||||
withSelect( ( select ) => {
|
withSelect( ( select ) => {
|
||||||
const { getProfileItems } = select( ONBOARDING_STORE_NAME );
|
const { getProfileItems } = select( ONBOARDING_STORE_NAME );
|
||||||
const { getOption } = select( OPTIONS_STORE_NAME );
|
const { getOption } = select( OPTIONS_STORE_NAME );
|
||||||
|
const { getSettings } = select( SETTINGS_STORE_NAME );
|
||||||
const {
|
const {
|
||||||
getActivePlugins,
|
getActivePlugins,
|
||||||
getInstalledPlugins,
|
getInstalledPlugins,
|
||||||
|
@ -463,11 +468,17 @@ export default compose(
|
||||||
const dismissedTasks =
|
const dismissedTasks =
|
||||||
getOption( 'woocommerce_task_list_dismissed_tasks' ) || [];
|
getOption( 'woocommerce_task_list_dismissed_tasks' ) || [];
|
||||||
|
|
||||||
|
const { general: generalSettings = {} } = getSettings( 'general' );
|
||||||
|
const countryCode = getCountryCode(
|
||||||
|
generalSettings.woocommerce_default_country
|
||||||
|
);
|
||||||
|
|
||||||
const activePlugins = getActivePlugins();
|
const activePlugins = getActivePlugins();
|
||||||
const installedPlugins = getInstalledPlugins();
|
const installedPlugins = getInstalledPlugins();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
activePlugins,
|
activePlugins,
|
||||||
|
countryCode,
|
||||||
dismissedTasks,
|
dismissedTasks,
|
||||||
isJetpackConnected: isJetpackConnected(),
|
isJetpackConnected: isJetpackConnected(),
|
||||||
installedPlugins,
|
installedPlugins,
|
||||||
|
|
|
@ -45,6 +45,7 @@ export function recordTaskViewEvent(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAllTasks( {
|
export function getAllTasks( {
|
||||||
|
countryCode,
|
||||||
profileItems,
|
profileItems,
|
||||||
taskListPayments,
|
taskListPayments,
|
||||||
query,
|
query,
|
||||||
|
@ -166,7 +167,9 @@ export function getAllTasks( {
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
visible:
|
visible:
|
||||||
window.wcAdminFeatures.wcpay && woocommercePaymentsInstalled,
|
window.wcAdminFeatures.wcpay &&
|
||||||
|
woocommercePaymentsInstalled &&
|
||||||
|
countryCode === 'US',
|
||||||
time: __( '2 minutes', 'woocommerce-admin' ),
|
time: __( '2 minutes', 'woocommerce-admin' ),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue