-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage Add Ons: Implement dropdown checkout functionality #81340
Changes from all commits
2ecdf22
cd3088d
e924a3e
43854c3
3ed3ceb
1f52d93
df0663e
6e60b88
9d6477b
387473c
d442efd
a81d1a2
9e4b4df
e1de765
88853b2
5cb0d90
34e44e0
1fe35c4
d09c44b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -45,6 +45,7 @@ import { | |||||||||
import { ProgressState } from 'calypso/state/signup/progress/schema'; | ||||||||||
import { getSignupProgress } from 'calypso/state/signup/progress/selectors'; | ||||||||||
import { getSiteSlug } from 'calypso/state/sites/selectors'; | ||||||||||
import { getPlanCartItem } from '../cart-values/cart-items'; | ||||||||||
import type { Flow, Dependencies } from '../../signup/types'; | ||||||||||
|
||||||||||
const debug = debugModule( 'calypso:signup' ); | ||||||||||
|
@@ -442,7 +443,14 @@ export default class SignupFlowController { | |||||||||
|
||||||||||
_getNeedsToGoThroughCheckout() { | ||||||||||
const progress = getSignupDependencyProgress( this._reduxStore.getState() ); | ||||||||||
return !! progress?.plans?.cartItem; | ||||||||||
|
||||||||||
if ( ! progress?.plans?.cartItems ) { | ||||||||||
return false; | ||||||||||
} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if we really have to check whether there is a plan in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah this discussion was part of the todos I wanted to get to yesterday but didn't have time for #81340 (comment). We briefly touched on this in our chat yesterday The answer to your question is yes, and there is another check for generic That method is eventually called by filterDestination, which, like wp-calypso/client/signup/config/flows.js Lines 278 to 281 in 48ab924
I was planning to create an issue for this because it feels out of scope, and, in my opinion also seems like it might be a rabbit hole to investigate and fix now ( there's been quite a lot of those in the signup codebase ). Open to hearing your thoughts though 🙂 |
||||||||||
|
||||||||||
return ( | ||||||||||
progress.plans.cartItems.length && Boolean( getPlanCartItem( progress.plans.cartItems ) ) | ||||||||||
); | ||||||||||
} | ||||||||||
|
||||||||||
_destination( dependencies: Dependencies ): string { | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,12 +71,10 @@ export type UsePricingMetaForGridPlans = ( { | |
planSlugs, | ||
withoutProRatedCredits, | ||
storageAddOns, | ||
currencyCode, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: currencyCode was an unused argument |
||
}: { | ||
planSlugs: PlanSlug[]; | ||
withoutProRatedCredits?: boolean; | ||
storageAddOns: ( AddOnMeta | null )[] | null; | ||
currencyCode?: string | null; | ||
} ) => { [ planSlug: string ]: PricingMetaForGridPlan } | null; | ||
|
||
// TODO clk: move to types. will consume plan properties | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remove the
free_trial
property because, according to tracks registration, it's not a valid event prop forcalypso_signup_plan_select
. https://github.com/Automattic/tracks-events-registration/blob/master/events/calypso_signup_plan_select.event.jsonThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great finding! Thanks for digging deep into it. There is also a deprecation note from the backend, so I believe it's safe to remove: 31d84-pb.