2021-01-06 22:08:57 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
import { Component } from '@wordpress/element';
|
|
|
|
import { compose } from '@wordpress/compose';
|
|
|
|
import {
|
|
|
|
Button,
|
2021-02-19 14:20:16 +00:00
|
|
|
Card,
|
|
|
|
CardBody,
|
|
|
|
CardFooter,
|
2021-01-06 22:08:57 +00:00
|
|
|
TabPanel,
|
|
|
|
__experimentalText as Text,
|
|
|
|
} from '@wordpress/components';
|
|
|
|
import { withDispatch, withSelect } from '@wordpress/data';
|
2021-02-19 14:20:16 +00:00
|
|
|
import { SelectControl, Form, TextControl } from '@woocommerce/components';
|
2021-01-06 22:08:57 +00:00
|
|
|
import {
|
|
|
|
ONBOARDING_STORE_NAME,
|
|
|
|
PLUGINS_STORE_NAME,
|
|
|
|
SETTINGS_STORE_NAME,
|
|
|
|
} from '@woocommerce/data';
|
|
|
|
import { recordEvent } from '@woocommerce/tracks';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2021-03-10 15:11:37 +00:00
|
|
|
import { CurrencyContext } from '~/lib/currency-context';
|
|
|
|
import { createNoticesFromResponse } from '~/lib/notices';
|
2021-01-06 22:08:57 +00:00
|
|
|
import { platformOptions } from '../../data/platform-options';
|
|
|
|
import { sellingVenueOptions } from '../../data/selling-venue-options';
|
|
|
|
import { getRevenueOptions } from '../../data/revenue-options';
|
|
|
|
import { getProductCountOptions } from '../../data/product-options';
|
|
|
|
import { SelectiveExtensionsBundle } from './selective-extensions-bundle';
|
|
|
|
import './style.scss';
|
|
|
|
|
|
|
|
const BUSINESS_DETAILS_TAB_NAME = 'business-details';
|
|
|
|
const FREE_FEATURES_TAB_NAME = 'free-features';
|
|
|
|
|
2021-03-17 08:22:33 +00:00
|
|
|
export const filterBusinessExtensions = ( extensionInstallationOptions ) => {
|
|
|
|
return (
|
|
|
|
Object.keys( extensionInstallationOptions )
|
|
|
|
.filter(
|
|
|
|
( key ) =>
|
|
|
|
extensionInstallationOptions[ key ] &&
|
|
|
|
key !== 'install_extensions'
|
|
|
|
)
|
|
|
|
.map( ( key ) => {
|
|
|
|
// Remove anything after :
|
|
|
|
// Please refer to selective-extensions-bundle/index.js
|
|
|
|
// installableExtensions variable
|
|
|
|
// this is to allow duplicate slugs (Tax & Shipping for example)
|
|
|
|
return key.split( ':' )[ 0 ];
|
|
|
|
} )
|
|
|
|
// remove duplicate
|
|
|
|
.filter( ( item, index, arr ) => arr.indexOf( item ) === index )
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-01-06 22:08:57 +00:00
|
|
|
class BusinessDetails extends Component {
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
isPopoverVisible: false,
|
|
|
|
isValid: false,
|
|
|
|
currentTab: 'business-details',
|
|
|
|
savedValues: null,
|
|
|
|
};
|
|
|
|
|
|
|
|
this.onContinue = this.onContinue.bind( this );
|
|
|
|
this.validate = this.validate.bind( this );
|
|
|
|
}
|
|
|
|
|
|
|
|
async onContinue( extensionInstallationOptions ) {
|
|
|
|
const {
|
|
|
|
createNotice,
|
|
|
|
goToNextStep,
|
|
|
|
installAndActivatePlugins,
|
|
|
|
updateProfileItems,
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
const {
|
|
|
|
other_platform: otherPlatform,
|
|
|
|
other_platform_name: otherPlatformName,
|
|
|
|
product_count: productCount,
|
|
|
|
revenue,
|
|
|
|
selling_venues: sellingVenues,
|
|
|
|
} = this.state.savedValues;
|
|
|
|
|
2021-03-17 08:22:33 +00:00
|
|
|
const businessExtensions = filterBusinessExtensions(
|
2021-01-06 22:08:57 +00:00
|
|
|
extensionInstallationOptions
|
|
|
|
);
|
|
|
|
|
|
|
|
recordEvent( 'storeprofiler_store_business_features_continue', {
|
|
|
|
all_extensions_installed: Object.values(
|
|
|
|
extensionInstallationOptions
|
|
|
|
).every( ( val ) => val ),
|
|
|
|
install_woocommerce_services:
|
2021-03-17 08:22:33 +00:00
|
|
|
extensionInstallationOptions[
|
|
|
|
'woocommerce-services:shipping'
|
|
|
|
] || extensionInstallationOptions[ 'woocommerce-services:tax' ],
|
2021-01-06 22:08:57 +00:00
|
|
|
install_mailchimp:
|
|
|
|
extensionInstallationOptions[ 'mailchimp-for-woocommerce' ],
|
2021-03-16 17:25:48 +00:00
|
|
|
install_mailpoet: extensionInstallationOptions.mailpoet,
|
2021-01-06 22:08:57 +00:00
|
|
|
install_jetpack: extensionInstallationOptions.jetpack,
|
|
|
|
install_google_ads:
|
2021-05-10 09:56:47 +00:00
|
|
|
extensionInstallationOptions[ 'google-listings-and-ads' ],
|
2021-01-06 22:08:57 +00:00
|
|
|
install_facebook:
|
|
|
|
extensionInstallationOptions[ 'facebook-for-woocommerce' ],
|
|
|
|
install_wcpay:
|
|
|
|
extensionInstallationOptions[ 'woocommerce-payments' ],
|
|
|
|
install_creative_mail:
|
|
|
|
extensionInstallationOptions[
|
|
|
|
'creative-mail-by-constant-contact'
|
|
|
|
],
|
|
|
|
} );
|
|
|
|
|
2021-01-21 19:59:47 +00:00
|
|
|
const updates = {
|
2021-01-06 22:08:57 +00:00
|
|
|
other_platform: otherPlatform,
|
|
|
|
other_platform_name:
|
|
|
|
otherPlatform === 'other' ? otherPlatformName : '',
|
|
|
|
product_count: productCount,
|
|
|
|
revenue,
|
|
|
|
selling_venues: sellingVenues,
|
|
|
|
business_extensions: businessExtensions,
|
|
|
|
};
|
|
|
|
|
|
|
|
// Remove possible empty values like `revenue` and `other_platform`.
|
2021-01-21 19:59:47 +00:00
|
|
|
Object.keys( updates ).forEach(
|
|
|
|
( key ) => updates[ key ] === '' && delete updates[ key ]
|
|
|
|
);
|
2021-01-06 22:08:57 +00:00
|
|
|
|
|
|
|
const promises = [
|
|
|
|
updateProfileItems( updates ).catch( () => {
|
|
|
|
throw new Error();
|
|
|
|
} ),
|
|
|
|
];
|
|
|
|
|
|
|
|
if ( businessExtensions.length ) {
|
|
|
|
promises.push(
|
|
|
|
installAndActivatePlugins( businessExtensions )
|
|
|
|
.then( ( response ) => {
|
|
|
|
createNoticesFromResponse( response );
|
|
|
|
} )
|
|
|
|
.catch( ( error ) => {
|
|
|
|
createNoticesFromResponse( error );
|
|
|
|
throw new Error();
|
|
|
|
} )
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Promise.all( promises )
|
|
|
|
.then( () => {
|
|
|
|
goToNextStep();
|
|
|
|
} )
|
|
|
|
.catch( () => {
|
|
|
|
createNotice(
|
|
|
|
'error',
|
|
|
|
__(
|
2021-02-10 23:57:51 +00:00
|
|
|
'There was a problem updating your business details',
|
2021-01-06 22:08:57 +00:00
|
|
|
'woocommerce-admin'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
|
|
|
validate( values ) {
|
|
|
|
const errors = {};
|
|
|
|
|
|
|
|
if ( ! values.product_count.length ) {
|
|
|
|
errors.product_count = __(
|
|
|
|
'This field is required',
|
|
|
|
'woocommerce-admin'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! values.selling_venues.length ) {
|
|
|
|
errors.selling_venues = __(
|
|
|
|
'This field is required',
|
|
|
|
'woocommerce-admin'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (
|
|
|
|
! values.other_platform.length &&
|
|
|
|
[ 'other', 'brick-mortar-other' ].includes( values.selling_venues )
|
|
|
|
) {
|
|
|
|
errors.other_platform = __(
|
|
|
|
'This field is required',
|
|
|
|
'woocommerce-admin'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (
|
|
|
|
! values.other_platform_name &&
|
|
|
|
values.other_platform === 'other' &&
|
|
|
|
[ 'other', 'brick-mortar-other' ].includes( values.selling_venues )
|
|
|
|
) {
|
|
|
|
errors.other_platform_name = __(
|
|
|
|
'This field is required',
|
|
|
|
'woocommerce-admin'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (
|
|
|
|
! values.revenue.length &&
|
|
|
|
[
|
|
|
|
'other',
|
|
|
|
'brick-mortar',
|
|
|
|
'brick-mortar-other',
|
|
|
|
'other-woocommerce',
|
|
|
|
].includes( values.selling_venues )
|
|
|
|
) {
|
|
|
|
errors.revenue = __(
|
|
|
|
'This field is required',
|
|
|
|
'woocommerce-admin'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( Object.keys( errors ).length === 0 ) {
|
|
|
|
this.setState( { isValid: true } );
|
|
|
|
}
|
|
|
|
|
|
|
|
return errors;
|
|
|
|
}
|
|
|
|
|
2021-03-18 03:36:40 +00:00
|
|
|
trackBusinessDetailsStep( {
|
|
|
|
other_platform: otherPlatform,
|
|
|
|
other_platform_name: otherPlatformName,
|
|
|
|
product_count: productCount,
|
|
|
|
selling_venues: sellingVenues,
|
|
|
|
revenue,
|
|
|
|
} ) {
|
|
|
|
const { getCurrencyConfig } = this.context;
|
|
|
|
|
|
|
|
recordEvent( 'storeprofiler_store_business_details_continue_variant', {
|
|
|
|
already_selling: sellingVenues,
|
|
|
|
currency: getCurrencyConfig().code,
|
|
|
|
product_number: productCount,
|
|
|
|
revenue,
|
|
|
|
used_platform: otherPlatform,
|
|
|
|
used_platform_name: otherPlatformName,
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
2021-01-06 22:08:57 +00:00
|
|
|
renderBusinessDetailsStep() {
|
|
|
|
const {
|
|
|
|
goToNextStep,
|
|
|
|
isInstallingActivating,
|
|
|
|
hasInstallActivateError,
|
|
|
|
} = this.props;
|
|
|
|
|
2021-04-28 02:54:49 +00:00
|
|
|
const { formatAmount, getCurrencyConfig } = this.context;
|
2021-01-06 22:08:57 +00:00
|
|
|
|
|
|
|
const productCountOptions = getProductCountOptions(
|
|
|
|
getCurrencyConfig()
|
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Form
|
|
|
|
initialValues={
|
|
|
|
this.state.savedValues || this.props.initialValues
|
|
|
|
}
|
2021-05-18 04:24:24 +00:00
|
|
|
onSubmit={ ( values ) => {
|
2021-01-06 22:08:57 +00:00
|
|
|
this.setState( {
|
|
|
|
savedValues: values,
|
|
|
|
currentTab: 'free-features',
|
|
|
|
} );
|
2021-03-18 03:36:40 +00:00
|
|
|
|
|
|
|
this.trackBusinessDetailsStep( values );
|
2021-01-06 22:08:57 +00:00
|
|
|
} }
|
2021-05-18 04:24:24 +00:00
|
|
|
onChange={ ( _, values, isValid ) => {
|
2021-01-06 22:08:57 +00:00
|
|
|
this.setState( { savedValues: values, isValid } );
|
|
|
|
} }
|
|
|
|
validate={ this.validate }
|
|
|
|
>
|
|
|
|
{ ( { getInputProps, handleSubmit, values, isValidForm } ) => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div className="woocommerce-profile-wizard__step-header">
|
|
|
|
<Text variant="title.small" as="h2">
|
|
|
|
{ __(
|
|
|
|
'Tell us about your business',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
</Text>
|
|
|
|
<Text variant="body">
|
|
|
|
{ __(
|
|
|
|
"We'd love to know if you are just getting started or you already have a business in place.",
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
</Text>
|
|
|
|
</div>
|
|
|
|
<Card>
|
2021-02-19 14:20:16 +00:00
|
|
|
<CardBody>
|
2021-01-06 22:08:57 +00:00
|
|
|
<SelectControl
|
2021-03-02 01:06:29 +00:00
|
|
|
excludeSelectedOptions={ false }
|
2021-01-06 22:08:57 +00:00
|
|
|
label={ __(
|
|
|
|
'How many products do you plan to display?',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
options={ productCountOptions }
|
|
|
|
required
|
|
|
|
{ ...getInputProps( 'product_count' ) }
|
|
|
|
/>
|
|
|
|
|
|
|
|
<SelectControl
|
2021-03-02 01:06:29 +00:00
|
|
|
excludeSelectedOptions={ false }
|
2021-01-06 22:08:57 +00:00
|
|
|
label={ __(
|
|
|
|
'Currently selling elsewhere?',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
options={ sellingVenueOptions }
|
|
|
|
required
|
|
|
|
{ ...getInputProps( 'selling_venues' ) }
|
|
|
|
/>
|
|
|
|
|
|
|
|
{ [
|
|
|
|
'other',
|
|
|
|
'brick-mortar',
|
|
|
|
'brick-mortar-other',
|
|
|
|
'other-woocommerce',
|
|
|
|
].includes( values.selling_venues ) && (
|
|
|
|
<SelectControl
|
2021-03-02 01:06:29 +00:00
|
|
|
excludeSelectedOptions={ false }
|
2021-01-06 22:08:57 +00:00
|
|
|
label={ __(
|
|
|
|
"What's your current annual revenue?",
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
options={ getRevenueOptions(
|
|
|
|
getCurrencyConfig(),
|
|
|
|
this.props.settings
|
2021-04-28 02:54:49 +00:00
|
|
|
.woocommerce_default_country,
|
|
|
|
formatAmount
|
2021-01-06 22:08:57 +00:00
|
|
|
) }
|
|
|
|
required
|
|
|
|
{ ...getInputProps( 'revenue' ) }
|
|
|
|
/>
|
|
|
|
) }
|
|
|
|
|
|
|
|
{ [
|
|
|
|
'other',
|
|
|
|
'brick-mortar-other',
|
|
|
|
].includes( values.selling_venues ) && (
|
|
|
|
<>
|
|
|
|
<div className="business-competitors">
|
|
|
|
<SelectControl
|
2021-03-02 01:06:29 +00:00
|
|
|
excludeSelectedOptions={
|
|
|
|
false
|
|
|
|
}
|
2021-01-06 22:08:57 +00:00
|
|
|
label={ __(
|
|
|
|
'Which platform is the store using?',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
options={ platformOptions }
|
|
|
|
required
|
|
|
|
{ ...getInputProps(
|
|
|
|
'other_platform'
|
|
|
|
) }
|
|
|
|
/>
|
|
|
|
{ values.other_platform ===
|
|
|
|
'other' && (
|
|
|
|
<TextControl
|
|
|
|
label={ __(
|
|
|
|
'What is the platform name?',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
required
|
|
|
|
{ ...getInputProps(
|
|
|
|
'other_platform_name'
|
|
|
|
) }
|
|
|
|
/>
|
|
|
|
) }
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
) }
|
2021-02-19 14:20:16 +00:00
|
|
|
</CardBody>
|
|
|
|
<CardFooter isBorderless justify="center">
|
|
|
|
<Button
|
|
|
|
isPrimary
|
|
|
|
onClick={ handleSubmit }
|
|
|
|
disabled={ ! isValidForm }
|
|
|
|
isBusy={ isInstallingActivating }
|
|
|
|
>
|
|
|
|
{ ! hasInstallActivateError
|
|
|
|
? __(
|
|
|
|
'Continue',
|
|
|
|
'woocommerce-admin'
|
|
|
|
)
|
|
|
|
: __(
|
|
|
|
'Retry',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
</Button>
|
|
|
|
{ hasInstallActivateError && (
|
2021-01-06 22:08:57 +00:00
|
|
|
<Button
|
2021-02-19 14:20:16 +00:00
|
|
|
onClick={ () => goToNextStep() }
|
2021-01-06 22:08:57 +00:00
|
|
|
>
|
2021-02-19 14:20:16 +00:00
|
|
|
{ __(
|
|
|
|
'Continue without installing',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
2021-01-06 22:08:57 +00:00
|
|
|
</Button>
|
2021-02-19 14:20:16 +00:00
|
|
|
) }
|
|
|
|
</CardFooter>
|
2021-01-06 22:08:57 +00:00
|
|
|
</Card>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
} }
|
|
|
|
</Form>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
renderFreeFeaturesStep() {
|
2021-03-08 14:23:39 +00:00
|
|
|
const { isInstallingActivating, settings, profileItems } = this.props;
|
|
|
|
const country = settings.woocommerce_default_country
|
|
|
|
? settings.woocommerce_default_country
|
|
|
|
: null;
|
2021-01-06 22:08:57 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div className="woocommerce-profile-wizard__step-header">
|
|
|
|
<Text variant="title.small" as="h2">
|
|
|
|
{ __(
|
|
|
|
'Included business features',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
</Text>
|
|
|
|
<Text variant="body">
|
|
|
|
{ __(
|
|
|
|
'We recommend enhancing your store with these free extensions',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
</Text>
|
|
|
|
<Text variant="body">
|
|
|
|
{ __(
|
|
|
|
'No commitment required - you can remove them at any time.',
|
|
|
|
'woocommerce-admin'
|
|
|
|
) }
|
|
|
|
</Text>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<SelectiveExtensionsBundle
|
|
|
|
isInstallingActivating={ isInstallingActivating }
|
|
|
|
onSubmit={ this.onContinue }
|
2021-03-08 14:23:39 +00:00
|
|
|
country={ country }
|
|
|
|
industry={ profileItems.industry }
|
2021-03-17 08:22:33 +00:00
|
|
|
productTypes={ profileItems.product_types }
|
2021-01-06 22:08:57 +00:00
|
|
|
/>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2021-02-04 19:40:58 +00:00
|
|
|
const { initialValues } = this.props;
|
|
|
|
|
2021-01-06 22:08:57 +00:00
|
|
|
// There is a hack here to help us manage the selected tab programatically.
|
|
|
|
// We set the tab name "current-tab". when its the one we want selected. This tricks
|
|
|
|
// the logic in the TabPanel and allows us to switch which tab has the name "current-tab"
|
|
|
|
// and force it to re-render with a different tab selected.
|
|
|
|
return (
|
|
|
|
<TabPanel
|
|
|
|
activeClass="is-active"
|
|
|
|
initialTabName="current-tab"
|
|
|
|
onSelect={ ( tabName ) => {
|
|
|
|
if ( this.state.currentTab !== tabName ) {
|
2021-02-04 19:40:58 +00:00
|
|
|
this.setState( {
|
|
|
|
currentTab: tabName,
|
2021-06-24 05:04:23 +00:00
|
|
|
savedValues:
|
|
|
|
this.state.savedValues || initialValues,
|
2021-02-04 19:40:58 +00:00
|
|
|
} );
|
2021-01-06 22:08:57 +00:00
|
|
|
}
|
|
|
|
} }
|
|
|
|
tabs={ [
|
|
|
|
{
|
|
|
|
name:
|
|
|
|
this.state.currentTab === BUSINESS_DETAILS_TAB_NAME
|
|
|
|
? 'current-tab'
|
|
|
|
: BUSINESS_DETAILS_TAB_NAME,
|
|
|
|
id: BUSINESS_DETAILS_TAB_NAME,
|
|
|
|
title: __( 'Business details', 'woocommerce-admin' ),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:
|
|
|
|
this.state.currentTab === FREE_FEATURES_TAB_NAME
|
|
|
|
? 'current-tab'
|
|
|
|
: FREE_FEATURES_TAB_NAME,
|
|
|
|
id: FREE_FEATURES_TAB_NAME,
|
|
|
|
title: __( 'Free features', 'woocommerce-admin' ),
|
|
|
|
className: this.state.isValid ? '' : 'is-disabled',
|
|
|
|
},
|
|
|
|
] }
|
|
|
|
>
|
|
|
|
{ ( tab ) => <>{ this.getTab( tab.id ) }</> }
|
|
|
|
</TabPanel>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
getTab( tabId ) {
|
|
|
|
if ( tabId === BUSINESS_DETAILS_TAB_NAME ) {
|
|
|
|
return this.renderBusinessDetailsStep();
|
|
|
|
}
|
|
|
|
return this.renderFreeFeaturesStep();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BusinessDetails.contextType = CurrencyContext;
|
|
|
|
|
2021-06-03 08:33:54 +00:00
|
|
|
export const BusinessFeaturesList = compose(
|
2021-01-06 22:08:57 +00:00
|
|
|
withSelect( ( select ) => {
|
|
|
|
const { getSettings, getSettingsError } = select( SETTINGS_STORE_NAME );
|
|
|
|
const { getProfileItems, getOnboardingError } = select(
|
|
|
|
ONBOARDING_STORE_NAME
|
|
|
|
);
|
|
|
|
const { getPluginsError, isPluginsRequesting } = select(
|
|
|
|
PLUGINS_STORE_NAME
|
|
|
|
);
|
|
|
|
const { general: settings = {} } = getSettings( 'general' );
|
|
|
|
|
|
|
|
return {
|
|
|
|
hasInstallActivateError:
|
|
|
|
getPluginsError( 'installPlugins' ) ||
|
|
|
|
getPluginsError( 'activatePlugins' ),
|
|
|
|
isError: Boolean( getOnboardingError( 'updateProfileItems' ) ),
|
|
|
|
profileItems: getProfileItems(),
|
|
|
|
isSettingsError: Boolean( getSettingsError( 'general' ) ),
|
|
|
|
settings,
|
|
|
|
isInstallingActivating:
|
|
|
|
isPluginsRequesting( 'installPlugins' ) ||
|
|
|
|
isPluginsRequesting( 'activatePlugins' ) ||
|
|
|
|
isPluginsRequesting( 'getJetpackConnectUrl' ),
|
|
|
|
};
|
|
|
|
} ),
|
|
|
|
withDispatch( ( dispatch ) => {
|
|
|
|
const { updateProfileItems } = dispatch( ONBOARDING_STORE_NAME );
|
|
|
|
const { installAndActivatePlugins } = dispatch( PLUGINS_STORE_NAME );
|
|
|
|
const { createNotice } = dispatch( 'core/notices' );
|
|
|
|
|
|
|
|
return {
|
|
|
|
createNotice,
|
|
|
|
installAndActivatePlugins,
|
|
|
|
updateProfileItems,
|
|
|
|
};
|
|
|
|
} )
|
|
|
|
)( BusinessDetails );
|