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

Enhance/4762 - Implement UI for new AdSense setup main components #4978

Merged
merged 3 commits into from
Apr 5, 2022

Conversation

hussain-t
Copy link
Collaborator

@hussain-t hussain-t commented Mar 27, 2022

Summary

Addresses issue:

Relevant technical choices

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 4.7 and PHP 5.6.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions
Copy link

github-actions bot commented Mar 27, 2022

Size Change: +487 B (0%)

Total Size: 1.35 MB

Filename Size Change
./dist/assets/js/googlesitekit-activation-********************.js 33.4 kB -1 B (0%)
./dist/assets/js/googlesitekit-adminbar-********************.js 37.2 kB -4 B (0%)
./dist/assets/js/googlesitekit-dashboard-********************.js 55.5 kB +1 B (0%)
./dist/assets/js/googlesitekit-dashboard-details-********************.js 51 kB -3 B (0%)
./dist/assets/js/googlesitekit-dashboard-splash-********************.js 67.2 kB -3 B (0%)
./dist/assets/js/googlesitekit-datastore-site-********************.js 14.7 kB +2 B (0%)
./dist/assets/js/googlesitekit-idea-hub-post-list-********************.js 25.9 kB -4 B (0%)
./dist/assets/js/googlesitekit-module-********************.js 47.5 kB -4 B (0%)
./dist/assets/js/googlesitekit-modules-adsense-********************.js 68.4 kB +515 B (+1%)
./dist/assets/js/googlesitekit-modules-analytics-********************.js 74.3 kB -3 B (0%)
./dist/assets/js/googlesitekit-modules-idea-hub-********************.js 34.7 kB +4 B (0%)
./dist/assets/js/googlesitekit-modules-optimize-********************.js 19.4 kB +4 B (0%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 18.8 kB -2 B (0%)
./dist/assets/js/googlesitekit-modules-search-console-********************.js 40.7 kB -1 B (0%)
./dist/assets/js/googlesitekit-modules-subscribe-with-google-********************.js 17.8 kB -1 B (0%)
./dist/assets/js/googlesitekit-settings-********************.js 51.5 kB -10 B (0%)
./dist/assets/js/googlesitekit-user-input-********************.js 47.6 kB -7 B (0%)
./dist/assets/js/googlesitekit-vendor-********************.js 318 kB +10 B (0%)
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 60.5 kB -6 B (0%)
ℹ️ View Unchanged
Filename Size
./dist/assets/css/googlesitekit-admin-css-********************.min.css 42.4 kB
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 11.3 kB
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 6.48 kB
./dist/assets/js/32-********************.js 51.9 kB
./dist/assets/js/33-********************.js 3.12 kB
./dist/assets/js/analytics-advanced-tracking-********************.js 769 B
./dist/assets/js/googlesitekit-api-********************.js 9.41 kB
./dist/assets/js/googlesitekit-base-********************.js 1.58 kB
./dist/assets/js/googlesitekit-data-********************.js 2.09 kB
./dist/assets/js/googlesitekit-datastore-forms-********************.js 9.05 kB
./dist/assets/js/googlesitekit-datastore-location-********************.js 2.08 kB
./dist/assets/js/googlesitekit-datastore-ui-********************.js 9.14 kB
./dist/assets/js/googlesitekit-datastore-user-********************.js 22.2 kB
./dist/assets/js/googlesitekit-i18n-********************.js 3.92 kB
./dist/assets/js/googlesitekit-idea-hub-notice-********************.js 4.96 kB
./dist/assets/js/googlesitekit-modules-********************.js 17.3 kB
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 19.2 kB
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 30.6 kB
./dist/assets/js/googlesitekit-polyfills-********************.js 380 B
./dist/assets/js/googlesitekit-widgets-********************.js 19.4 kB
./dist/assets/js/runtime-********************.js 1.22 kB

compressed-size-action

Copy link
Collaborator

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

There's an i18n change to make here, but I noticed the IB mentioned some stories needing updating:

Update assets/js/modules/adsense/components/setup/v2/SetupMain.stories.js to include stories where above components are rendered.

But I don't see those changes in this PR. Could you add those stories?

Comment on lines 108 to 126
sprintf(
/* translators: %s: user email address */
__(
'Already use AdSense? Add %s as a user to an existing AdSense account.',
'google-site-kit'
),
userEmail
) }{ ' ' }
<Link
href={ supportURL }
inherit
external
aria-label={ __(
'Learn more about adding a user to an existing AdSense account',
'google-site-kit'
) }
>
{ __( 'Learn more', 'google-site-kit' ) }
</Link>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know there are a lot of places where we use this sort of "space between two translated strings" approach, but technically it's not quite right. It presents problems when trying to localise this whole section of text properly as they are really one paragraph, but being presented to translators as two distinct pieces of text AND being combined without proper thought given to how a particular locale would combine them. Really we should be doing this:

Suggested change
sprintf(
/* translators: %s: user email address */
__(
'Already use AdSense? Add %s as a user to an existing AdSense account.',
'google-site-kit'
),
userEmail
) }{ ' ' }
<Link
href={ supportURL }
inherit
external
aria-label={ __(
'Learn more about adding a user to an existing AdSense account',
'google-site-kit'
) }
>
{ __( 'Learn more', 'google-site-kit' ) }
</Link>
createInterpolateElement(
sprintf(
/* translators: %s: user email address */
__(
'Already use AdSense? Add %s as a user to an existing AdSense account. <a>Learn more</a>',
'google-site-kit'
),
userEmail,
),
{
a: <Link
href={ supportURL }
inherit
external
aria-label={ __(
'Learn more about adding a user to an existing AdSense account',
'google-site-kit'
) }
/>
}
)

I know it's sort of annoying, but it's the right approach here to give a really solid i18n experience.

@hussain-t
Copy link
Collaborator Author

There's an i18n change to make here, but I noticed the IB mentioned some stories needing updating:

Update assets/js/modules/adsense/components/setup/v2/SetupMain.stories.js to include stories where above components are rendered.

But I don't see those changes in this PR. Could you add those stories?

@tofumatt, though the IB says to update the stories, it has been already implemented as part of another ticket. You can check out the branch and confirm the components are being rendered :)

Copy link
Collaborator

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

Ah, fair enough, I see the stories were created elsewhere. Thanks for updating the translation strings; looks good then! 👍🏻

@tofumatt tofumatt merged commit aaf1636 into develop Apr 5, 2022
@tofumatt tofumatt deleted the enhance/4762-adsense-setup-new-ui branch April 5, 2022 22:13
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.

2 participants