Skip to content

Conversation

@moon0326
Copy link
Contributor

@moon0326 moon0326 commented Apr 27, 2023

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:

  1. Checkout this branch.
  2. Go to the core profiler (OBW)
  3. Click on Skip guided tour
  4. Confirm storeprofiler_step_view track is recorded.
  5. Select a country.
  6. Click on Go to my store button.
  7. Confirm storeprofiler_step_completed track is recorded.
  8. Loader screen should show up for 3 seconds
  9. Then you're redirected to WooCommerce Home

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.

@moon0326 moon0326 marked this pull request as draft April 27, 2023 00:48
@github-actions github-actions bot added focus: react admin [team:Ghidorah] package: @woocommerce/explat issues related to @woocommerce/explat plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Apr 27, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 27, 2023

Test Results Summary

Commit SHA: e40f5fa

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests26700202690m 54s
E2E Tests1890010019918m 51s

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.

@moon0326 moon0326 changed the base branch from trunk to add/core-profiler-welcome-woo April 27, 2023 19:03
@moon0326 moon0326 force-pushed the add/core-profiler-business-location branch from b5edbe8 to 06708fc Compare April 27, 2023 19:16
@github-actions github-actions bot removed package: @woocommerce/explat issues related to @woocommerce/explat plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Apr 27, 2023
@moon0326 moon0326 changed the title Add/core profiler business location Add Business Location page to the core profiler Apr 27, 2023
@moon0326 moon0326 requested review from chihsuan and rjchow April 27, 2023 20:20
@moon0326 moon0326 marked this pull request as ready for review April 27, 2023 20:20
@github-actions
Copy link
Contributor

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:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@github-actions
Copy link
Contributor

Hi @chihsuan, @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:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@moon0326 moon0326 marked this pull request as draft April 27, 2023 20:37
@moon0326 moon0326 marked this pull request as ready for review April 29, 2023 20:24
Copy link
Contributor

@rjchow rjchow left a 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: (
Copy link
Contributor

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 😆

Copy link
Contributor Author

@moon0326 moon0326 May 3, 2023

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?

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor Author

@moon0326 moon0326 May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjchow

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

Copy link
Contributor

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

@chihsuan chihsuan force-pushed the add/core-profiler-welcome-woo branch from 900abd1 to 547c318 Compare May 3, 2023 07:26
Base automatically changed from add/core-profiler-welcome-woo to trunk May 3, 2023 07:54
@github-actions github-actions bot added package: @woocommerce/explat issues related to @woocommerce/explat plugin: woocommerce Issues related to the WooCommerce Core plugin. labels May 3, 2023
@moon0326 moon0326 force-pushed the add/core-profiler-business-location branch from c52a3a7 to 0d04f11 Compare May 3, 2023 21:08
@github-actions github-actions bot removed the package: @woocommerce/explat issues related to @woocommerce/explat label May 3, 2023
chihsuan and others added 6 commits May 3, 2023 14:55
- 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)
rjchow
rjchow previously approved these changes May 9, 2023
Copy link
Member

@chihsuan chihsuan left a 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.

padding: 12px;
label,
input {
font-size: 13px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the default component color is #646970. I think we need to set it to Gutenberg gray 700.

/* Gutenberg/Gray 700 */

color: #757575;

Screenshot 2023-05-10 at 11 24 05

@include breakpoint( '<782px' ) {
margin-top: 52px;
margin-bottom: 40px;
h1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to set h1 font-size to 32px for mobile devices.

Screenshot 2023-05-10 at 11 33 08

And set h2's margin to 0.

Screenshot 2023-05-10 at 11 34 29

Screenshot 2023-05-10 at 11 35 08

'woocommerce'
) }
/>
<SelectControl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last thing! I found that there is a dropdown design. I think we should use the same style here though it's in "Tell us a bit about your store" section.

Screenshot 2023-05-10 at 11 40 12

Y5pUYSJPsGEud1vknUZhi8-fi-739_60446

Copy link
Contributor Author

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

Copy link
Member

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.

Screenshot 2023-05-12 at 11 22 15

Copy link
Contributor Author

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 👍

@chihsuan
Copy link
Member

Ah, also, linting is failing.

@moon0326
Copy link
Contributor Author

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 🤔

@chihsuan
Copy link
Member

@moon0326 Thanks for addressing the feedback! 💜 The lining is still failing (scss 😂 ). There is also some feedback related to the loader screen. 🙏

chihsuan

This comment was marked as duplicate.

Copy link
Member

@chihsuan chihsuan left a 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! 🚀

@chihsuan
Copy link
Member

Merge this on behalf of @moon0326 to unblock the other tasks.

@chihsuan chihsuan merged commit 0bf6859 into trunk May 14, 2023
@chihsuan chihsuan deleted the add/core-profiler-business-location branch May 14, 2023 20:56
@github-actions github-actions bot added this to the 7.8.0 milestone May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants