-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add Business Location page to the core profiler #38019
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
Test Results SummaryCommit SHA: e40f5fa
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. |
b5edbe8 to
06708fc
Compare
|
Hi @rjchow, 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: |
|
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: |
rjchow
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.
Thanks for working on this, it's looking good! Left some feedback.
I think it needs a rebase/update from trunk, there was the PR I merged that allows toggling of the xstate inspector from browser devtools that's not in this branch
| target: 'postSkipFlowBusinessLocation', | ||
| actions: [ | ||
| assign( { | ||
| businessInfo: ( |
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 think we still need to persist it to options 😆
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.
Looks like settingUpStore is an empty state. Could we make it into a function so we can invoke it instead? or is there a way to target settingUpStore and then move to a different state dynamically?
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.
settingUpStore is the placeholder state for the regular non-skip flow actually, I should have written a comment about that sorry!
I think we can just add it as an exit action on 'skipFlowBusinessLocation' perhaps?
Something like 'updateTrackingOption()' without the extra explat stuff
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.
exit action sounds good 👍 I'll test it out soon
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.
Updated in c6cc926
I used a new state to invoke the UpdateBusinessLocation function instead of using an action with exit. It seems that actions must be pure functions without side effects according to statelyai/xstate#268
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.
Looks good! Checked and it works correctly for me
plugins/woocommerce-admin/client/core-profiler/use-loader-stages.tsx
Outdated
Show resolved
Hide resolved
plugins/woocommerce-admin/client/core-profiler/use-loader-stages.tsx
Outdated
Show resolved
Hide resolved
plugins/woocommerce-admin/client/core-profiler/services/country.ts
Outdated
Show resolved
Hide resolved
900abd1 to
547c318
Compare
c52a3a7 to
0d04f11
Compare
- take advantage of xstate's built ins for side effects instead of useEffect/hooks - discovered that error result wasn't really handled in original useEffect - use text labels instead of inline functions so that we can decouple the implementation from the machine model - todo: can move the invoked function out elsewhere and also tests if needed (not necessary here because it's a simple call)
chihsuan
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.
Thanks for working on this! @moon0326
I found there are some design mismatches and also left some suggestions to fix the lining things.
plugins/woocommerce-admin/client/core-profiler/pages/BusinessLocation.tsx
Outdated
Show resolved
Hide resolved
plugins/woocommerce-admin/client/core-profiler/services/country.ts
Outdated
Show resolved
Hide resolved
plugins/woocommerce-admin/client/core-profiler/pages/Loader.tsx
Outdated
Show resolved
Hide resolved
plugins/woocommerce-admin/client/core-profiler/pages/Loader.tsx
Outdated
Show resolved
Hide resolved
plugins/woocommerce-admin/client/core-profiler/services/country.ts
Outdated
Show resolved
Hide resolved
…y.ts Co-authored-by: Chi-Hsuan Huang <[email protected]>
Co-authored-by: Chi-Hsuan Huang <[email protected]>
| padding: 12px; | ||
| label, | ||
| input { | ||
| font-size: 13px; |
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.
| @include breakpoint( '<782px' ) { | ||
| margin-top: 52px; | ||
| margin-bottom: 40px; | ||
| h1, |
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.
| 'woocommerce' | ||
| ) } | ||
| /> | ||
| <SelectControl |
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.
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.
Updated heading and dropdown style changes in de8f406
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.
Thanks @moon0326, it seems that we need to make it look like the below when a country is selected. However, I'm not sure if it's easy to do that. If you want, we can do it in a follow-up 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.
Yeah, let's do it in a follow up PR 👍
|
Ah, also, linting is failing. |
Thanks for the catch. Updated in 0a8f139 It seems like I need to check my local prettier config. I keep making the same lint error 🤔 |
|
@moon0326 Thanks for addressing the feedback! 💜 The lining is still failing (scss 😂 ). There is also some feedback related to the loader screen. 🙏 |
chihsuan
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.
Thank you for addressing all feedback. Looks good to me! 🚀
|
Merge this on behalf of @moon0326 to unblock the other tasks. |






Changes proposed in this Pull Request:
Closes https://github.com/woocommerce/team-ghidorah/issues/198 and [Loading] - Create a loader component#199
This PR adds Business Location page. I've also worked on [Loading] - Create a loader component#199 in this PR since the loader needs a page for testing anyway.
How to test the changes in this Pull Request:
Skip guided tourstoreprofiler_step_viewtrack is recorded.Go to my storebutton.storeprofiler_step_completedtrack is recorded.Note on the loader page:
The loader configuration used in this PR is very simple as we only wait for 3 seconds and redirect to Woo Home. For multi-stage loader configuration, see 139889d. You can also checkout demo/core-profiler-loader branch and perform the exact test instructions to see the demo.