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

Replace overview when site is with a pending migration #95497

Merged
merged 22 commits into from
Oct 25, 2024

Conversation

renatho
Copy link
Contributor

@renatho renatho commented Oct 17, 2024

Related to #95379 and #95380

Proposed Changes

  • Extract some components from the "Hosting Features" tab, so we can reuse it.
  • It customizes the Sites overview with a button to continue the migration when it's pending.
  • The button contains a ref as hosting-migration-overview, so we can identify when the user is coming from this page.

This PR Doesn't Include

  • Disable other tabs from the menu.
  • Update the header when navigating to the site, similar to the changes we have in the listing.

@donnapep, do you think it's fine to deploy it as it is and implement these other parts in other PRs? I think one issue would be fine for both changes. I'll wait for your answer to then create the new issue, otherwise, I'll continue working on this one.

Why are these changes being made?

  • We want to offer a way for the users to continue their migration if they stopped in the middle.

Testing Instructions

Screenshots

Screenshot 2024-10-18 at 18 40 00

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

);
}

return (
<div className="hosting-features">
<div className="hosting-features__hero">
<HostingHero>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Components were extracted so that we could reuse them.

@matticbot
Copy link
Contributor

matticbot commented Oct 17, 2024

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

App Entrypoints (~160 bytes added 📈 [gzipped])

name           parsed_size           gzip_size
entry-stepper       +499 B  (+0.0%)     +160 B  (+0.0%)
entry-main          +499 B  (+0.0%)     +160 B  (+0.0%)
entry-login         +283 B  (+0.0%)     +118 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~1945 bytes removed 📉 [gzipped])

name                parsed_size           gzip_size
hosting                 +2917 B  (+0.2%)    +1297 B  (+0.3%)
hosting-features         +242 B  (+0.0%)     +199 B  (+0.1%)
site-monitoring          +133 B  (+0.0%)      +45 B  (+0.0%)
site-logs                +133 B  (+0.0%)      +45 B  (+0.0%)
settings                 +133 B  (+0.0%)      +50 B  (+0.0%)
github-deployments       +133 B  (+0.0%)      +45 B  (+0.0%)
staging-site              +95 B  (+0.0%)      +17 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 (~48 bytes added 📈 [gzipped])

name                                       parsed_size           gzip_size
async-load-calypso-layout-command-palette       +133 B  (+0.1%)      +48 B  (+0.1%)

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.

@renatho renatho changed the title Add/site overview pending migration Replace overview when site is with a pending migration Oct 17, 2024
@renatho renatho force-pushed the add/site-overview-pending-migration branch from a18a2c4 to 2150032 Compare October 18, 2024 21:10
@renatho renatho added the [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging label Oct 18, 2024
@renatho
Copy link
Contributor Author

renatho commented Oct 18, 2024

@donnapep, do you think it's fine to deploy it as it is and implement these other parts in other PRs? I think one issue would be fine for both changes. I'll wait for your answer to then create the new issue, otherwise, I'll continue working on this one.

I added the "[Status] String Freeze" because we have many new texts, so we'll delay a little to merge this anyway.

@renatho renatho marked this pull request as ready for review October 18, 2024 21:31
@renatho renatho requested a review from a team October 18, 2024 21:31
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 18, 2024
@@ -473,6 +473,7 @@
margin-top: 0;
margin-left: 0;
margin-right: 0;
margin-bottom: auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes the spacing at the bottom of the tabs.

Without this, it wasn't respecting the padding.

Screenshot 2024-10-18 at 18 32 26

@a8ci18n
Copy link

a8ci18n commented Oct 18, 2024

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

Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Thank you @renatho for including a screenshot in the description! This is really helpful for our translators.

Copy link
Member

@m1r0 m1r0 left a comment

Choose a reason for hiding this comment

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

Looks good and works as described! Thanks for splitting those components.

I've added one small non-blocker suggestion.

client/sites-dashboard/test/utils.js Outdated Show resolved Hide resolved
@donnapep
Copy link
Contributor

@renatho Could you add some additional context or screen shots of what these mean? It's a bit unclear to me.

Disable other tabs from the menu.
Update the header when navigating to the site, similar to the changes we have in the listing.

@renatho
Copy link
Contributor Author

renatho commented Oct 21, 2024

@renatho Could you add some additional context or screen shots of what these mean? It's a bit unclear to me.

@donnapep Sure! I was referring to these parts (screenshot from the design):

Screenshot 2024-10-21 at 14 09 37

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/site-overview-pending-migration on your sandbox.

@a8ci18n
Copy link

a8ci18n commented Oct 22, 2024

Translation for this Pull Request has now been finished.

@donnapep
Copy link
Contributor

@renatho Thank, I missed those subtleties. I can create an issue for adding the status to the header.

@fditrapani Can you confirm that we should disable the Hosting settings tab for pending / started migrations?

@fditrapani
Copy link
Contributor

Thanks for the ping. This looks good from the screenshots. We had some back and forth about this with Michael. I figured it made sense to keep it disabled so you can stay focused on starting your migration. I can see the other side of it that people might want to poke around so I can be convinced otherwise. What do you all think?

Comment on lines 57 to 85
if ( isFreePlan ) {
// For the flows where the checkout is after the choice.
switch ( migrationType ) {
case 'diy':
continueMigrationUrl = addQueryArgs(
{
...baseQueryArgs,
destination: 'upgrade',
how: 'myself',
},
'/setup/site-migration/site-migration-upgrade-plan'
);
break;
case 'difm':
continueMigrationUrl = addQueryArgs(
{
...baseQueryArgs,
destination: 'upgrade',
how: 'difm',
},
'/setup/site-migration/site-migration-upgrade-plan'
);
break;
default:
continueMigrationUrl = addQueryArgs(
baseQueryArgs,
'/setup/site-migration/site-migration-how-to-migrate'
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a little concern, as we're only checking if the site is on a free plan or not, in case the site is on a Personal or Premium plan, will it send the user to the credentials or how-to-migrate step instead of the pre-checkout step?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm!! Good point, @Imran92! I was thinking that in our flows users wouldn't be able to pick a Personal or Premium plan and then try to migrate, but after you said, I tested it and I could do it through the /start, buying the plan (Personal or Premium), select the intent to migrate and use the flow.

I'll update it to a different check.

Copy link
Contributor Author

@renatho renatho Oct 22, 2024

Choose a reason for hiding this comment

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

Updated the check to match what we check in the flows to see if we'll redirect the user to the upgrade plan step or not. Now it makes more sense! Thank you for reviewing and catching this!

I also took the opportunity to refactor the duplicate code.

3887d73 2da505c

Copy link
Member

Choose a reason for hiding this comment

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

@renatho can you update the unit tests as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! Fixed here: e5d856e

@donnapep
Copy link
Contributor

I figured it made sense to keep it disabled so you can stay focused on starting your migration.

I'd agree with this logic. Makes sense to keep them focused on migrating. I'll update the issue to include this.

@renatho renatho requested review from m1r0 and Imran92 October 23, 2024 15:10
@renatho
Copy link
Contributor Author

renatho commented Oct 23, 2024

@m1r0 and @Imran92, since we had some iterations after the approval, I'll wait for a new approval, okay?

case 'diy':
continueMigrationUrl = addQueryArgs(
baseQueryArgs,
'/setup/migration/migration-how-to-migrate'
Copy link
Contributor

@Imran92 Imran92 Oct 23, 2024

Choose a reason for hiding this comment

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

According to the issue, in case of migration-pending-diy sticker, the user should be taken to the site-migration-instructions step. Looks like this here is taking us to the migration-how-to-migrate step. In case it's not intentional, should we fix it?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, @Imran92! Fixed in 2de7505

Copy link
Contributor

@Imran92 Imran92 left a comment

Choose a reason for hiding this comment

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

I'm seeing a weird issue, but not sure why it's happening.

I had a site in a pending state. In the overview, section worked as expected, showing me correct button and everything relevant.

Then I changed the sticker to 'migration-completed-*'. But even after refreshing and hard-refreshing the page section many times, I still see the the migration-pending overview page.

Screen.Recording.2024-10-24.at.8.42.34.PM.mov

But apart from that, LGTM. So I'm approving. Feel free to look into the issue either separately or here.

@renatho renatho force-pushed the add/site-overview-pending-migration branch from 3b1a5e6 to 91bfc81 Compare October 24, 2024 22:57
Copy link
Contributor

@Imran92 Imran92 left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Cache gets cleared after a couple of minutes

@renatho renatho force-pushed the add/site-overview-pending-migration branch from 91bfc81 to 2e90338 Compare October 25, 2024 14:14
@renatho
Copy link
Contributor Author

renatho commented Oct 25, 2024

I just rebased to fix a conflict, so I'm doing a sanity test, and I'll wait for the tests and merge it.

@renatho renatho merged commit 06d23d9 into trunk Oct 25, 2024
11 checks passed
@renatho renatho deleted the add/site-overview-pending-migration branch October 25, 2024 14:34
@github-actions github-actions bot removed [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants