-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Migrate Purchase task and dashboard utils to TS #37725
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
Conversation
| profileItems: ProfileItems; | ||
| taskLists: Record< string, TaskListType >; | ||
| paymentMethods: Plugin[]; | ||
| productTypes: OnboardingProductType[]; |
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.
Test Results SummaryCommit SHA: ea8ea3f
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
ab08c78 to
e929bbc
Compare
| let theme = null; | ||
| if ( onboarding && onboarding.themes ) { | ||
| theme = onboarding.themes.find( | ||
| // @ts-expect-error Ignore TS error here, as we're removing the theme step and these code from OBW in another PR. |
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.
See e863d28
|
Hi @moon0326, @adrianduffell, @woocommerce/ghidorah Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
9040f6d to
d749df1
Compare
d749df1 to
ea8ea3f
Compare
adrianduffell
left a comment
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.
This tested perfect, thanks @chihsuan! 🚀
Nice catch with the productTypes definition
ilyasfoo
left a comment
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.
Nice work, LGTM!
| */ | ||
| export function getPriceValue( string ) { | ||
| return Number( decodeEntities( string ).replace( /[^0-9.-]+/g, '' ) ); | ||
| return { |
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.
Nice touch! This feels more react-like
| generalSettings?.woocommerce_default_country | ||
| ) | ||
| ), | ||
| woocommerceTaxCountries.includes( countryCode ), |
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.
Good catch!


Submission Review Guidelines:
Changes proposed in this Pull Request:
Closes #37190.
This PR migrates the Purchase task to TS. To archive that, I migrated the
dashboard/utils.jsas well.Besides, this PR also fixes a wrong type definition (
productTypes) in@woocommerce/dataonboarding store.How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
CI should pass
Onboarding wizard > Product Typestab (/wp-admin/admin.php?page=wc-admin&path=%2Fsetup-wizard&step=product-types)MembershipsWooCommerce > HomeAdd ... product to my storetask (for example:Add Memberships and 1 more product to my store)Would you like to add the following paid features to your store now?Buy nowbutton