Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Conversation

@becdetat
Copy link
Contributor

@becdetat becdetat commented Jan 5, 2021

Fixes Automattic/wp-calypso#48420

The intent of Automattic/wp-calypso#48420 is to show a welcome modal when entering WooCommerce Admin from Calypso. Automattic/wp-calypso#48420 adds &from-calypso to the URL to WCA, and this PR handles that URL param to display the welcome modal.

Screenshots

image
edit Updated with final copy

Detailed test instructions:

  • Starting with a fresh store (or by deleting the woocommerce_task_list_welcome_modal_dismissed option), visit /wp-admin/admin.php?page=wc-admin. You should see the standard welcome modal.
  • Add &from-calypso to the URL. You should see the Calypso welcome modal.
  • Dismiss the modal
  • Refresh the page. The modal should not reappear.
  • Remove the &from-calypso from the URL. The standard welcome modal should not reappear.

@becdetat
Copy link
Contributor Author

becdetat commented Jan 5, 2021

@pmcpinto I've added in two tracks events in line with the events created by the existing welcome modal:

  • welcome_from_calypso_modal_open
  • welcome_from_calypso_modal_close

@pmcpinto
Copy link

pmcpinto commented Jan 5, 2021

@becdetat thanks for the heads up. Just a small detail, I think that we should follow the Tracks naming convention and prefix those event names with wcadmin_ eg: wcadmin_welcome_from_calypso_modal_open

@becdetat
Copy link
Contributor Author

becdetat commented Jan 5, 2021

@pmcpinto

I think that we should follow the Tracks naming convention and prefix those event names with wcadmin_

Oh, sorry, the prefix is automatically added by the tracks library so I forgot to include it. The events will be created with the prefix.

Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

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

Code looks great! I just left one comment for a particular use case where the user visits the WooCommerce store for the first time from Calypso, causing some weird things behind the scenes, see comment below.

welcomeModalDismissedHasResolved &&
! welcomeModalDismissed &&
welcomeFromCalypsoModalDismissedResolved &&
! welcomeFromCalypsoModalDismissed;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we change the last item here to ! shouldShowWelcomeFromCalypsoModal instead of ! welcomeFromCalypsoModalDismissed.
I don't know how common the case is that the user visits Woo admin for the first time coming from calypso, but this would trigger both shouldShowWelcomeModal and shouldShowWelcomeFromCalypsoModal to be true at the same time.

Actually causing a strange effect, where the welcome modal gets quickly loaded and closed, and then showing the calypso modal, as you can see from the tracks that it generated (on initial window load).
Triggering the open track for both modal's, but then immediately closing the welcome modal.
Screen Shot 2021-01-06 at 9 24 05 AM

@becdetat would it be worth in this case showing the welcome modal, but replacing the first page with the Calypso page?

Copy link
Contributor

Choose a reason for hiding this comment

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

Code looks great! I just left one comment for a particular use case where the user visits the WooCommerce store for the first time from Calypso, causing some weird things behind the scenes, see comment below.

cc @pmcpinto to see if this use case might actually happen.

Copy link

Choose a reason for hiding this comment

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

@becdetat @louwie17 if he's a brand new user he shouldn't see the modal because he never interacted with the Store UI. Makes sense? Or maybe I'm missing something here.

cc @elizaan36 for additional feedback

Copy link
Contributor

Choose a reason for hiding this comment

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

if he's a brand new user he shouldn't see the modal because he never interacted with the Store UI.

@pmcpinto which modal are you referring to here that shouldn't be shown? The calypso welcome modal or the original welcome modal (the one with 3 pages, mentioning the inbox, and performance stats).

I didn't test this with Calypso, but the way the logic is set up, is that a brand new user would only see the single page modal - Calypso welcome screen (new store management experience).

Copy link
Contributor Author

@becdetat becdetat Jan 7, 2021

Choose a reason for hiding this comment

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

@louwie17

the way the logic is set up, is that a brand new user would only see the single page modal - Calypso welcome screen (new store management experience)

that was certainly my intent. A new user from Calypso should only see the new Calypso welcome modal, and never the original welcome modal. This corresponds with @elizaan36 's design for the new Calypso welcome modal as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to clarify, the Calypso welcome modal would only be relevant for the existing Calypso users, so anyone that's been a Store user or becomes a Store user during the sunset period.

If we're talking about brand-new Store users after Store sunset, then they should see the regular multi-page welcome modal upon landing on the Home screen. That may be the logic we have, but just wanted to clarify.

Copy link

Choose a reason for hiding this comment

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

@louwie17 I'm mainly talking about what Elizabeth mentioned here:

If we're talking about brand-new Store users after Store sunset, then they should see the regular multi-page welcome modal upon landing on the Home screen. That may be the logic we have, but just wanted to clarify.

If a user signs up during the sunset period, they should also see the regular welcome modal. Makes sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

Great, thanks for the clarification everyone. I believe everything is working as expected then.
Approving this PR.

@louwie17 louwie17 added needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. and removed status: needs review labels Jan 6, 2021
@becdetat
Copy link
Contributor Author

becdetat commented Jan 7, 2021

I've updated this with the final copy

@elizaan36
Copy link
Contributor

Modal looks great! One super small thing - can we remove the period . from the headline in the modal?

@becdetat
Copy link
Contributor Author

becdetat commented Jan 7, 2021

@elizaan36

can we remove the period . from the headline in the modal?

We can, however the existing welcome modal screens all have periods in the headline so I added it for consistency. I'm happy to remove it if you want though.

@elizaan36
Copy link
Contributor

No worries, it's a really small thing. I may go on a period-removing rampage at some point.

@louwie17 louwie17 self-requested a review January 7, 2021 13:23
Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

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

After clarification, everything tested well, good to 🚢 👍
Just mentioned if you could add the PR number to the readme before merging :)

readme.txt Outdated
- Fix: Updating (non wordpress user) customer with order data
- Dev: Add documentation for filter `woocommerce_admin_pages_list` and `wc_admin_register_page` #5844
- Dev: Revert work done in #4857 for automated shipping after OBW is completed #5971
- Add: Welcome modal when coming from Calypso
Copy link
Contributor

Choose a reason for hiding this comment

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

Just add the PR number here before merging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, thanks

@becdetat becdetat merged commit 8b34c29 into main Jan 8, 2021
@becdetat becdetat deleted the add/welcome-modal-when-coming-from-calypso branch January 8, 2021 02:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs: author feedback The issue/PR needs a response from any of the parties involved in the issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store|Woo: Provide additional guidance once a Store customer starts using Woo Core

5 participants