-
Notifications
You must be signed in to change notification settings - Fork 2k
Woo installer: Add email field to address step #59970
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
Changes from all commits
629a0de
2990bb6
b2f9c66
51af260
33983db
7c096db
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 | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,6 +43,7 @@ export function getSiteSettingsSaveRequestStatus( state, siteId ) { | |||||||||||||||||||||||
| woocommerce_store_city?: string; | ||||||||||||||||||||||||
| woocommerce_store_postcode?: string; | ||||||||||||||||||||||||
| woocommerce_default_country?: string; | ||||||||||||||||||||||||
| woocommerce_onboarding_profile?: array; | ||||||||||||||||||||||||
|
Contributor
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. Hey! I was working on #72348, which resulted in Firstly, it seems like The result is that before I made changes in #72348, the return type for the getter function was "any", I think because Typescript couldn't infer the type: wp-calypso/client/signup/steps/woocommerce-install/hooks/use-site-settings/index.tsx Lines 56 to 66 in ea8bb7f
This made all the consuming code compile correctly, but once the JSDoc type gets fixed, Typescript starts inferring the correct return type. Unfortunately, the other types aren't specific enough, so I had to hardcode To fix that, I think a couple things need to happen:
Something similar to this: function get(option: typeof WOOCOMMERCE_ONBOARDING_PROFILE): OnboardingProfile;
function get( option: optionNameType ): string {
if ( updates[ option ] ) {
return updates[ option ];
}
if ( ! settings || Object.keys( settings ).length === 0 ) {
return '';
}
return settings[ option ] || '';
}unfortunately,
Contributor
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 didn't want to get into that myself, since I'm not familiar with the area. Is that something someone in this PR could take a look at?
Member
Author
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.
@noahtallen Thanks for letting us know 🙌 How urgent is this fix? Is it blocking a time-sensitive change? @daledupreez I think Serenity now owns the Woo onboarding flow, is adjusting the types here something you can pick up? Is this code still used?
Contributor
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. Nope, it's not urgent! In the worst case, we just continue not having the right types here. Since (i guess) this has been working in prod for a while, it's not a customer-facing issue. I think the code itself works correctly, it's just that the types don't quite line up. |
||||||||||||||||||||||||
| }} SiteSettingsItem | ||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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 had a look at this yesterday, was thinking instead of exposing
WOOCOMMERCE_ONBOARDING_PROFILE, exposingWOOCOMMERCE_STORE_EMAILat the hook level. Then inside the hook, conditionally managing access to the profile data. This should lead to some simple code in the hook but when trying I ran into issues with the get/update functions leveraging the const/types so that needs breaking first.Not suggesting we change this now, just dumping some thoughts in case it helps when/if we change this later.