Skip to content

Conversation

@rjchow
Copy link
Contributor

@rjchow rjchow commented Sep 12, 2022

All Submissions:

Changes proposed in this Pull Request:

Figma Design: G9vi4e286yjdzyIdg8hBb1-fi-2002%3A142047
Project Thread: pdibGW-LI-p2

How to test the changes in this Pull Request:

There are two general flows in this feature:

  1. First one which guides the user in installing JetPack and connecting their WordPress.com account
  2. Second one detects that the user already meets the above requirements and can directly proceed to sending a magic link

To test this PR, you will first need to set up a WooCommerce environment which can be reached by Jetpack and complete a full Jetpack installation.

Jurassic ninja will suffice, or using ngrok or some other form of tunnelling if you are running it locally.

Guided Jetpack Installation flow

  1. Start with a WooCommerce install that does not have Jetpack installed, and do not include it if you complete the onboarding profiler. Completing the onboarding profiler is optional and should not affect the flow.
  2. Find and click on the "Get the WooCommerce App" entry under the "Help" panel on the home screen
  3. You should see the modal appear, and it should allow you to install and connect jetpack
  4. The Jetpack installation flow should bring you out of the site to connect your WordPress.com account, and then return you back to the modal when it is complete.
  5. When you have returned to the homescreen you should be on step 2 with the correct email address shown
  6. It should allow you to click on the 'Send magic link' button, and you should receive a magic link login in your email inbox
  7. Clicking on the 'send another link' button should bring you back to the previous screen with the stepper.
NVIDIA_Share_lIDHVbIGE0.mp4

Jetpack already fulfilled flow

  1. Start with a WooCommerce install that already has Jetpack installed, or complete the onboarding profiler and install it as part of the flow. Alternatively use the same setup as the previous flow, as it already has Jetpack installed and connected
  2. Find and click on the "Get the WooCommerce App" entry under the "Help" panel on the home screen
  3. You should see the modal appear, and it should allow you to click on the 'Send magic link' button.
  4. You should receive a magic link login in your email inbox
  5. Clicking on the 'send another link' button should bring you back to the previous screen without the stepper
firefox_FDTrGTjUeQ.mp4

Other testing notes:

Jetpack can have a variety of partial installations, such as a plugin that is installed but not activated, or a plugin that is installed and activate but not connected to a WordPress.com account.

These flows should be tested if possible, they can be created by simply exiting the Jetpack installation flow at various points without completing.

These partial flows should result in the dialog showing the first flow with the guided Jetpack installation, and completing the setup.

It might also be worth testing this feature with non-admin users.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you created a changelog file for each project being changed, ie pnpm changelog add --filter=<project>?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@github-actions github-actions bot added focus: react admin package: @woocommerce/components issues related to @woocommerce/components package: @woocommerce/data issues related to @woocommerce/data plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Sep 12, 2022
@rjchow rjchow requested a review from a team September 12, 2022 08:36
@rjchow rjchow marked this pull request as ready for review September 12, 2022 08:41
@github-actions
Copy link
Contributor

github-actions bot commented Sep 12, 2022

Test Results Summary

Commit SHA: 0e6fe2a

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests11800201200m 40s
E2E Tests185101018717m 55s
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.

@ilyasfoo ilyasfoo requested a review from a team September 13, 2022 02:55
Copy link
Contributor

@ilyasfoo ilyasfoo left a comment

Choose a reason for hiding this comment

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

Note: This isn't a full review yet, I'm sending earlier so they can be addressed first.

  1. Nitpicky, but the email part isn't centered vertically:

image

  1. The design looks tad different after I'm connected & refreshed the page (i.e: The stepper numbers on the side, the step #1 for connected user), I'm not sure if this is intentional?

image

image

  1. It seems when successfully sending an email, there was no toast message saying "Magic link sent!"

  2. Tracks were not implemented, but I think it's better to create an issue and implement as a follow-up

@rjchow
Copy link
Contributor Author

rjchow commented Sep 13, 2022

@ilyasfoo

  1. Addressed! Forgot to subtract the padding from the parent when I put in the numbers - it should match the design now
  2. This is according to the design, it took a bit of mental gymnastics to figure out how to structure the code to have two different return destinations 😅 I figured Jarek was considering the continuity and consistency for the user since it's a bit of a round trip. And at the same time to minimize the clicks / visual noise for someone who's already done it before
  3. Yup I left that out for now, I'll add it in another PR if there's time before the code freeze
  4. Tracks will be added soon!

@rjchow rjchow force-pushed the add/mobile-app-welcome branch from 4de4137 to 24f7021 Compare September 13, 2022 04:12
@ilyasfoo
Copy link
Contributor

ilyasfoo commented Sep 13, 2022

@rjchow Thanks for addressing!

  1. Actually, I can't see the difference, it's still slightly skewed towards bottom (I visualise center as the red crossair):

image

  1. Ah, gotcha!

  2. Alright 👍

  3. I'll make an issue soon to detail on the track names and props

@chihsuan chihsuan self-requested a review September 13, 2022 06:59
@ilyasfoo
Copy link
Contributor

@rjchow Tracks issue has been created 76-gh-woocommerce/team-ghidorah

Add backend and demo flow

added jetpack installation and activation logic
Added resolver for jetpack connection data
Add request for magic link

Switch to XMLRPC for magic link request

Instead of dealing with the OAuth request, which requires a client ID
and a public "secret", which can take a page from the Jetpack playbook
for requesting the magic login email. This changeset is lifted almost
entirely from here:

https://github.com/Automattic/jetpack/blob/ea3bde0e92c6953578745d6cd026f62ecf35b17b/projects/plugins/jetpack/_inc/lib/class.core-rest-api-endpoints.php#L4074-L4105

Note the only difference from the Jetpack version is that we're adding
an `app` parameter to the request and specifying `woocommerce`. This
won't actually do anything until some changes get made on the wpcom side
to accommodate this new parameter (I'm still working on that). Once
those changes are in place, though, the email that gets sent will be
Woo-branded and may even be able to include a QR code.

add: moved feature to woo mobile app welcome page

wip

wip

wip

wip
@rjchow rjchow force-pushed the add/mobile-app-welcome branch from 2953a65 to af22254 Compare September 14, 2022 04:29
@chihsuan
Copy link
Member

@rjchow I couldn't get the email on my JN site with the error Sorry, there was an error trying to request for a magic link. Anything I missed? 🤔

Screen.Recording.2022-09-14.at.14.14.38.mov

And I also found some small design mismatches, but I think it's okay if you want to update them in a follow-up PR.

Untitled2
Untitled
Untitled3

@chihsuan
Copy link
Member

@rjchow I couldn't get the email on my JN site with the error Sorry, there was an error trying to request for a magic link. Anything I missed? 🤔

I just printed out the error message.

[14-Sep-2022 06:53:29 UTC] Jetpack: [unauthorized_user] User is not able to use login link via email.

@rjchow
Copy link
Contributor Author

rjchow commented Sep 14, 2022

@chihsuan Thanks for the re-review!

Some of the font differences are because the font-family itself is different so I picked values which looked closer to the design instead of the exact same ones.

I think the sparkle icon depends on your OS actually, it's a copy paste from the Figma and it's an emoji 🤣

Things I missed:

  • Link to Jetpack
  • Bold Sign into app text
  • Bold email
  • Stepper outline (actually I assumed it would be difficult to change this but now I'm thinking I can override it with CSS)
    If it's ok, I will address these in a follow up?

@chihsuan
Copy link
Member

@chihsuan Thanks for the re-review!

Some of the font differences are because the font-family itself is different so I picked values which looked closer to the design instead of the exact same ones.

I think the sparkle icon depends on your OS actually, it's a copy paste from the Figma and it's an emoji 🤣

Things I missed:

  • Link to Jetpack
  • Bold Sign into app text
  • Bold email
  • Stepper outline (actually I assumed it would be difficult to change this but now I'm thinking I can override it with CSS)
    If it's ok, I will address these in a follow up?

Sounds good!

chihsuan
chihsuan previously approved these changes Sep 14, 2022
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.

@rjchow Thanks for working on this. Excellent work! 🚀

@jarekmorawski
Copy link

Everything looks good! I do agree that the send email part should be centered vertically in the white space. In the Figma file, I duplicated the bottom part (Didn't get it?) and put it above the illustration and heading part with 0% opacity. This way, I didn't have to calculate the exact margins and padding, so maybe we could do something similar here? 🤔

Other than that, is it expected for Jetpack to install this long? It took almost 30 seconds to display the connection screen in your video. If that's how it always is, I think we should add one more sentence at the end of the step description. I marked it in bold below.

To get started, install Jetpack—our free tool required to sync your store with the WooCommerce mobile app. It may take up to 30 seconds.

@github-actions
Copy link
Contributor

New hook, template, or database changes in this PR

Template changes:

  • file: /plugins/woocommerce/templates/emails/email-mobile-messaging.php
    • WARNING: This template may require a version bump!

@github-actions github-actions bot added the release: highlight Issues that have a high user impact and need to be discussed/paid attention to. label Sep 15, 2022
@rjchow rjchow merged commit 6e2ada3 into trunk Sep 15, 2022
@rjchow rjchow deleted the add/mobile-app-welcome branch September 15, 2022 03:58
@github-actions github-actions bot added this to the 7.0.0 milestone Sep 15, 2022
@github-actions
Copy link
Contributor

Hi @rjchow, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the release: add testing instructions label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: @woocommerce/components issues related to @woocommerce/components package: @woocommerce/data issues related to @woocommerce/data plugin: woocommerce Issues related to the WooCommerce Core plugin. release: highlight Issues that have a high user impact and need to be discussed/paid attention to.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants