From 3720d28df0c42647eba548ea6a577f0882f699e7 Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Tue, 3 Dec 2024 17:15:34 -0500 Subject: [PATCH 01/49] Initial start at new plans page for migrations --- .../importer/wordpress/upgrade-plan/index.tsx | 33 +++- .../wordpress/upgrade-plan/skeleton/index.tsx | 90 +++++----- .../importer/wordpress/upgrade-plan/types.ts | 7 +- .../upgrade-plan/upgrade-plan-details.tsx | 169 +++++++++++++++--- .../migration-assistance-modal/index.tsx | 4 +- .../importer-migrate-message/style.scss | 2 +- .../site-migration-upgrade-plan/index.tsx | 63 +++++-- .../site-migration-upgrade-plan/style.scss | 56 ++++++ 8 files changed, 330 insertions(+), 94 deletions(-) create mode 100644 client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss diff --git a/client/blocks/importer/wordpress/upgrade-plan/index.tsx b/client/blocks/importer/wordpress/upgrade-plan/index.tsx index a710409e0d188..cecd64da4e83a 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/index.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/index.tsx @@ -1,6 +1,11 @@ import { recordTracksEvent } from '@automattic/calypso-analytics'; import { isEnabled } from '@automattic/calypso-config'; -import { getPlan, PLAN_BUSINESS } from '@automattic/calypso-products'; +import { + getPlan, + PLAN_BUSINESS, + PLAN_BUSINESS_2_YEARS, + PLAN_BUSINESS_MONTHLY, +} from '@automattic/calypso-products'; import { Button } from '@automattic/components'; import { Plans } from '@automattic/data-stores'; import { useHasEnTranslation, useIsEnglishLocale } from '@automattic/i18n-utils'; @@ -35,6 +40,7 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = trackingEventsProps, hideFreeMigrationTrialForNonVerifiedEmail = false, visiblePlan = PLAN_BUSINESS, + showVariants = false, } = props; const { data: migrationTrialEligibility } = useCheckEligibilityMigrationTrialPlan( site.ID ); const isEligibleForTrialPlan = @@ -47,7 +53,7 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = const pricingMeta = Plans.usePricingMetaForGridPlans( { coupon: undefined, - planSlugs: [ visiblePlan ], + planSlugs: [ visiblePlan, PLAN_BUSINESS_2_YEARS, PLAN_BUSINESS_MONTHLY ], siteId: site.ID, storageAddOns: null, useCheckPlanAvailabilityForPurchase, @@ -56,6 +62,16 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = const pricing = pricingMeta && pricingMeta[ visiblePlan ] ? pricingMeta[ visiblePlan ] : undefined; + const pricing2Years = + pricingMeta && pricingMeta[ PLAN_BUSINESS_2_YEARS ] + ? pricingMeta[ PLAN_BUSINESS_2_YEARS ] + : undefined; + + const pricingMonthly = + pricingMeta && pricingMeta[ PLAN_BUSINESS_MONTHLY ] + ? pricingMeta[ PLAN_BUSINESS_MONTHLY ] + : undefined; + const introOfferAvailable = isEnabled( 'migration-flow/introductory-offer' ) && pricing?.introOffer && @@ -155,7 +171,13 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = ); if ( isFetchingHostingDetails || ! pricing ) { - return ; + return ( +
+ { showVariants && } + + { showVariants && } +
+ ); } return ( @@ -194,11 +216,14 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = ) } - { renderCTAs() } diff --git a/client/blocks/importer/wordpress/upgrade-plan/skeleton/index.tsx b/client/blocks/importer/wordpress/upgrade-plan/skeleton/index.tsx index d1544681880dc..b0787e57bb29d 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/skeleton/index.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/skeleton/index.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import './style.scss'; -export const Skeleton: FC = () => { +export const Skeleton: FC< { showVariants: boolean } > = ( { showVariants } ) => { return (
@@ -33,58 +33,60 @@ export const Skeleton: FC = () => { style={ { width: '103px', margin: '0 auto' } } />
-
-
-
-
- - { Array.from( { length: 3 } ).map( ( _, index ) => ( + { ! showVariants && ( +
+
+ className="import-upgrade-plan-skeleton import-upgrade-plan-skeleton--dark-gray" + style={ { width: '131px', height: '17px', margin: '0 auto 14px' } } + /> +
+ + { Array.from( { length: 3 } ).map( ( _, index ) => (
-
+ key={ index } + className="import-upgrade-plan-skeleton__flex-container" + style={ { marginBottom: '12px' } } + >
-
+
+
+
+
-
- ) ) } + ) ) } -
+
-
-
-
-
-
+
+
+
+
+
+
-
+ ) }
diff --git a/client/blocks/importer/wordpress/upgrade-plan/types.ts b/client/blocks/importer/wordpress/upgrade-plan/types.ts index 413fd6a469ce2..46acf2b582ed0 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/types.ts +++ b/client/blocks/importer/wordpress/upgrade-plan/types.ts @@ -17,6 +17,10 @@ export type UpgradePlanDetailsProps = { introOfferAvailable: boolean; pricing?: PricingMetaForGridPlan; upgradePlanHostingDetailsList: Array< HostingDetailsItem >; + showVariants?: boolean; + onCtaClick?: ( planSlug: string ) => void; + pricing2Years?: PricingMetaForGridPlan; + pricingMonthly?: PricingMetaForGridPlan; }; export type UpgradePlanProps = { @@ -27,9 +31,10 @@ export type UpgradePlanProps = { hideTitleAndSubTitle?: boolean; onFreeTrialClick?: () => void; navigateToVerifyEmailStep: () => void; - onCtaClick: () => void; + onCtaClick: ( planSlug: string ) => void; onContentOnlyClick?: () => void; trackingEventsProps?: Record< string, unknown >; hideFreeMigrationTrialForNonVerifiedEmail?: boolean; + showVariants?: boolean; visiblePlan?: PlanSlug; }; diff --git a/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx b/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx index 55241e398533d..9aca56fb1a23a 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx @@ -4,13 +4,14 @@ import { Plan, PLAN_BUSINESS, PLAN_BUSINESS_MONTHLY, + PLAN_BUSINESS_2_YEARS, isMonthly, } from '@automattic/calypso-products'; import { Badge, CloudLogo, Button, PlanPrice } from '@automattic/components'; import { PricingMetaForGridPlan } from '@automattic/data-stores'; import { formatCurrency } from '@automattic/format-currency'; import { useHasEnTranslation } from '@automattic/i18n-utils'; -import { Title } from '@automattic/onboarding'; +import { NextButton, Title } from '@automattic/onboarding'; import { Plans2023Tooltip, useManageTooltipToggle } from '@automattic/plans-grid-next'; import clsx from 'clsx'; import { type TranslateResult, useTranslate } from 'i18n-calypso'; @@ -79,6 +80,7 @@ interface PlanPriceOfferProps { originalFullPrice?: number; introOfferFullPrice?: number; introOfferAvailable: boolean; + showVariants?: boolean; } const PlanPriceOffer = ( props: PlanPriceOfferProps ) => { @@ -93,6 +95,7 @@ const PlanPriceOffer = ( props: PlanPriceOfferProps ) => { introOfferMonthlyPrice, originalMonthlyPrice, currencyCode, + showVariants, } = props; const showOriginalPrice = @@ -148,9 +151,11 @@ const PlanPriceOffer = ( props: PlanPriceOfferProps ) => { return ( - - { badgeText } - + { ! showVariants && ( + + { badgeText } + + ) }
{ const preparePlanPriceOfferProps = ( introOfferAvailable: boolean, plan?: Plan, - pricing?: PricingMetaForGridPlan + pricing?: PricingMetaForGridPlan, + showVariants?: boolean ): PlanPriceOfferProps => { const currencyCode = pricing?.currencyCode; const originalMonthlyPrice = pricing?.originalPrice.monthly ?? undefined; @@ -190,6 +196,7 @@ const preparePlanPriceOfferProps = ( originalFullPrice, introOfferFullPrice, introOfferAvailable, + showVariants, }; }; @@ -201,11 +208,39 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => { typeof PLAN_BUSINESS | typeof PLAN_BUSINESS_MONTHLY >( PLAN_BUSINESS ); - const { children, pricing, introOfferAvailable, upgradePlanHostingDetailsList } = props; + const { + children, + pricing, + pricing2Years, + pricingMonthly, + introOfferAvailable, + upgradePlanHostingDetailsList, + showVariants, + onCtaClick, + } = props; const plan = getPlan( selectedPlan ); + const planMonthly = getPlan( PLAN_BUSINESS_MONTHLY ); + const plan2Years = getPlan( PLAN_BUSINESS_2_YEARS ); - const planPriceOfferProps = preparePlanPriceOfferProps( introOfferAvailable, plan, pricing ); + const planPriceOfferProps = preparePlanPriceOfferProps( + introOfferAvailable, + plan, + pricing, + showVariants + ); + const planPriceOfferPropsMonthly = preparePlanPriceOfferProps( + introOfferAvailable, + planMonthly, + pricingMonthly, + showVariants + ); + const planPriceOfferProps2Years = preparePlanPriceOfferProps( + introOfferAvailable, + plan2Years, + pricing2Years, + showVariants + ); const { mutate: setSelectedPlanSlug } = useSelectedPlanUpgradeMutation(); @@ -219,7 +254,7 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => { return (
- { ! introOfferAvailable && ( + { ! introOfferAvailable && ! showVariants && ( setSelectedPlan( PLAN_BUSINESS_MONTHLY ) } @@ -227,21 +262,63 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => { /> ) } + { showVariants && ( +
+
+
+ + { translate( 'Monthly' ) } + +

{ translate( 'Unlock the power of WordPress with plugins and cloud tools.' ) }

+
+ + + +
+
+ onCtaClick?.( PLAN_BUSINESS_MONTHLY ) } + > + { translate( 'Get Monthly' ) } + +
+
+ { translate( 'Refundable within 7 days. No questions asked.' ) } +
+
+
+ +
+
+
+ ) } +
- + { showVariants ? ( + + { translate( 'Most popular' ) } + + ) : ( + + ) } - { plan?.getTitle() } + { showVariants ? translate( 'Yearly' ) : plan?.getTitle() }

{ translate( 'Unlock the power of WordPress with plugins and cloud tools.' ) }

@@ -249,7 +326,15 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => {
-
{ children }
+
+ { showVariants ? ( + onCtaClick?.( PLAN_BUSINESS ) }> + { translate( 'Get Yearly' ) } + + ) : ( + children + ) } +
{ plan && ! isMonthly( plan.getStoreSlug() ) ? translate( 'Refundable within 14 days. No questions asked.' ) @@ -264,10 +349,48 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => { />
- + { ! showVariants && ( + + ) }
+ + { showVariants && ( +
+
+
+ + { translate( 'Biennially' ) } + +

{ translate( 'Unlock the power of WordPress with plugins and cloud tools.' ) }

+
+ + + +
+
+ onCtaClick?.( PLAN_BUSINESS_2_YEARS ) } + > + { translate( 'Get Biennial' ) } + +
+
+ { translate( 'Refundable within 14 days. No questions asked.' ) } +
+
+
+ +
+
+
+ ) }
); }; diff --git a/client/landing/stepper/declarative-flow/internals/components/migration-assistance-modal/index.tsx b/client/landing/stepper/declarative-flow/internals/components/migration-assistance-modal/index.tsx index b642442e22835..586ed4cb5fd0d 100644 --- a/client/landing/stepper/declarative-flow/internals/components/migration-assistance-modal/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/components/migration-assistance-modal/index.tsx @@ -15,7 +15,7 @@ const EVENT_NAMES = { interface MigrationAssistanceModalProps { navigateBack: ( () => void ) | undefined; migrateFrom: string | null; - onConfirm: ( () => void ) | undefined; + onConfirm: ( ( planSlug: string ) => void ) | undefined; } export const MigrationAssistanceModal: React.FunctionComponent< MigrationAssistanceModalProps > = ( props: MigrationAssistanceModalProps @@ -39,7 +39,7 @@ export const MigrationAssistanceModal: React.FunctionComponent< MigrationAssista const acceptedDeal = true; setMigrationAssistanceAccepted(); logEvent( acceptedDeal ); - props.onConfirm?.(); + props.onConfirm?.( PLAN_BUSINESS ); }; useEffect( () => { diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/importer-migrate-message/style.scss b/client/landing/stepper/declarative-flow/internals/steps-repository/importer-migrate-message/style.scss index 3d5167c3ef202..0a396741f241a 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/importer-migrate-message/style.scss +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/importer-migrate-message/style.scss @@ -2,7 +2,7 @@ @import "@automattic/onboarding/styles/mixins"; .import-hosted-site, -.site-migration :not(.site-migration-instructions--launchpad), +.site-migration :not(.site-migration-instructions--launchpad, .is-wide-layout), .migrate-message { .step-container__header { margin: auto; diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx index 37f215dd54770..d1fbcb372e434 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx @@ -6,6 +6,7 @@ import { } from '@automattic/calypso-products'; import { useHasEnTranslation } from '@automattic/i18n-utils'; import { StepContainer } from '@automattic/onboarding'; +import clsx from 'clsx'; import { useTranslate } from 'i18n-calypso'; import { type FC } from 'react'; import { UpgradePlan } from 'calypso/blocks/importer/wordpress/upgrade-plan'; @@ -19,6 +20,8 @@ import { recordTracksEvent } from 'calypso/lib/analytics/tracks'; import { MigrationAssistanceModal } from '../../components/migration-assistance-modal'; import type { StepProps } from '../../types'; +import './style.scss'; + type StepContainerProps = React.ComponentProps< typeof StepContainer >; interface Props extends StepProps { @@ -35,6 +38,7 @@ const SiteMigrationUpgradePlan: FC< Props > = ( { customizedActionButtons, ...props } ) => { + const showVariants = true; const { onSkip, skipLabelText, skipPosition } = props; const siteItem = useSite(); const siteSlug = useSiteSlug(); @@ -57,10 +61,11 @@ const SiteMigrationUpgradePlan: FC< Props > = ( { const migrateFrom = queryParams.get( 'from' ); const showMigrationModal = queryParams.get( 'showModal' ); - const goToMigrationAssistanceCheckout = ( userAcceptedDeal = false ) => { + const goToMigrationAssistanceCheckout = ( planSlug: string, userAcceptedDeal = false ) => { + const plan = getPlanByPathSlug( planSlug ); navigation?.submit?.( { goToCheckout: true, - plan: plan.getPathSlug ? plan.getPathSlug() : '', + plan: plan?.getPathSlug ? plan.getPathSlug() : '', userAcceptedDeal, } ); }; @@ -74,9 +79,9 @@ const SiteMigrationUpgradePlan: FC< Props > = ( { <> { showMigrationModal && ( { + onConfirm={ ( planSlug: string ) => { const userAcceptedDeal = true; - goToMigrationAssistanceCheckout( userAcceptedDeal ); + goToMigrationAssistanceCheckout( planSlug, userAcceptedDeal ); } } migrateFrom={ migrateFrom } navigateBack={ navigation.goBack } @@ -88,9 +93,9 @@ const SiteMigrationUpgradePlan: FC< Props > = ( { subTitleText="" isBusy={ false } hideTitleAndSubTitle - onCtaClick={ () => { + onCtaClick={ ( planSlug: string ) => { const userAcceptedDeal = false; - goToMigrationAssistanceCheckout( userAcceptedDeal ); + goToMigrationAssistanceCheckout( planSlug, userAcceptedDeal ); } } onFreeTrialClick={ () => { navigation.submit?.( { @@ -105,44 +110,64 @@ const SiteMigrationUpgradePlan: FC< Props > = ( { hideFreeMigrationTrialForNonVerifiedEmail={ hideFreeMigrationTrialForNonVerifiedEmail } trackingEventsProps={ customTracksEventProps } visiblePlan={ plan.getStoreSlug() } + showVariants={ showVariants } /> ); - const headerText = + const className = clsx( + 'is-step-site-migration-upgrade-plan', + showVariants && 'is-step-site-migration-upgrade-plan-with-variants' + ); + + let headerText = props.headerText ?? ( hasEnTranslation( 'Upgrade your plan' ) ? translate( 'Upgrade your plan' ) : translate( 'Upgrade your plan to migrate your site' ) ); + showVariants && ( headerText = translate( 'There is a plan for you' ) ); + + const planName = getPlan( PLAN_BUSINESS )?.getTitle() ?? ''; + + let subHeaderText = hasEnTranslation( 'Migrations are exclusive to the %(planName)s plan.' ) + ? translate( 'Migrations are exclusive to the %(planName)s plan.', { + args: { + planName, + }, + } ) + : translate( + 'Migrations are exclusive to the Creator plan. Check out all its benefits, and upgrade to get started.' + ); + showVariants && + ( subHeaderText = translate( + 'A %(planName)s plan is needed for Migrations. Pick one of the following options to tap into our lightning-fast infrastructure. Your site will be faster, smoother, and ready for anything.', + { + args: { + planName, + }, + } + ) ); + return ( <> diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss new file mode 100644 index 0000000000000..1c9a82921dd19 --- /dev/null +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss @@ -0,0 +1,56 @@ +.is-step-site-migration-upgrade-plan-with-variants { + .import__upgrade-plan-variants-badge { + background-color: var(--studio-gray-100); + color: var(--color-text-inverted); + border-radius: 4px; + font-size: 0.75rem; + margin-bottom: 1rem; + } + .import__upgrade-plan .import__upgrade-plan-cta button.button.is-primary { + background-color: var(--studio-wordpress-blue-50) !important; + border-color: var(--studio-wordpress-blue-50); + } + .import__upgrade-plan .import__upgrade-plan-refund-sub-text, + .import__upgrade-plan .import__upgrade-plan-features-list .import__upgrade-plan-feature-more button { + color: var(--color-text-subtle); + } + + .import__upgrade-plan .import__upgrade-plan-details { + @media ( min-width: 1040px ) { + display: flex; + flex-direction: row; + gap: 0; + + .import__upgrade-plan-container { + padding-top: 1.5rem; + padding-bottom: 1.5rem; + gap: 0; + + &:first-of-type .import__upgrade-plan-features-container { + border-right: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + + &:last-of-type .import__upgrade-plan-features-container { + border-left: 0; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + + .import__upgrade-plan-features-container { + padding-top: 1.5rem; + padding-bottom: 1.5rem; + margin-bottom: 0; + margin-top: 0; + } + + &:first-of-type .import__upgrade-plan-features-container, + &:last-of-type .import__upgrade-plan-features-container { + margin-bottom: 1.5rem; + margin-top: 3rem; + } + } + } + } +} From 0be5072625ba9536fa9aee25411c60377eb39e0c Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Wed, 4 Dec 2024 10:12:51 -0500 Subject: [PATCH 02/49] Update loader styles/markup --- .../importer/wordpress/upgrade-plan/index.tsx | 8 +-- .../wordpress/upgrade-plan/skeleton/index.tsx | 58 +++++++++++++++++++ .../site-migration-upgrade-plan/style.scss | 11 ++++ 3 files changed, 70 insertions(+), 7 deletions(-) diff --git a/client/blocks/importer/wordpress/upgrade-plan/index.tsx b/client/blocks/importer/wordpress/upgrade-plan/index.tsx index cecd64da4e83a..d77a8a58b7191 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/index.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/index.tsx @@ -171,13 +171,7 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = ); if ( isFetchingHostingDetails || ! pricing ) { - return ( -
- { showVariants && } - - { showVariants && } -
- ); + return ; } return ( diff --git a/client/blocks/importer/wordpress/upgrade-plan/skeleton/index.tsx b/client/blocks/importer/wordpress/upgrade-plan/skeleton/index.tsx index b0787e57bb29d..47eedb3d321e6 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/skeleton/index.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/skeleton/index.tsx @@ -6,6 +6,35 @@ export const Skeleton: FC< { showVariants: boolean } > = ( { showVariants } ) =>
+ { showVariants && ( +
+
+
+
+
+
+
+
+
+ ) }
= ( { showVariants } ) =>
) } + { showVariants && ( +
+
+
+
+
+
+
+
+
+ ) }
diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss index 1c9a82921dd19..230b1b8534aff 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss @@ -1,4 +1,15 @@ .is-step-site-migration-upgrade-plan-with-variants { + .import-upgrade-plan-skeleton { + &.import-upgrade-plan-skeleton--light-highlight { + background-color: var(--studio-wordpress-blue-50); + opacity: 0.2; + } + + &.import-upgrade-plan-skeleton--dark-highlight { + background-color: var(--studio-wordpress-blue-50); + opacity: 0.5; + } + } .import__upgrade-plan-variants-badge { background-color: var(--studio-gray-100); color: var(--color-text-inverted); From f4819c7dda827d346cbfe4720666f8c49a5e734d Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Wed, 4 Dec 2024 10:18:33 -0500 Subject: [PATCH 03/49] Fix header styles --- .../site-migration-upgrade-plan/index.tsx | 2 +- .../site-migration-upgrade-plan/style.scss | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx index d1fbcb372e434..12822b30546cb 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/index.tsx @@ -38,7 +38,7 @@ const SiteMigrationUpgradePlan: FC< Props > = ( { customizedActionButtons, ...props } ) => { - const showVariants = true; + const showVariants = true; // TODO: replace this with the flag. const { onSkip, skipLabelText, skipPosition } = props; const siteItem = useSite(); const siteSlug = useSiteSlug(); diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss index 230b1b8534aff..5ea6a9d76ea62 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss @@ -1,4 +1,15 @@ .is-step-site-migration-upgrade-plan-with-variants { + &.step-container .step-container__header { + margin-left: auto; + margin-right: auto; + padding-left: 1rem; + padding-right: 1rem; + @media ( min-width: 720px ) { + max-width: 720px; + padding-left: 0; + padding-right: 0; + } + } .import-upgrade-plan-skeleton { &.import-upgrade-plan-skeleton--light-highlight { background-color: var(--studio-wordpress-blue-50); From 7b8ca9bb45cc628ddf5abf59a403987cdbfb4b80 Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Wed, 4 Dec 2024 10:22:48 -0500 Subject: [PATCH 04/49] Remove descriptions --- .../wordpress/upgrade-plan/upgrade-plan-details.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx b/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx index 9aca56fb1a23a..e36f3503e965b 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx @@ -269,7 +269,6 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => { { translate( 'Monthly' ) } -

{ translate( 'Unlock the power of WordPress with plugins and cloud tools.' ) }

@@ -320,7 +319,9 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => { { showVariants ? translate( 'Yearly' ) : plan?.getTitle() } -

{ translate( 'Unlock the power of WordPress with plugins and cloud tools.' ) }

+ { ! showVariants && ( +

{ translate( 'Unlock the power of WordPress with plugins and cloud tools.' ) }

+ ) }
@@ -363,7 +364,6 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => { { translate( 'Biennially' ) } -

{ translate( 'Unlock the power of WordPress with plugins and cloud tools.' ) }

From cbd084679055bfbaea6f908193fa9aba3bb77ee1 Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Wed, 4 Dec 2024 10:24:13 -0500 Subject: [PATCH 05/49] Fix spacing --- .../steps-repository/site-migration-upgrade-plan/style.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss index 5ea6a9d76ea62..267e1a98bb01a 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-upgrade-plan/style.scss @@ -37,6 +37,10 @@ color: var(--color-text-subtle); } + .import__upgrade-plan .import__upgrade-plan-header .plan-title { + margin-bottom: -0.5rem; + } + .import__upgrade-plan .import__upgrade-plan-details { @media ( min-width: 1040px ) { display: flex; From 2af1e3a0f3eaae831b53f589dd46a040dd900a1f Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Wed, 4 Dec 2024 10:40:22 -0500 Subject: [PATCH 06/49] Refactor pricing --- .../importer/wordpress/upgrade-plan/index.tsx | 34 +++++++------------ .../importer/wordpress/upgrade-plan/types.ts | 4 +-- .../upgrade-plan/upgrade-plan-details.tsx | 8 ++--- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/client/blocks/importer/wordpress/upgrade-plan/index.tsx b/client/blocks/importer/wordpress/upgrade-plan/index.tsx index d77a8a58b7191..2905639455f95 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/index.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/index.tsx @@ -59,27 +59,21 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = useCheckPlanAvailabilityForPurchase, } ); - const pricing = - pricingMeta && pricingMeta[ visiblePlan ] ? pricingMeta[ visiblePlan ] : undefined; - - const pricing2Years = - pricingMeta && pricingMeta[ PLAN_BUSINESS_2_YEARS ] - ? pricingMeta[ PLAN_BUSINESS_2_YEARS ] - : undefined; - - const pricingMonthly = - pricingMeta && pricingMeta[ PLAN_BUSINESS_MONTHLY ] - ? pricingMeta[ PLAN_BUSINESS_MONTHLY ] - : undefined; + const pricing = { + [ visiblePlan ]: pricingMeta?.[ visiblePlan ], + [ PLAN_BUSINESS_2_YEARS ]: pricingMeta?.[ PLAN_BUSINESS_2_YEARS ], + [ PLAN_BUSINESS_MONTHLY ]: pricingMeta?.[ PLAN_BUSINESS_MONTHLY ], + }; const introOfferAvailable = isEnabled( 'migration-flow/introductory-offer' ) && - pricing?.introOffer && - pricing.introOffer.rawPrice && - ! pricing.introOffer.isOfferComplete && - pricing.originalPrice.monthly && - pricing.originalPrice.full && - pricing.currencyCode; + pricing[ visiblePlan ]?.introOffer && + pricing[ visiblePlan ]?.introOffer.rawPrice && + ! pricing[ visiblePlan ]?.introOffer.isOfferComplete && + pricing[ visiblePlan ]?.originalPrice && + pricing[ visiblePlan ]?.originalPrice.monthly && + pricing[ visiblePlan ]?.originalPrice.full && + pricing[ visiblePlan ]?.currencyCode; const hideFreeMigrationTrial = introOfferAvailable || @@ -170,7 +164,7 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = 'Migrations are exclusive to the Creator plan. Check out all its benefits, and upgrade to get started.' ); - if ( isFetchingHostingDetails || ! pricing ) { + if ( isFetchingHostingDetails || ! pricing[ visiblePlan ] ) { return ; } @@ -212,8 +206,6 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = ; showVariants?: boolean; onCtaClick?: ( planSlug: string ) => void; - pricing2Years?: PricingMetaForGridPlan; - pricingMonthly?: PricingMetaForGridPlan; }; export type UpgradePlanProps = { diff --git a/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx b/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx index e36f3503e965b..b81609fcc96ff 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/upgrade-plan-details.tsx @@ -211,8 +211,6 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => { const { children, pricing, - pricing2Years, - pricingMonthly, introOfferAvailable, upgradePlanHostingDetailsList, showVariants, @@ -226,19 +224,19 @@ export const UpgradePlanDetails = ( props: UpgradePlanDetailsProps ) => { const planPriceOfferProps = preparePlanPriceOfferProps( introOfferAvailable, plan, - pricing, + pricing?.[ selectedPlan ], showVariants ); const planPriceOfferPropsMonthly = preparePlanPriceOfferProps( introOfferAvailable, planMonthly, - pricingMonthly, + pricing?.[ PLAN_BUSINESS_MONTHLY ], showVariants ); const planPriceOfferProps2Years = preparePlanPriceOfferProps( introOfferAvailable, plan2Years, - pricing2Years, + pricing?.[ PLAN_BUSINESS_2_YEARS ], showVariants ); From ea003437524a712a963e699168c9682f714c4c84 Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Wed, 4 Dec 2024 10:45:23 -0500 Subject: [PATCH 07/49] Fix typing --- client/blocks/importer/wordpress/upgrade-plan/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/blocks/importer/wordpress/upgrade-plan/types.ts b/client/blocks/importer/wordpress/upgrade-plan/types.ts index 15d1af507e9d2..4767e2a32d453 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/types.ts +++ b/client/blocks/importer/wordpress/upgrade-plan/types.ts @@ -15,7 +15,7 @@ export type HostingDetails = { export type UpgradePlanDetailsProps = { children: React.ReactNode; introOfferAvailable: boolean; - pricing?: [ PricingMetaForGridPlan ]; + pricing?: { [ key: string ]: PricingMetaForGridPlan }; upgradePlanHostingDetailsList: Array< HostingDetailsItem >; showVariants?: boolean; onCtaClick?: ( planSlug: string ) => void; From e1d73487324819db2972358e57703adddbeef306 Mon Sep 17 00:00:00 2001 From: Caroline Moore Date: Wed, 4 Dec 2024 11:21:45 -0500 Subject: [PATCH 08/49] Fix checkout ctas, update wording for 2 year plan --- .../importer/wordpress/upgrade-plan/index.tsx | 9 ++++---- .../wordpress/upgrade-plan/skeleton/index.tsx | 2 +- .../upgrade-plan/upgrade-plan-details.tsx | 23 ++++++++++++++++++- .../site-migration-upgrade-plan/index.tsx | 2 +- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/client/blocks/importer/wordpress/upgrade-plan/index.tsx b/client/blocks/importer/wordpress/upgrade-plan/index.tsx index 2905639455f95..66766189b6c01 100644 --- a/client/blocks/importer/wordpress/upgrade-plan/index.tsx +++ b/client/blocks/importer/wordpress/upgrade-plan/index.tsx @@ -21,6 +21,7 @@ import UpgradePlanDetails from './upgrade-plan-details'; import './style.scss'; import withMigrationSticker from './with-migration-sticker'; import type { UpgradePlanProps } from './types'; +import type { PricingMetaForGridPlan } from '@automattic/data-stores'; export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = ( props ) => { const translate = useTranslate(); @@ -114,7 +115,7 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = if ( hideFreeMigrationTrial ) { return ( - + onCtaClick( visiblePlan ) }> { cta } ); @@ -124,7 +125,7 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = return ( <> { trialText } - @@ -133,7 +134,7 @@ export const UnwrappedUpgradePlan: React.FunctionComponent< UpgradePlanProps > = return ( <> - + onCtaClick( visiblePlan ) }> { cta }