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

Domains: Add professional email upsell route #54941

Merged
merged 12 commits into from
Jul 30, 2021

Conversation

runofthemillgeek
Copy link
Contributor

@runofthemillgeek runofthemillgeek commented Jul 27, 2021

Changes proposed in this Pull Request

This PR is the first step to proposed changes in domain purchase flow. It adds a new route for the professional email upsell page at:

http://wordpress.com/domains/add/:domain/email/:siteName

The content for this page will be added in an upcoming PR based on this one.

Side note: I referred to @daledupreez's previous approach at #50152 and @stephanethomas's work on #53712 to come up with this.

Testing instructions

  1. Run git checkout add/titan-email-upsell-route and start your server

  2. Log into a WordPress.com account that has a site

  3. Open the Domains page (replace yoursite with a site slug that you have): http://calypso.localhost:3000/domains/manage/yoursite.wordpress.com

  4. Click Add Domain button > to this site from the popover

  5. Search for a domain or choose one of the suggestions by clicking Select button

  6. Once the page loads, replace google-workspace in the domain with email. For example:
    If the URL shown is:

    http://calypso.localhost:3000/domains/add/example.in/google-workspace/example.wordpress.com
    

    replace it with:

    http://calypso.localhost:3000/domains/add/example.in/email/example.wordpress.com
    
  7. Verify that the new route loads and renders without errors

Screenshots

GOwwpLwluM

@runofthemillgeek runofthemillgeek requested a review from a team as a code owner July 27, 2021 20:06
Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

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

This is looking really good, @sangeeth96! The description and testing instructions covered pretty much everything. The only thing that may be worth adding is making it clear that the upsell content will be coming in another PR.

Other than that, I have a few small comments that you can take on. I am hoping we can get this shipped tomorrow!

const translate = useTranslate();

const handleGoBack = () => {
page( `/domains/add/${ selectedSiteSlug }` );
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 it would be better to use domainAddNew( selectedSiteSlug) from calypso/my-sites/domains/paths.js.

};

return (
<Fragment>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: The Letero team has been trying to use <> instead of Fragment or React.Fragment.
Not blocking, but a minor thing.

Copy link
Contributor Author

@runofthemillgeek runofthemillgeek Jul 29, 2021

Choose a reason for hiding this comment

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

@daledupreez I used that first, but then thought you peeps prefer to be explicit about it and changed it back anyway. 😅 But will do this. ✌️

{ translate( 'Register %(domain)s', { args: { domain } } ) }
</HeaderCake>

<PromoCard
Copy link
Contributor

Choose a reason for hiding this comment

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

As a question, is the goal to improve/expand this content in a follow-up PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@daledupreez Yes, that is indeed the goal. I've updated the PR description as you requested.

@@ -21,6 +21,7 @@ import {
import { getCurrentUser } from 'calypso/state/current-user/selectors';
import DomainSearch from './domain-search';
import SiteRedirect from './domain-search/site-redirect';
import EmailProvidersUpsell from './email-providers-upsell';
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I know this import list isn't in order, but I'd prefer that the new import not make it less ordered! Could you move this new import one line up so it's below import DomainSearch?

Copy link
Contributor Author

@runofthemillgeek runofthemillgeek Jul 29, 2021

Choose a reason for hiding this comment

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

On it. Is there an eslint config or some other editor automation folks use to automate this or is this a manual work at the moment? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh nvm, I see that work is being done on this. ❤️

@@ -212,6 +213,25 @@ const googleAppsWithRegistration = ( context, next ) => {
next();
};

const emailWithRegistration = ( context, next ) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

For full specificity and clarity, it may be better to call this emailUpsellForDomainRegistration.


<PromoCard
isPrimary
title={ translate( 'Add a professional email address to %(domainName)s', translateArgs ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we're only using translateArgs once, it may be simpler to inline the details.

@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 Jul 29, 2021
@runofthemillgeek
Copy link
Contributor Author

@daledupreez Addressed the comments. Let me know if there's more.

Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

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

I should have gotten to this earlier today! 😐

There are still two more fixes/tweaks I'd like you to add before we merge and deploy. (I was going to try and handle them myself, but I don't have permissions to push them to the talk-to repo.)

/>
<DocumentHead
title={ translate( 'Register %(domain)s', {
args: { domain: context.params.registerDomain },
Copy link
Contributor

Choose a reason for hiding this comment

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

Small bug: this should be context.params.domain - registerDomain is not defined in the main URL path as a variable.

Suggested change
args: { domain: context.params.registerDomain },
args: { domain: context.params.domain },

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, gonna fix that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

* Style dependencies
*/
import emailIllustration from 'calypso/assets/images/email-providers/email-illustration.svg';
import { domainAddNew } from '../paths';
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be under Internal dependencies and should be relative to the repo rather than the current file. (I''ll add a comment RE where to add.)

Suggested change
import { domainAddNew } from '../paths';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the change to use the repo alias.

@runofthemillgeek
Copy link
Contributor Author

I don't have permissions to push them to the talk-to repo.)

I genuinely thought PRs were editable by upstream maintainers but turns out org forks can't allow this (isaacs/github#1681).

I'll see if I can add you to the repo's collaborators list.

Copy link
Contributor

@daledupreez daledupreez left a comment

Choose a reason for hiding this comment

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

LGTM! I'll get this deployed first thing tomorrow.

Congrats on your first Calypso PR! 🎉

@daledupreez daledupreez merged commit e809331 into Automattic:trunk Jul 30, 2021
@a8ci18n
Copy link

a8ci18n commented Jul 30, 2021

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

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

@a8ci18n
Copy link

a8ci18n commented Aug 5, 2021

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
OSS Citizen [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants