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

Bulk Domain Transfer: Improve domain form #79300

Merged
merged 16 commits into from
Jul 13, 2023

Conversation

escapemanuele
Copy link
Contributor

@escapemanuele escapemanuele commented Jul 12, 2023

Designs

Changes

  • Column for price
  • Fixed authorization code error message
  • Changed copy
  • Popover
  • Total price

Testing

  1. Live link
  2. Reach setup/domain-transfer/domains
  3. Test the step

@github-actions
Copy link

github-actions bot commented Jul 12, 2023

@matticbot
Copy link
Contributor

matticbot commented Jul 12, 2023

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

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

name           parsed_size           gzip_size
entry-stepper       +233 B  (+0.0%)      +55 B  (+0.0%)

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

Sections (~52 bytes added 📈 [gzipped])

name             parsed_size           gzip_size
subscribers           +233 B  (+0.1%)      +52 B  (+0.0%)
sites-dashboard       +233 B  (+0.1%)      +52 B  (+0.0%)
settings              +233 B  (+0.0%)      +52 B  (+0.0%)
hosting               +233 B  (+0.0%)      +52 B  (+0.0%)
home                  +233 B  (+0.0%)      +52 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 (~52 bytes added 📈 [gzipped])

name               parsed_size           gzip_size
async-load-design       +233 B  (+0.0%)      +52 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.

@escapemanuele escapemanuele marked this pull request as ready for review July 12, 2023 17:58
@escapemanuele escapemanuele requested a review from a team July 13, 2023 10:45
@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 13, 2023
@escapemanuele escapemanuele added this to In progress in Vertex Team Board via automation Jul 13, 2023
@escapemanuele escapemanuele self-assigned this Jul 13, 2023
return <div className="domains__domain-price-number disabled">$0</div>;
}

if ( ! saleCost && saleCost !== 0 ) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if ( ! saleCost && saleCost !== 0 ) {
if ( saleCost === 0 ) {

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 thought about this, but what about sales that are not zero but half the price? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

You're right. Bad suggestion.

const { __ } = useI18n();

if ( ! rawPrice ) {
return <div className="domains__domain-price-number disabled">$0</div>;
Copy link
Member

Choose a reason for hiding this comment

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

We should probably call formatCurrency on the zero.

@escapemanuele escapemanuele force-pushed the bulk-domain/domain-form-pricing branch from 8fa0f93 to 7672fde Compare July 13, 2023 16:29
@escapemanuele escapemanuele moved this from In progress to Needs review in Vertex Team Board Jul 13, 2023
Copy link
Member

@alshakero alshakero left a comment

Choose a reason for hiding this comment

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

Amazing work. This has been much harder than it seems. Left some comments.

Comment on lines 95 to 101
const totalPrice = Object.values( domainsState ).reduce( ( total, currentDomain ) => {
if ( currentDomain.saleCost ) {
return total + currentDomain.saleCost;
}

return total + currentDomain.rawPrice;
}, 0 );
Copy link
Member

Choose a reason for hiding this comment

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

This probably should be a function outside the component, takes the state and gives a formatted price with a correct currency. I.e shouldn't be locked to USD.

if ( ! rawPrice ) {
return (
<div className="domains__domain-price-number disabled">
{ formatCurrency( 0, currencyCode, { stripZeros: true } ) }
Copy link
Member

Choose a reason for hiding this comment

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

I just realized that we don't need currency for the zero, 0 is enough, but not $0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok! Do you mean just having
<div className="domains__domain-price-number disabled">0</div>
right?

Copy link
Member

Choose a reason for hiding this comment

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

Yes!

@@ -107,6 +129,9 @@ const Domains: React.FC< Props > = ( { onSubmit } ) => {
domain: '',
auth: '',
valid: false,
rawPrice: 0,
saleCost: undefined,
currencyCode: 'USD',
Copy link
Member

Choose a reason for hiding this comment

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

Should be undefined.

@@ -143,6 +168,10 @@ const Domains: React.FC< Props > = ( { onSubmit } ) => {
{ __( 'Add another domain' ) }
</Button>
) }
<div className="bulk-domain-transfer__total-price">
<div>{ __( 'Total' ) }</div>
<div>{ formatCurrency( totalPrice, 'USD', { stripZeros: true } ) }</div>
Copy link
Member

Choose a reason for hiding this comment

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

Should be covered by the function I mention above.

@escapemanuele
Copy link
Contributor Author

Thank you @alshakero, I think I addressed all your feedback!

Copy link
Member

@alshakero alshakero left a comment

Choose a reason for hiding this comment

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

Pushed some changes and it looks great now!

Copy link
Member

@alshakero alshakero left a comment

Choose a reason for hiding this comment

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

Pushed some changes and it looks great now!

@escapemanuele escapemanuele merged commit 33e74ea into trunk Jul 13, 2023
18 checks passed
Vertex Team Board automation moved this from Needs review to Done Jul 13, 2023
@escapemanuele escapemanuele deleted the bulk-domain/domain-form-pricing branch July 13, 2023 18:56
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 13, 2023
@a8ci18n
Copy link

a8ci18n commented Jul 13, 2023

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

Hi @escapemanuele, 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:

  • Unique code proving ownership, needed for secure domain transfer between registrars.
  • Add your domains

Thank you in advance!

@cometgrrl
Copy link
Contributor

Minor copy feedback:
“Add as little or as many”
I think “few” goes with “many” (silly, but English is :weird: like that)
Text wrapping is not great. Maybe putting the second sentence on a new line?
SCR-20230713-kvbk

@cometgrrl
Copy link
Contributor

From the checkout screen, the back button used to go to /setup/domain-transfer/domains, and now it goes to /start/domains, which seems wrong.

@john-legg
Copy link
Contributor

This is great work! While I was testing, I noticed that the width of the Price column is a bit wide. The link to the designs doesn't seem to work for me, so I don't know if this is intentional or not, but I just wanted to point it out. It's more noticeable when there's multiple domain rows.

Screenshot 2023-07-13 at 5 59 34 PM

@escapemanuele
Copy link
Contributor Author

escapemanuele commented Jul 14, 2023

Hey @john-legg, thanks for the feedback. I gave the price column some space to accomodate for this:

image

The First year free is taking some space.
This is from the designs:

image

I'll try to remove some space 😄

@karenroldan
Copy link
Contributor

Hi, @escapemanuele!

issue (ux,non-blocking): There is a dollar sign on the price per domain based on Figma. But, right now, it only shows 0
Ha4o4U.png

@escapemanuele
Copy link
Contributor Author

Thank you @karenroldan, we'll try to address this!

@a8ci18n
Copy link

a8ci18n commented Jul 20, 2023

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
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants