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/8156 connect analytics cta #8798

Merged
merged 24 commits into from
Jun 17, 2024
Merged

Conversation

kuasha420
Copy link
Contributor

@kuasha420 kuasha420 commented Jun 4, 2024

Summary

Addresses issue:

Relevant technical choices

Deviation from IB: Currently in this PR, the Widget will be shown unconditionally when Analytics module is disconnected. This is because at the moment, audience settings are part of Analytics module, so we can't check it when the module is disconnected. This will be fixed in #8810. The AC and QAB has been updated to reflect that, so there should be no further confusion in QA.

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 5.2 and PHP 7.4.
  • 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.

@kuasha420 kuasha420 marked this pull request as ready for review June 5, 2024 13:22
Copy link

github-actions bot commented Jun 5, 2024

Build files for e03170d have been deleted.

Copy link
Collaborator

@hussain-t hussain-t left a comment

Choose a reason for hiding this comment

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

Excellent work, @kuasha420! The changes look good overall. However, please consider addressing the following issues:

  1. Tablet Breakpoint: The tablet breakpoint should start from 601px, consistent with other CTAs like ConnectModuleCTATile. Notably, the period before the Connect Google Analytics button was missing. We calculate the tablet breakpoint from 601px. See:
    if ( onlyWidth > 600 ) {
    return BREAKPOINT_TABLET;
    }

Please refer to the screencast below for details:

Screen.Recording.2024-06-07.at.3.51.45.PM.mov
  1. CTA Text Alignment: The CTA text is not aligned properly at 960px. This should be corrected.

Screenshot 2024-06-07 at 4 55 48 PM

  1. Desktop Breakpoint: We should use 961px ($width-desktop + 1px) for the desktop breakpoint instead of 960px.

Screenshot 2024-06-07 at 4 56 07 PM

  1. Minor Comments: I've left a few nit-picky comments. Please take a look at them.

Thanks!

@@ -44,6 +44,7 @@ import KeyMetricsNewBadge from '../../components/KeyMetrics/KeyMetricsNewBadge';
import ConnectGA4CTAWidget from '../../modules/analytics-4/components/widgets/ConnectGA4CTAWidget';
import { AudienceAreaFooter } from '../../modules/analytics-4/components/audience-segmentation/dashboard';
import { isFeatureEnabled } from '../../features';
import ConnectAnalyticsCTATileWidget from '../../modules/analytics-4/components/audience-segmentation/dashboard/ConnectAnalyticsCTATileWidget';
Copy link
Collaborator

Choose a reason for hiding this comment

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

A nit-picky one, let's add this import above along with other component imports.


const { useSelect } = Data;

export default function ConnectAnalyticsCTATileWidget( { Widget } ) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add PropTypes for the Widget prop?

Comment on lines 50 to 56
provideModules( registry, [
{
slug: 'analytics-4',
active: false,
connected: false,
},
] );
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems unnecessary. It works without provideModules. We only need to provideModuleRegistrations for the Analytics icon to be rendered.

Comment on lines 169 to 176
isActive: ( select ) => {
const isAnalyticsConnected =
select( CORE_MODULES ).isModuleConnected(
'analytics-4'
);

return ! isAnalyticsConnected;
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO, the one-liner seems cleaner. It's just a personal preference, and applying it is unnecessary unless you are okay with it :)

Suggested change
isActive: ( select ) => {
const isAnalyticsConnected =
select( CORE_MODULES ).isModuleConnected(
'analytics-4'
);
return ! isAnalyticsConnected;
},
isActive: ( select ) =>
! select( CORE_MODULES ).isModuleConnected( 'analytics-4' ),

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 will change in a follow up issue where it will also take the audience setup into consideration, when it will no longer work as a simple one liner, I've added a TODO comment to explain this. Cheers.

Copy link

github-actions bot commented Jun 11, 2024

Size Change: +12.6 kB (+0.82%)

Total Size: 1.55 MB

Filename Size Change
./dist/assets/css/googlesitekit-admin-css-********************.min.css 54.8 kB +328 B (+0.6%)
./dist/assets/js/34-********************.js 3.11 kB -1 B (-0.03%)
./dist/assets/js/googlesitekit-activation-********************.js 24.1 kB -6 B (-0.02%)
./dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 59.5 kB -3 B (-0.01%)
./dist/assets/js/googlesitekit-adminbar-********************.js 34.7 kB +2 B (+0.01%)
./dist/assets/js/googlesitekit-api-********************.js 10.2 kB +4 B (+0.04%)
./dist/assets/js/googlesitekit-components-gm2-********************.js 5.87 kB -12 B (-0.2%)
./dist/assets/js/googlesitekit-components-gm3-********************.js 10.1 kB +3 B (+0.03%)
./dist/assets/js/googlesitekit-data-********************.js 2.18 kB +2 B (+0.09%)
./dist/assets/js/googlesitekit-datastore-location-********************.js 2.08 kB -1 B (-0.05%)
./dist/assets/js/googlesitekit-datastore-site-********************.js 20 kB +33 B (+0.17%)
./dist/assets/js/googlesitekit-entity-dashboard-********************.js 73.9 kB +10 B (+0.01%)
./dist/assets/js/googlesitekit-main-dashboard-********************.js 126 kB +3.8 kB (+3.11%)
./dist/assets/js/googlesitekit-modules-********************.js 22.3 kB +100 B (+0.45%)
./dist/assets/js/googlesitekit-modules-ads-********************.js 29.4 kB +154 B (+0.53%)
./dist/assets/js/googlesitekit-modules-adsense-********************.js 112 kB +43 B (+0.04%)
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 140 kB +4.01 kB (+2.96%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 22.6 kB -6 B (-0.03%)
./dist/assets/js/googlesitekit-modules-search-console-********************.js 58.5 kB -76 B (-0.13%)
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 30.6 kB +66 B (+0.22%)
./dist/assets/js/googlesitekit-settings-********************.js 61.7 kB -2 B (0%)
./dist/assets/js/googlesitekit-splash-********************.js 73.1 kB +439 B (+0.6%)
./dist/assets/js/googlesitekit-user-input-********************.js 48.3 kB -14 B (-0.03%)
./dist/assets/js/googlesitekit-vendor-********************.js 317 kB +3 B (0%)
./dist/assets/js/googlesitekit-widgets-********************.js 59.2 kB +3.7 kB (+6.66%) 🔍
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 60.2 kB +70 B (+0.12%)
./dist/assets/js/runtime-********************.js 1.3 kB -4 B (-0.31%)
ℹ️ View Unchanged
Filename Size
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 11.2 kB
./dist/assets/css/googlesitekit-authorize-application-css-********************.min.css 770 B
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 7.47 kB
./dist/assets/js/29-********************.js 2.76 kB
./dist/assets/js/30-********************.js 2.25 kB
./dist/assets/js/31-********************.js 3.64 kB
./dist/assets/js/32-********************.js 935 B
./dist/assets/js/33-********************.js 892 B
./dist/assets/js/analytics-advanced-tracking-********************.js 776 B
./dist/assets/js/contact-form-7-********************.js 645 B
./dist/assets/js/googlesitekit-datastore-forms-********************.js 9.14 kB
./dist/assets/js/googlesitekit-datastore-ui-********************.js 10.1 kB
./dist/assets/js/googlesitekit-datastore-user-********************.js 25.2 kB
./dist/assets/js/googlesitekit-i18n-********************.js 3.92 kB
./dist/assets/js/googlesitekit-polyfills-********************.js 377 B
./dist/assets/js/mailchimp-********************.js 629 B
./dist/assets/js/optin-monster-********************.js 672 B
./dist/assets/js/popup-maker-********************.js 633 B
./dist/assets/js/woocommerce-********************.js 652 B
./dist/assets/js/wpforms-********************.js 632 B

compressed-size-action

@kuasha420 kuasha420 requested a review from hussain-t June 11, 2024 14:42
Copy link
Collaborator

@hussain-t hussain-t left a comment

Choose a reason for hiding this comment

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

Thanks, @kuasha420. Could you please fix the viewport range to be from 961px to 1139px?

Screenshot 2024-06-11 at 10 55 21 PM

Update: Can we push the SVG to the right for the above viewport?

@kuasha420
Copy link
Contributor Author

@hussain-t Thank you for the review and pointer. This is looking much better now but needed some tinkering with the SVG and flex properties, let me know what you think! Cheers.

Copy link
Collaborator

@hussain-t hussain-t left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the issues, @kuasha420. It looks a lot better. However, I am concerned that on larger screens, there's excessive whitespace on the right. Can we adjust the graphics container to use justify-content: flex-end for screens that are 1440px and wider?

Screenshot 2024-06-13 at 4 24 44 PM

@media (min-width: $bp-xxlarge) {
    justify-content: flex-end;
    margin-right: 50px; // Adds a bit more spacing on the right
}

Additionally, please resolve the merge conflicts.

Update: Since we don't have designs for large/wide screens, we can leave it as it is.

Copy link
Collaborator

@hussain-t hussain-t left a comment

Choose a reason for hiding this comment

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

Excellent work, @kuasha420. LGTM 🎖️

Copy link
Collaborator

@nfmohit nfmohit left a comment

Choose a reason for hiding this comment

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

Excellent work here, thank you @kuasha420! I have left a few questions for your consideration. Let me know what you think, thanks!

Copy link
Collaborator

@nfmohit nfmohit left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @kuasha420 !

@nfmohit nfmohit merged commit 93f5bbb into develop Jun 17, 2024
21 of 22 checks passed
@nfmohit nfmohit deleted the enhance/8156-connect-analytics-cta branch June 17, 2024 17:22
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.

3 participants