Skip to content
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

Implement new “site cannot be accessed” flow #42682

Merged
merged 25 commits into from Jun 12, 2020

Conversation

delan
Copy link
Contributor

@delan delan commented May 27, 2020

Changes proposed

This pull request implements the new call-to-action and flow for the “site cannot be accessed” indicator on non-Atomic sites (as described in this internal post).

On such sites, the CTA changes to “I’d like to fix this now”, and it points to a new page that replaces the disconnect survey with some options that are more helpful for the situation. The indicator on Atomic sites and the disconnect button on the Manage Connection page remain unchanged.

There are some differences between these changes and the design, as well as some known problems, so I’ve added comments for them below. Let me know if these changes need any automated tests.

Testing instructions

1. Site indicator
  1. Open this branch on calypso.live, click My Sites, then click Switch Site if necessary
  2. If you have any Atomic Jetpack sites with the red exclamation mark, click that icon, verify that the call-to-action reads Remove Site, click that link, then go to step 2.3
  3. If you have any non-Atomic Jetpack sites with the red exclamation mark, click that icon, verify that the call-to-action reads I’d like to fix this now, click that link, then go to step 3.3
2. Old page
  1. Open this branch on calypso.live, click My Sites, then click Switch Site if necessary
  2. Click any Jetpack site, go to Manage > Settings > Manage your connection, then click Disconnect from Wordpress.com
  3. Verify that you see the old disconnect survey, then click Skip for now
  4. Verify that you see the Confirm Disconnection page, then click Back
  5. Verify that you see the old disconnect survey
3. New page
  1. Open this branch on calypso.live, click My Sites, then click Switch Site if necessary
  2. Click any Jetpack site, go to Manage > Settings > Manage your connection > Disconnect from Wordpress.com, then append ?type=down to the end of your URL
  3. Verify that you see the new page, then click Confirm your site is loading
  4. Verify that the site opens in a new tab or window, close it, then click Troubleshoot Jetpack
  5. Verify that the Fixing Jetpack Connection Issues page opens in the same tab or window, go back, then click Disconnect Jetpack
  6. Verify that you see the Confirm Disconnection page, then click Back
  7. Verify that you see the new page

Screenshots

@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented May 27, 2020

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~2078 bytes added 📈 [gzipped])

name                    parsed_size           gzip_size
settings                    +2974 B  (+0.7%)     +758 B  (+0.6%)
zoninator                     +17 B  (+0.0%)      +24 B  (+0.0%)
wp-super-cache                +17 B  (+0.0%)      +24 B  (+0.0%)
woocommerce                   +17 B  (+0.0%)      +24 B  (+0.0%)
themes                        +17 B  (+0.0%)      +24 B  (+0.0%)
theme                         +17 B  (+0.0%)      +24 B  (+0.0%)
stats                         +17 B  (+0.0%)      +24 B  (+0.0%)
sites                         +17 B  (+0.0%)      +24 B  (+0.1%)
site-blocks                   +17 B  (+0.0%)      +24 B  (+0.0%)
settings-writing              +17 B  (+0.0%)      +24 B  (+0.0%)
settings-security             +17 B  (+0.0%)      +24 B  (+0.0%)
settings-performance          +17 B  (+0.0%)      +24 B  (+0.0%)
settings-jetpack              +17 B  (+0.0%)      +24 B  (+0.0%)
settings-discussion           +17 B  (+0.0%)      +24 B  (+0.1%)
sensei                        +17 B  (+0.0%)      +24 B  (+0.1%)
security                      +17 B  (+0.0%)      +24 B  (+0.0%)
scan                          +17 B  (+0.0%)      +24 B  (+0.0%)
reader                        +17 B  (+0.0%)      +24 B  (+0.0%)
purchases                     +17 B  (+0.0%)      +24 B  (+0.0%)
privacy                       +17 B  (+0.0%)      +24 B  (+0.0%)
preview                       +17 B  (+0.0%)      +24 B  (+0.1%)
posts-custom                  +17 B  (+0.0%)      +24 B  (+0.0%)
posts                         +17 B  (+0.0%)      +24 B  (+0.0%)
post-editor                   +17 B  (+0.0%)      +24 B  (+0.0%)
plugins                       +17 B  (+0.0%)      +24 B  (+0.0%)
plans                         +17 B  (+0.0%)      +24 B  (+0.0%)
people                        +17 B  (+0.0%)      +24 B  (+0.0%)
pages                         +17 B  (+0.0%)      +24 B  (+0.0%)
notification-settings         +17 B  (+0.0%)      +24 B  (+0.0%)
migrate                       +17 B  (+0.0%)      +24 B  (+0.1%)
media                         +17 B  (+0.0%)      +24 B  (+0.0%)
me                            +17 B  (+0.0%)      +24 B  (+0.0%)
marketing                     +17 B  (+0.0%)      +24 B  (+0.0%)
jetpack-connect               +17 B  (+0.0%)      +24 B  (+0.0%)
jetpack-cloud-settings        +17 B  (+0.0%)      +24 B  (+0.1%)
import                        +17 B  (+0.0%)      +24 B  (+0.0%)
hosting                       +17 B  (+0.0%)      +24 B  (+0.0%)
home                          +17 B  (+0.0%)      +24 B  (+0.0%)
help                          +17 B  (+0.0%)      +24 B  (+0.0%)
hello-dolly                   +17 B  (+0.0%)      +24 B  (+0.1%)
happychat                     +17 B  (+0.0%)      +24 B  (+0.0%)
gutenberg-editor              +17 B  (+0.0%)      +24 B  (+0.0%)
google-my-business            +17 B  (+0.0%)      +24 B  (+0.0%)
feature-upsell                +17 B  (+0.0%)      +24 B  (+0.1%)
export                        +17 B  (+0.0%)      +24 B  (+0.0%)
email                         +17 B  (+0.0%)      +24 B  (+0.0%)
earn                          +17 B  (+0.0%)      +24 B  (+0.0%)
domains                       +17 B  (+0.0%)      +24 B  (+0.0%)
customize                     +17 B  (+0.0%)      +24 B  (+0.0%)
concierge                     +17 B  (+0.0%)      +24 B  (+0.0%)
comments                      +17 B  (+0.0%)      +24 B  (+0.0%)
checkout                      +17 B  (+0.0%)      +24 B  (+0.0%)
backup                        +17 B  (+0.0%)      +24 B  (+0.0%)
activity                      +17 B  (+0.0%)      +24 B  (+0.0%)
account-close                 +17 B  (+0.0%)      +24 B  (+0.0%)
account                       +17 B  (+0.0%)      +24 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~120 bytes added 📈 [gzipped])

name                                         parsed_size           gzip_size
async-load-signup-steps-site-picker                +17 B  (+0.0%)      +24 B  (+0.2%)
async-load-design-blocks                           +17 B  (+0.0%)      +24 B  (+0.0%)
async-load-components-web-preview-component        +17 B  (+0.0%)      +24 B  (+0.0%)
async-load-components-sites-popover                +17 B  (+0.0%)      +24 B  (+0.1%)
async-load-blocks-inline-help-popover              +17 B  (+0.0%)      +24 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@delan delan force-pushed the add/site-cannot-be-accessed-flow branch from 6f3937d to fb1a342 Compare May 27, 2020 11:33
@delan delan force-pushed the add/site-cannot-be-accessed-flow branch from af12044 to 6b4e178 Compare May 27, 2020 12:46
client/my-sites/site-settings/disconnect-site/style.scss Outdated Show resolved Hide resolved
client/my-sites/site-settings/disconnect-site/index.jsx Outdated Show resolved Hide resolved
Comment on lines 73 to 80
<FormattedHeader
isSecondary
align="left"
headerText={ translate( 'Confirm your site is loading' ) }
subHeaderText={ translate(
'As a first step, we suggest trying to open your site to ensure it’s loading correctly.'
) }
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i’ve used FormattedHeader here because CardHeading yields uneven spacing that’s annoying to fix, and i didn’t find a more appropriate component than those

client/my-sites/site-settings/disconnect-site/index.jsx Outdated Show resolved Hide resolved
site: { name: siteName, URL: siteUrl },
translate,
} ) => {
const confirmHref = `/settings/disconnect-site/confirm/${ siteSlug }?type=down`;

let backHref = '/settings/manage-connection/' + siteSlug;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bug: the Back buttons on both old and new pages always take you back to Manage Connection (don’t worry about the reason branch below, it looks like a red herring), but if you used the CTA, that’s not necessarily where you came from

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should i make this onClick history.back + preventDefault and keep the href as a fallback, or is there a way to get the previous URL out of the router and set href to that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would be pretty cool if we can actually make it go back in history rather than dropping them in the Manage Connection page. Even though they won't be able to do much since the connection is broken, it would be nice that all the <- Back links would behave in an expectable way.

Copy link
Member

Choose a reason for hiding this comment

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

A simple

import page from 'page';
page.back();

should be enough to go back.

Or window.history.back(). The difference is that page.back() will never navigate out of Calypso (i.e., to another page that was previously opened in the same tab.

If you want to construct a full <a href="..."/> with a valid link, then the getPreviousRoute( state ) Redux selector will return the previous URL.

All of the above will work only if there is some navigation history to work with. If you got to the page by opening a direct link (from email, from chat, ...), clicking on the "back" arrow will do nothing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wow there are more options than i realised, and we could combine them in several ways, plus there’s also the question of whether this NavigationLink should go back through history (enabling the browser forward button) or push forward to a new history entry… does calypso have a convention i can defer to here?

Copy link
Member

Choose a reason for hiding this comment

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

does calypso have a convention i can defer to here?

I don't think so. Each of the techniques I described is used at least once in the codebase. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

child laughing then crying

@delan delan marked this pull request as ready for review May 28, 2020 11:56
@delan delan added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 28, 2020
@keoshi keoshi added the [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR label May 28, 2020
@keoshi keoshi requested a review from a team May 28, 2020 12:05
@sirreal sirreal requested review from sirreal and a team May 28, 2020 13:00
Copy link
Contributor

@keoshi keoshi left a comment

Choose a reason for hiding this comment

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

First off, thanks for rocking this PR out so quickly and efficiently, @delan ! Awesome work. Thank you for all your suggestions too!

image

This is looking really good to me, and only have a few notes:

  • Design-wise, your color and styling changes make total sense to me.
  • After testing this out, noticed that the copy at the top had the potential to be slightly confusing. Added a quick suggestion and also want to loop in @Automattic/editorial to ask for a quick validation on what we have here.
  • I still have some questions about what options should open in new tabs and consequently what icons we should have there. Curious to know what others think about this, but it shouldn't hold us back. Let's ship and iterate afterwards.
  • Mobile: the note at the bottom doesn't have any padding, stretching out to the edges of the frame (image 1).
  • Mobile: I believe this might be the first time we're adding icons like this, so the margins on smaller screens look weird. On image 2 I added margin-left: 0 to .disconnect-site__actions .card .formatted-header.
  • Kudos for using real apostrophes! 🙌

Really awesome job, thanks for making this happen!

Image 1

image

Image 2

Before After
image image

client/my-sites/site-settings/disconnect-site/index.jsx Outdated Show resolved Hide resolved
Copy link
Member

@sirreal sirreal left a comment

Choose a reason for hiding this comment

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

I've inspected the code and I don't see any blocking issues. Nice attention to detail 👍

{ translate( 'Remove Site' ) }
{ siteIsAutomatedTransfer
? translate( 'Remove Site' )
: translate( 'I’d like to fix this now' ) }
Copy link
Member

Choose a reason for hiding this comment

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

Nice punctuation!


const backHref =
`/settings/disconnect-site/${ siteSlug }` +
( type ? `?type=${ encodeURIComponent( type ) }` : '' );
Copy link
Member

Choose a reason for hiding this comment

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

Nice use of encodeURIComponent on the type variable 👍

client/my-sites/site-settings/disconnect-site/index.jsx Outdated Show resolved Hide resolved
@keoshi keoshi removed the [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR label May 29, 2020
client/my-sites/site-indicator/index.jsx Outdated Show resolved Hide resolved
client/my-sites/site-indicator/index.jsx Outdated Show resolved Hide resolved
client/my-sites/site-settings/disconnect-site/index.jsx Outdated Show resolved Hide resolved
site: { name: siteName, URL: siteUrl },
translate,
} ) => {
const confirmHref = `/settings/disconnect-site/confirm/${ siteSlug }?type=down`;

let backHref = '/settings/manage-connection/' + siteSlug;
Copy link
Member

Choose a reason for hiding this comment

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

A simple

import page from 'page';
page.back();

should be enough to go back.

Or window.history.back(). The difference is that page.back() will never navigate out of Calypso (i.e., to another page that was previously opened in the same tab.

If you want to construct a full <a href="..."/> with a valid link, then the getPreviousRoute( state ) Redux selector will return the previous URL.

All of the above will work only if there is some navigation history to work with. If you got to the page by opening a direct link (from email, from chat, ...), clicking on the "back" arrow will do nothing.

@sirreal sirreal added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Jetpack and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 29, 2020
Copy link
Member

@sirreal sirreal left a comment

Choose a reason for hiding this comment

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

@jsnajdr has left some good suggestions that would be nice to address. As far as I can tell this is working well.

I've done some smoke testing and things work well.

  • I'm not sure how to get a disconnected Atomic site so did not test any of those flows.
  • Atomic sites are redirected away from /settings/disconnect-site.
  • Simple sites are redirected away from /settings/disconnect-site.
  • The disconnected Jetpack flows worked well in my testing.

Two experience notes:

  • If a Jetpack site is properly connected, there's no indication of that in the disconnect site view. This is an edge case and may not be worth addressing in this iteration, but an indication when a site appears to be properly connected would be nice.
  • The only support option seems to be a link to a documentation page. Even for sites with a page plan, an opportunity to contact Happiness seems to be missing.

@delan
Copy link
Contributor Author

delan commented Jun 9, 2020

Thanks for the feedback everyone! Once the PR is good to go and the builds are green, could someone please help me with the deployment side of things (maybe @sirreal or @jsnajdr)?

@delan delan requested review from jsnajdr and sirreal June 9, 2020 08:27
@keoshi
Copy link
Contributor

keoshi commented Jun 9, 2020

Thanks for all those changes, @delan !

One question that popped in my head when looking at this was if it would be possible to add tracking to the different options before merging this PR?

@delan
Copy link
Contributor Author

delan commented Jun 10, 2020

One question that popped in my head when looking at this was if it would be possible to add tracking to the different options before merging this PR?

Done in f37a7cc!

@keoshi
Copy link
Contributor

keoshi commented Jun 10, 2020

You're the best, @delan !! 🙌

@sirreal sirreal added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jun 10, 2020
@sirreal
Copy link
Member

sirreal commented Jun 10, 2020

Thanks for the feedback everyone! Once the PR is good to go and the builds are green, could someone please help me with the deployment side of things (maybe @sirreal or @jsnajdr)?

Documentation on the deployment process: PCYsg-5XR-p2

Feel free to reach out to me when you're ready and I'll help with the deployment 👍

@nsakaimbo nsakaimbo self-requested a review June 10, 2020 15:15
Copy link
Contributor

@nsakaimbo nsakaimbo left a comment

Choose a reason for hiding this comment

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

👋 Hi, @delan! If it isn't already, could you please rebase this branch on latest Calypso master prior to merging? There were some fixes merged a couple days ago that got ci/wp-desktop tests working again (after a long series of breakages). The tests should be passing now, and we're just trying to be pro-active about making sure tests are ✅ before merging new changes.

@delan
Copy link
Contributor Author

delan commented Jun 11, 2020

@nsakaimbo Thanks for the heads up! ci/wp-desktop is now green on this branch.

@delan delan requested a review from nsakaimbo June 11, 2020 09:56
Copy link
Member

@jsnajdr jsnajdr left a comment

Choose a reason for hiding this comment

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

Seems that all issues were addressed. Thank you for working on this!

@sirreal sirreal added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jun 11, 2020
@sirreal sirreal dismissed nsakaimbo’s stale review June 11, 2020 16:39

Test is no longer failing.

@delan delan merged commit d547130 into master Jun 12, 2020
@delan delan deleted the add/site-cannot-be-accessed-flow branch June 12, 2020 07:25
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 12, 2020
@a8ci18n
Copy link

a8ci18n commented Jun 12, 2020

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/3815855

Hi @delan, could you please edit the description of this PR and add a screenshot for our translators? Ideally it'd include all of the following strings:

  • I’d like to fix this now
  • Your site, {{strong}}%(siteName)s{{/strong}}, cannot be accessed
  • Jetpack wasn’t able to connect to {{strong}}%(siteSlug)s{{/strong}}.{{br/}}Let’s figure out why — there are a few things to try.
  • Confirm that your site loads
  • Visit your site to make sure it loads properly. If there’s an issue, fix your site before worrying about Jetpack! That may resolve this error.
  • Troubleshoot Jetpack
  • If you’re no longer using Jetpack and/or WordPress for your site, or you’ve taken your site down, it’s time to disconnect Jetpack.
  • Note: You may be seeing this error because you don’t have admin permissions for this site.{{br/}}If you think you should, contact your site administrator.
  • If your site is loading but you’re still seeing this error, this guide will help you troubleshoot the Jetpack connection.

Thank you in advance!

@a8ci18n
Copy link

a8ci18n commented Aug 4, 2020

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants