diff --git a/client/components/inline-support-link/context-links.js b/client/components/inline-support-link/context-links.js index 3cf7996d30e95..b415f65240901 100644 --- a/client/components/inline-support-link/context-links.js +++ b/client/components/inline-support-link/context-links.js @@ -187,6 +187,10 @@ const contextLinks = { link: 'https://wordpress.com/support/menus/', post_id: 59580, }, + nameservers: { + link: 'https://wordpress.com/support/domains/change-name-servers/#changing-name-servers-to-point-to-word-press-com', + post_id: 41383, + }, pages: { link: 'https://wordpress.com/support/pages/', post_id: 86, diff --git a/client/my-sites/domains/domain-management/dns/dns-records.jsx b/client/my-sites/domains/domain-management/dns/dns-records.jsx index 3642c337827e0..e108be3a6b34a 100644 --- a/client/my-sites/domains/domain-management/dns/dns-records.jsx +++ b/client/my-sites/domains/domain-management/dns/dns-records.jsx @@ -186,7 +186,63 @@ class DnsRecords extends Component { } ); }; - renderNotice = () => { + renderDefaultARecordsNotice = () => { + const { translate } = this.props; + + if ( ! this.hasWpcomNameservers() ) { + return null; + } + + if ( this.hasDefaultARecords() ) { + return null; + } + + return ( +
+ +
+ { translate( + 'Your domain is not using default A records. This means it may not be pointing to your WordPress.com site correctly. To restore default A records, click on the three dots menu and select "Restore default A records".' + ) } +
+
+ ); + }; + + renderDefaultCNameRecordNotice = () => { + const { translate } = this.props; + + if ( ! this.hasWpcomNameservers() ) { + return null; + } + + if ( this.hasDefaultCnameRecord() ) { + return null; + } + + return ( +
+ +
+ { translate( + 'Your domain is not using the default WWW CNAME record. This means your WordPress.com may not be reached correctly using the www prefix. To restore the default WWW CNAME record, click on the three dots menu and select "Restore default CNAME record".' + ) } +
+
+ ); + }; + + renderExternalNameserversNotice = () => { const { translate, selectedSite, currentRoute, selectedDomainName, nameservers, domains } = this.props; @@ -267,7 +323,9 @@ class DnsRecords extends Component { { selectedDomain?.canManageDnsRecords ? ( <> - { this.renderNotice() } + { this.renderExternalNameserversNotice() } + { this.renderDefaultARecordsNotice() } + { this.renderDefaultCNameRecordNotice() } { - const isAllDomainManagementEnabled = config.isEnabled( 'calypso/all-domain-management' ); - - if ( isAllDomainManagementEnabled && isAllSitesView ) { - page.show( domainManagementLink ); - return; - } - - window.location.href = domainManagementLink; - }; - return ( - + { canSelectAnyDomains && ( // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions , - a: e.stopPropagation() } />, + cta: domain.hasWpcomNameservers ? ( + + ) : ( + + ), }, } ), callToAction: domain.hasWpcomNameservers - ? editDNSRecordsCallToAction - : editNameserversCallToAction, + ? editNameserversCallToAction + : editDNSRecordsCallToAction, listStatusWeight: 600, }; } diff --git a/packages/urls/src/index.ts b/packages/urls/src/index.ts index bc784eb480bf8..2d1b2d4ac2fbc 100644 --- a/packages/urls/src/index.ts +++ b/packages/urls/src/index.ts @@ -23,6 +23,7 @@ export const DOMAIN_EXPIRATION_REDEMPTION = `${ root }/domains/domain-expiration export const DOMAIN_RECENTLY_REGISTERED = `${ root }/domains/register-domain/#waiting-for-domain-changes`; export const DOMAIN_PRICING_AND_AVAILABLE_TLDS = `${ root }/domains/domain-pricing-and-available-tlds/`; export const DOMAIN_PROMOTIONAL_PRICING_POLICY = `${ root }/domains/domain-pricing-and-available-tlds/#domain-name-promotional-pricing-policy`; +export const DOMAIN_CHANGE_NAME_SERVERS = `${ root }/domains/change-name-servers/#changing-name-servers-to-point-to-word-press-com`; export const DNS_RECORDS_ADD = `${ root }/domains/custom-dns/add-a-new-dns-record/`; export const DNS_RECORDS_EDITING_OR_DELETING = `${ root }/domains/custom-dns/edit-or-delete-dns-records/`; export const DNS_RECORDS_DEFAULT = `${ root }/domains/custom-dns/view-or-restore-default-dns-records/`;