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

Fix the styles of Jetpack Cloud Settings section #41715

Merged
merged 6 commits into from
May 5, 2020

Conversation

cleacos
Copy link
Contributor

@cleacos cleacos commented May 1, 2020

Changes proposed in this Pull Request

Fix a few styles of the Jetpack Cloud Settings section:

Asana Card: 1142395350490785-as-1173118334902107

  • Set the title font with the correct size
  • Added the expected icons for connected and disconnected server status. Align it to the center.
  • Fixed a line jump on disconnected status
  • Added loading block with pulse effect

I copied completely the RewindCredentialsForm component from Calypso to be able to change styles and the icon position. Also, this allows us to have control of the design.

Before

image

image

image

Now

Loading block:
image

The expected icons, centered:
image
image

Testing instructions

  • Apply these changes
  • Check if the design match with the expected

- Initializing block with pulse effect
- Use flex to align status block and the icon
- Use the correct icon
- Updated the font size
@cleacos cleacos added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Jetpack Cloud Anything related to the Jetpack Cloud (cloud.jetpack.com) labels May 1, 2020
@cleacos cleacos requested review from cbauerman and rcoll May 1, 2020 16:14
@cleacos cleacos self-assigned this May 1, 2020
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented May 1, 2020

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

Webpack Runtime (~71 bytes added 📈 [gzipped])

name      parsed_size           gzip_size
manifest       +291 B  (+0.2%)      +71 B  (+0.2%)

Webpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded.

App Entrypoints (~43 bytes removed 📉 [gzipped])

name        parsed_size           gzip_size
entry-main        -55 B  (-0.0%)      -43 B  (-0.0%)

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

Sections (~779 bytes added 📈 [gzipped])

name                    parsed_size           gzip_size
scan                         +674 B  (+0.4%)    +1061 B  (+2.2%)
jetpack-cloud-settings       -379 B  (-0.4%)     -274 B  (-0.9%)
signup                        -64 B  (-0.0%)       -8 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.

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.

@cleacos cleacos requested a review from a team May 1, 2020 16:17
@cleacos cleacos requested a review from enejb May 4, 2020 12:24
Copy link
Contributor

@rcanepa rcanepa left a comment

Choose a reason for hiding this comment

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

@cleacos , we have a HOC that gives you all the functionality you to make this form work. It lets you define any UI for the form without worrying about the functionality (this HOC will give you everything by prop).

Here is the component: https://github.com/Automattic/wp-calypso/blob/master/client/landing/jetpack-cloud/components/with-server-credentials-form/index.jsx

And here is an example of how you can use it: https://github.com/Automattic/wp-calypso/blob/master/client/landing/jetpack-cloud/components/server-credentials-form/index.jsx

^ Notice how we the ServerCredentialsForm is wrapped by the withServerCredentialsForm HOC.

In short, if we reuse that component, we could remove the logic part of this new form.

@cleacos
Copy link
Contributor Author

cleacos commented May 4, 2020

@rcanepa thank you for showing me the existing component. But I'll need to update that component for this case, this is for a section so we don't need the Cancel button and also I'll ask Yvonne about the design, basically about the hidden options and if the Save credentials button is okay like that.

@rcanepa
Copy link
Contributor

rcanepa commented May 4, 2020

@cleacos I don't think you need to modify anything for that reason. If you only use the withServerCredentialsForm HOC you can keep your component UI and remove the logic you copied. In other words, you need to implement your own ServerCredentialsForm (this is only UI) and wrap it with the withServerCredentialsForm HOC.

role="main"
siteId={ siteId }
labels={ {
save: translate( 'Save credentials' ),
Copy link

Choose a reason for hiding this comment

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

ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 18 times:
translate( 'Save credentials and fix' ) ES Score: 7

@cleacos cleacos requested a review from rcanepa May 4, 2020 18:33
Copy link
Contributor

@rcanepa rcanepa left a comment

Choose a reason for hiding this comment

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

LGTM!

The next iteration could include using a placeholder for the whole form while the credentials are being fetched or we could disable the inputs while that is happening.

@cleacos cleacos merged commit 8050419 into master May 5, 2020
@cleacos cleacos deleted the fix/jetpack-cloud-setting-page-design-tweak branch May 5, 2020 08:11
@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 May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jetpack Cloud Anything related to the Jetpack Cloud (cloud.jetpack.com)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants