diff --git a/client/my-sites/checklist/checklist-show/index.jsx b/client/my-sites/checklist/checklist-show/index.jsx index daf2fe8ac4a1b..8f4e7e3618c13 100644 --- a/client/my-sites/checklist/checklist-show/index.jsx +++ b/client/my-sites/checklist/checklist-show/index.jsx @@ -18,7 +18,7 @@ import { getSelectedSiteId } from 'state/ui/selectors'; import getSiteChecklist from 'state/selectors/get-site-checklist'; import { getSiteSlug } from 'state/sites/selectors'; import QuerySiteChecklist from 'components/data/query-site-checklist'; -import { getTaskUrls, launchTask, tasks } from '../onboardingChecklist'; +import { getTaskUrls, launchTask, getTasks } from '../onboardingChecklist'; import { recordTracksEvent } from 'state/analytics/actions'; import { createNotice } from 'state/notices/actions'; import { requestGuidedTour } from 'state/ui/guided-tours/actions'; @@ -55,7 +55,7 @@ class ChecklistShow extends PureComponent { }; render() { - const { siteId, taskStatuses } = this.props; + const { siteId, taskStatuses, tasks } = this.props; return ( @@ -96,6 +96,7 @@ const mapStateToProps = state => { siteSlug: getSiteSlug( state, siteId ), taskStatuses: get( getSiteChecklist( state, siteId ), [ 'tasks' ] ), taskUrls: getTaskUrls( getSitePosts( state, siteId ) ), + tasks: getTasks( state, siteId ), }; }; diff --git a/client/my-sites/checklist/onboardingChecklist.js b/client/my-sites/checklist/onboardingChecklist.js index 5c7261b77dc54..7b7f1c94c4681 100644 --- a/client/my-sites/checklist/onboardingChecklist.js +++ b/client/my-sites/checklist/onboardingChecklist.js @@ -6,6 +6,7 @@ import page from 'page'; import { isDesktop } from 'lib/viewport'; import { translate } from 'i18n-calypso'; import { find } from 'lodash'; +import { getSiteOption } from 'state/sites/selectors'; export const tasks = [ { @@ -110,6 +111,18 @@ export const tasks = [ }, ]; +export function getTasks( state, siteId ) { + const designType = getSiteOption( state, siteId, 'design_type' ); + + if ( designType === 'blog' ) { + return tasks; + } + + return tasks.filter( task => { + return task.id !== 'avatar_uploaded' && task.id !== 'post_published'; + } ); +} + export function launchTask( { task, location, requestTour, siteSlug, track } ) { const checklist_name = 'new_blog'; const url = task.url && task.url.replace( '$siteSlug', siteSlug ); diff --git a/client/my-sites/checkout/checkout/checkout.jsx b/client/my-sites/checkout/checkout/checkout.jsx index ef9f50a8a4de1..fb46ab492a9ee 100644 --- a/client/my-sites/checkout/checkout/checkout.jsx +++ b/client/my-sites/checkout/checkout/checkout.jsx @@ -338,7 +338,7 @@ export class Checkout extends React.Component { const hasGoogleAppsInCart = cartItems.hasGoogleApps( cart ); // The onboarding checklist currently supports the blog type only. - if ( hasGoogleAppsInCart && domainReceiptId && 'blog' === siteDesignType ) { + if ( hasGoogleAppsInCart && domainReceiptId && 'store' !== siteDesignType ) { analytics.tracks.recordEvent( 'calypso_checklist_assign', { site: selectedSiteSlug, plan: 'paid', diff --git a/client/my-sites/stats/checklist-banner/index.jsx b/client/my-sites/stats/checklist-banner/index.jsx index 8b51b6cef6663..4c52a15cc4495 100644 --- a/client/my-sites/stats/checklist-banner/index.jsx +++ b/client/my-sites/stats/checklist-banner/index.jsx @@ -21,8 +21,8 @@ import Gauge from 'components/gauge'; import ProgressBar from 'components/progress-bar'; import QuerySiteChecklist from 'components/data/query-site-checklist'; import getSiteChecklist from 'state/selectors/get-site-checklist'; -import { getSite, getSiteSlug } from 'state/sites/selectors'; -import { getTaskUrls, launchTask, tasks } from 'my-sites/checklist/onboardingChecklist'; +import { getSiteOption, getSiteSlug } from 'state/sites/selectors'; +import { getTaskUrls, launchTask, getTasks } from 'my-sites/checklist/onboardingChecklist'; import ChecklistShowShare from 'my-sites/checklist/share'; import { recordTracksEvent } from 'state/analytics/actions'; import { requestGuidedTour } from 'state/ui/guided-tours/actions'; @@ -76,7 +76,7 @@ export class ChecklistBanner extends Component { getTask() { const task = find( - tasks, + this.props.tasks, ( { id, completed } ) => ! completed && ! get( this.props.taskStatuses, [ id, 'completed' ] ) ); return ( @@ -101,7 +101,7 @@ export class ChecklistBanner extends Component { return false; } - if ( this.props.siteDesignType !== 'blog' ) { + if ( this.props.siteDesignType === 'store' ) { return false; } @@ -133,7 +133,7 @@ export class ChecklistBanner extends Component { } render() { - const { siteId, taskStatuses, translate } = this.props; + const { siteId, taskStatuses, translate, tasks } = this.props; const total = tasks.length; const completed = reduce( tasks, @@ -205,15 +205,16 @@ export class ChecklistBanner extends Component { } const mapStateToProps = ( state, { siteId } ) => { - const taskStatuses = get( getSiteChecklist( state, siteId ), [ 'tasks' ] ); const siteSlug = getSiteSlug( state, siteId ); - const siteDesignType = get( getSite( state, siteId ), [ 'options', 'design_type' ] ); + const taskStatuses = get( getSiteChecklist( state, siteId ), [ 'tasks' ] ); + const siteDesignType = getSiteOption( state, siteId, 'design_type' ); return { siteDesignType, siteSlug, taskStatuses, taskUrls: getTaskUrls( getSitePosts( state, siteId ) ), + tasks: getTasks( state, siteId ), }; }; diff --git a/client/signup/processing-screen/index.jsx b/client/signup/processing-screen/index.jsx index f32893fdd0846..2d21d40c66740 100644 --- a/client/signup/processing-screen/index.jsx +++ b/client/signup/processing-screen/index.jsx @@ -298,8 +298,8 @@ export class SignupProcessingScreen extends Component { return ( config.isEnabled( 'onboarding-checklist' ) && - 'blog' === designType && - [ 'personal', 'premium', 'business' ].indexOf( this.props.flowName ) === -1 + 'store' !== designType && + [ 'main', 'desktop', 'subdomain' ].indexOf( this.props.flowName ) !== -1 ); } diff --git a/client/state/selectors/is-eligible-for-checkout-to-checklist.js b/client/state/selectors/is-eligible-for-checkout-to-checklist.js index f92770389d903..23907920a635a 100644 --- a/client/state/selectors/is-eligible-for-checkout-to-checklist.js +++ b/client/state/selectors/is-eligible-for-checkout-to-checklist.js @@ -35,7 +35,7 @@ export default function isEligibleForCheckoutToChecklist( state, siteId, cart ) } return ( - 'blog' === designType && + 'store' !== designType && isNewSite( state, siteId ) && cartItems.hasPlan( cart ) && ! some( cartItems.getAll( cart ), isDotcomBusinessPlan )