-
Notifications
You must be signed in to change notification settings - Fork 2k
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
P2: Add pre-approved domains setting for hubs #57227
Conversation
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-20285 |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~79 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~4018 bytes added 📈 [gzipped])
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 (~164 bytes removed 📉 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
97bcac6
to
2663576
Compare
0960490
to
0aafb59
Compare
client/my-sites/site-settings/settings-p2/preapproved-domains.jsx
Outdated
Show resolved
Hide resolved
743ddfb
to
fd8bd23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good! I tested locally and it works great.
I added a couple of small non-blocking comments :)
client/my-sites/site-settings/settings-p2/preapproved-domains.jsx
Outdated
Show resolved
Hide resolved
client/my-sites/site-settings/settings-p2/preapproved-domains.jsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, Anne!
Left a few comments.
@@ -1,15 +1,27 @@ | |||
import config from '@automattic/calypso-config'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you could also import just isEnabled
like import { isEnabled } from ...
.
client/my-sites/site-settings/settings-p2/preapproved-domains.jsx
Outdated
Show resolved
Hide resolved
client/my-sites/site-settings/settings-p2/preapproved-domains.jsx
Outdated
Show resolved
Hide resolved
checked={ isToggledOn } | ||
disabled={ isRequestingSettings || isSavingSettings } | ||
onChange={ handleDomainsToggle } | ||
label={ translate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the second param is missing here (the text domain).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one does not have a text domain param.
client/my-sites/site-settings/settings-p2/preapproved-domains.jsx
Outdated
Show resolved
Hide resolved
client/my-sites/site-settings/settings-p2/preapproved-domains.jsx
Outdated
Show resolved
Hide resolved
import { getSelectedSiteId } from 'calypso/state/ui/selectors'; | ||
import wrapSettingsForm from '../wrap-settings-form'; | ||
|
||
const P2PreapprovedDomainsForm = ( props ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe subjective: do you think we could move most of the smaller helpers out of the component body? Would make scanning P2PreapprovedDomainsForm
a bit easier. In the past, we used to have stateful, class
based React components. Methods there were easy to spot or scan. Not sure about these const
components, though. I always worked only with small ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm gonna keep them inside the component as many of them use stuff from state. For consistency, I'll keep them all together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! 🎩
9ed9712
to
4d42b87
Compare
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/6991483 Thank you @annemirasol for including a screenshot in the description! This is really helpful for our translators. |
Translation for this Pull Request has now been finished. |
Changes proposed in this Pull Request
Testing instructions
Screens
Related to 3887-gh-Automattic/p2