-
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
Fixes wrong selected domain name #29824
Conversation
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 only had two minor suggestions, otherwise this works fine 👍.
if ( this.props.selectedDomainName ) { | ||
if ( | ||
this.props.selectedDomainName && | ||
getGoogleAppsSupportedDomains( [ this.props.selectedDomainName ] ).length |
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.
We could use the hasGoogleAppsSupportedDomain()
function instead.
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 don't think that helps us. Domains needs to be loaded for that. Additionally we just want to check if the domain is valid for G Suite. I think we can make this better in a refactor.
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'm not sure to understand what you mean. I was just suggesting the following change:
if (
this.props.selectedDomainName &&
hasGoogleAppsSupportedDomain( [ this.props.selectedDomainName ] )
) {
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.
ohhhhh, that works perfect.
@@ -47,7 +47,7 @@ class AddGoogleAppsCard extends React.Component { | |||
|
|||
goToAddGoogleApps = () => { | |||
page( | |||
domainManagementAddGoogleApps( this.props.selectedSite.slug, this.props.selectedSite.domain ) | |||
domainManagementAddGoogleApps( this.props.selectedSite.slug, this.props.selectedDomainName ) |
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.
We're using selectedSite.domain
in two other places in this AddGoogleAppsCard
component. Shouldn't we update them as well?
I'll address my comments, and merge it. |
This is still happening when the primary address of the site is set to the free |
Ahh, so if there is no selected site what should we display? |
This fixes the case where the primary address of the site is set to the free .wordpress.com address (not to any custom domain).
I've added a commit to retrieve and display the first domain that is eligible to G Suite. |
LGTM |
…sh-2019 * origin/master: Disable select when only one domain exiists (#29873) Tiled galleries: Disable captions (#29776) Prevent scrolling up when opening a dialog (#29832) Gutenberg: Move Shortlinks to production (#29883) Gutenlypso: add convert to blocks dialog (#29790) Gutenberg: Move Related Posts to production blocks (#29650) Analytics: fix ad-tracking issue on signup for non-gdpr countries (#29741) Update mobile phone validation module (used for 2fa) (#29740) Gutenlypso: make sure titles load on second edit (#29877) Site Picker: Change wording of /page and /block-editor to match /post (#29859) Gutenberg: update copy link in page list to be editor aware Gutenberg: use core approach of initialEdits over overridePost Gutenberg: when duplicating a post, override post content Gutenberg: update duplicate url when Gutenlypso is enabled Refactor: Replace use of key-mirror with inline code (#29857) Fixes wrong selected domain name (#29824) Turn off prettier for SASS, use stylelint instead (#29697) Gutenberg: Add copy button to Shortlinks (#29556) add a section name to the body class (#29563)
Changes proposed in this Pull Request
Testing instructions