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

Adds gravatar wont load notice #99384

Merged
merged 5 commits into from
Feb 7, 2025

Conversation

StevenPartridge
Copy link
Contributor

@StevenPartridge StevenPartridge commented Feb 5, 2025

Related to # https://github.com/Automattic/nomado-issues/issues/1244

Proposed Changes

  • Adds a modified message for gravatar domains that won't properly load with the default A records or CNAME records
  • Modifies the message for the popups to reset A/AAAA and CNAME records to specify WordPress.com site or Gravatar profile
  • Updates two components to Typescript for better type safety

Why are these changes being made?

  • As part of the Gravatar i3 project
  • To inform users who may have modified their Gravatar Domain's A Records and give them an easy way to recover

Testing Instructions

  • Either wait for the backend ticket that changes how this works, or comment out the check at 2fb01bfd#49-og (enables loading the DNS management page with a gravatar flagged domain)
  • Have a domain with the gravatar usage flag (but not the gravatar usage restricted flag)
  • Also, modify your A records to something non standard, or just delete your A records

I'm still testing this, might need to adjust instructions a little bit

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@StevenPartridge StevenPartridge self-assigned this Feb 5, 2025
@matticbot
Copy link
Contributor

matticbot commented Feb 5, 2025

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

Sections (~64 bytes added 📈 [gzipped])

name     parsed_size           gzip_size
hosting      +1110 B  (+0.0%)      +64 B  (+0.0%)
domains      +1110 B  (+0.0%)      +64 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.

@StevenPartridge StevenPartridge requested a review from a team February 5, 2025 23:53
@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 Feb 5, 2025
@StevenPartridge StevenPartridge marked this pull request as ready for review February 6, 2025 00:06
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug nomado-1244/gravatar-wont-load-notice on your sandbox.

Copy link
Contributor

@leonardost leonardost left a comment

Choose a reason for hiding this comment

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

Tested and LGTM, thanks for this update! Left just one comment that I think we should address.

I think we should update the CNAME notice as well:

Markup on 2025-02-06 at 15:01:18

And also the popup message when restoring the default A or CNAME records:

Markup on 2025-02-06 at 14:21:55

@@ -50,6 +50,11 @@ class DnsRecords extends Component {
subtitleOverride: PropTypes.string,
};

getSelectedDomain = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we can define a strict return type here to show what's expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's certainly possible, but I think doing so in this PR would be a bad idea. The file isn't currently Typescript, that would be a pretty major change to sneak in.

I did update two of the popup components to TS and added strict type checking, they were relatively safe to update.

I'm happy to create a followup task if you'd like that done as part of the Gravatar project, but I'd rather not mix it in with this PR

@StevenPartridge StevenPartridge force-pushed the nomado-1244/gravatar-wont-load-notice branch from d06db64 to 5deb854 Compare February 7, 2025 18:11
@@ -26,17 +36,18 @@ function RestoreDefaultARecordsDialog( { onClose, visible, defaultRecords } ) {
},
];

const message = defaultRecords
? sprintf(
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 couldn't find a path where this untranslated text was used, defaultRecords was always passed in as null, unless I'm missing something. Removing it seemed the best path forward, it's not translated anyway

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that parameter was used in the past, but not anymore

import { useI18n } from '@wordpress/react-i18n';
import type { ResponseDomain } from 'calypso/lib/domains/types';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Converted this and the other dialog to TSX to support type checking

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for this 🙂

@@ -303,12 +303,13 @@ function DnsMenuOptionsButton( {
<RestoreDefaultARecordsDialog
visible={ isRestoreARecordsDialogVisible }
onClose={ closeRestoreARecordsDialog }
defaultRecords={ null }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the only instance of RestoreDefaultARecordsDialog I could find, and it's always passing in Null, so I removed it as a prop from the component

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@StevenPartridge StevenPartridge requested review from a team, ramynasr and leonardost February 7, 2025 19:41
Copy link
Contributor

@leonardost leonardost left a comment

Choose a reason for hiding this comment

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

LGTM! Tested with a Gravatar domain and a regular domain and works great! Left just one minor comment.

@@ -303,12 +303,13 @@ function DnsMenuOptionsButton( {
<RestoreDefaultARecordsDialog
visible={ isRestoreARecordsDialogVisible }
onClose={ closeRestoreARecordsDialog }
defaultRecords={ null }
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

import { useI18n } from '@wordpress/react-i18n';
import type { ResponseDomain } from 'calypso/lib/domains/types';
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for this 🙂

@@ -26,17 +36,18 @@ function RestoreDefaultARecordsDialog( { onClose, visible, defaultRecords } ) {
},
];

const message = defaultRecords
? sprintf(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that parameter was used in the past, but not anymore

@StevenPartridge StevenPartridge merged commit d4734cb into trunk Feb 7, 2025
13 checks passed
@StevenPartridge StevenPartridge deleted the nomado-1244/gravatar-wont-load-notice branch February 7, 2025 22:31
@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 Feb 7, 2025
@a8ci18n
Copy link

a8ci18n commented Feb 8, 2025

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

Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

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

  • Your domain is not using default A records. This means it may not be pointing to your Gravatar profile correctly. To restore default A records, click on the three dots menu and select "Restore default A records". {{defaultRecordsLink}}Learn more{{/defaultRecordsLink}}.
  • Your domain is not using the default WWW CNAME record. This means your Gravatar profile 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". {{defaultRecordsLink}}Learn more{{/defaultRecordsLink}}.
  • Restoring the record will point the www subdomain to your Gravatar profile.
  • Restoring the records will point this domain to your Gravatar profile.
  • Restoring the records will point this domain to your WordPress.com site

Thank you in advance!

@a8ci18n
Copy link

a8ci18n commented Feb 10, 2025

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
None yet
Development

Successfully merging this pull request may close these issues.

5 participants