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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Dashboard View change and UA Dashboard View components. #7581

Merged
merged 15 commits into from
Sep 21, 2023

Conversation

tofumatt
Copy link
Collaborator

@tofumatt tofumatt commented Sep 13, 2023

Summary

Addresses issue:

Relevant technical choices

I opted not to remove the isGA4DashboardView selector itself but hardcode it to true, just to cut down on PR size since it's not explicitly in the ACs, but I can add that to this one if needed.

This removes all Dashboard View settings in PHP/JS and the UI to switch between the settings and to view it. The Dashboard view is now always GA4.

There are a few Storybook stories that still reference UA, which I thought was helpful as part of this PR to confirm the change, but that could ultimately be removed in this PR if desired. But otherwise they're fine to remove during the ga4Reporting feature flag removal.


From what I can see this satisfies all the ACs and works well in my testing鈥攊t might even go a bit beyond the ACs, but I figured removing as much code where straightforward is good. Let me know if you'd like less or more removed 馃槅

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 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.

@tofumatt tofumatt marked this pull request as ready for review September 13, 2023 23:43
@github-actions
Copy link

github-actions bot commented Sep 13, 2023

Build files for d88afa2 are ready:

@github-actions
Copy link

github-actions bot commented Sep 14, 2023

Size Change: -6.73 kB (0%)

Total Size: 1.4 MB

Filename Size Change
./dist/assets/css/googlesitekit-admin-css-********************.min.css 51.3 kB -103 B (0%)
./dist/assets/js/33-********************.js 930 B +1 B (0%)
./dist/assets/js/35-********************.js 3.12 kB +1 B (0%)
./dist/assets/js/googlesitekit-activation-********************.js 22.1 kB -3 B (0%)
./dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 54 kB +107 B (0%)
./dist/assets/js/googlesitekit-adminbar-********************.js 32.3 kB -60 B (0%)
./dist/assets/js/googlesitekit-api-********************.js 9.6 kB +22 B (0%)
./dist/assets/js/googlesitekit-components-gm2-********************.js 5.62 kB +3 B (0%)
./dist/assets/js/googlesitekit-components-gm3-********************.js 9.98 kB -2 B (0%)
./dist/assets/js/googlesitekit-datastore-forms-********************.js 9 kB +4 B (0%)
./dist/assets/js/googlesitekit-datastore-location-********************.js 2.09 kB +2 B (0%)
./dist/assets/js/googlesitekit-datastore-site-********************.js 17.7 kB +38 B (0%)
./dist/assets/js/googlesitekit-datastore-ui-********************.js 9.1 kB +6 B (0%)
./dist/assets/js/googlesitekit-datastore-user-********************.js 23.2 kB -97 B (0%)
./dist/assets/js/googlesitekit-entity-dashboard-********************.js 64.7 kB -247 B (0%)
./dist/assets/js/googlesitekit-main-dashboard-********************.js 80.7 kB -423 B (-1%)
./dist/assets/js/googlesitekit-modules-********************.js 21.1 kB -76 B (0%)
./dist/assets/js/googlesitekit-modules-adsense-********************.js 105 kB -1.07 kB (-1%)
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 67.1 kB -757 B (-1%)
./dist/assets/js/googlesitekit-modules-analytics-********************.js 85.3 kB -2.84 kB (-3%)
./dist/assets/js/googlesitekit-modules-optimize-********************.js 19 kB +8 B (0%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 20.5 kB +45 B (0%)
./dist/assets/js/googlesitekit-modules-search-console-********************.js 60.3 kB -137 B (0%)
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 30.8 kB +3 B (0%)
./dist/assets/js/googlesitekit-settings-********************.js 47.4 kB -50 B (0%)
./dist/assets/js/googlesitekit-splash-********************.js 65.5 kB +39 B (0%)
./dist/assets/js/googlesitekit-user-input-********************.js 40.1 kB +9 B (0%)
./dist/assets/js/googlesitekit-vendor-********************.js 317 kB -12 B (0%)
./dist/assets/js/googlesitekit-widgets-********************.js 27 kB -28 B (0%)
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 61.8 kB -1.11 kB (-2%)
./dist/assets/js/runtime-********************.js 1.3 kB +1 B (0%)
鈩癸笍 View Unchanged
Filename Size
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 11.4 kB
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 7.58 kB
./dist/assets/js/30-********************.js 2.8 kB
./dist/assets/js/31-********************.js 2.28 kB
./dist/assets/js/32-********************.js 3.72 kB
./dist/assets/js/34-********************.js 888 B
./dist/assets/js/analytics-advanced-tracking-********************.js 769 B
./dist/assets/js/googlesitekit-data-********************.js 2.18 kB
./dist/assets/js/googlesitekit-i18n-********************.js 3.92 kB
./dist/assets/js/googlesitekit-polyfills-********************.js 379 B

compressed-size-action

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Hey @tofumatt, nice work here so far. There are, though, a couple of points from the IB that have been missed:

  • Remove the New badges added to indicate new GA4 metrics.
  • The Analytics module SettingsView should be restructured following this Figma screen.

As per my separate comment, it looks like we can also remove the remaining usage of GA4_DASHBOARD_VIEW_NOTIFICATION_ID.

Thanks for the additional info in Relevant technical choices - from what I can see, keeping isGA4DashboardView() makes sense for now as we still do rely on its remaining logic, although arguably it should be renamed. We've still got plenty more tidying up and removing of UA features to come though, so I think it can happily wait for another issue, and from what I can see the remaining stories you mentioned can too.

@@ -52,7 +52,4 @@ export const SETUP_FLOW_MODE_GA4_TRANSITIONAL = 'ga4-transitional';
export const PROPERTY_TYPE_UA = 'ua';
export const PROPERTY_TYPE_GA4 = 'ga4';

export const DASHBOARD_VIEW_GA4 = 'google-analytics-4';
export const DASHBOARD_VIEW_UA = 'universal-analytics';

export const GA4_DASHBOARD_VIEW_NOTIFICATION_ID = 'switch-ga4-dashboard-view';
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like this GA4_DASHBOARD_VIEW_NOTIFICATION_ID constant and the remaining use of it can also be removed...

@tofumatt
Copy link
Collaborator Author

Thanks @techanvil! Changes made and removed those new badges, so this should be good-to-go now 馃憤馃徎

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Thanks @tofumatt - however this one point from the IB is still technically outstanding (specifically, its initial sub-point):

  • The Analytics module SettingsView should be restructured following this Figma screen.
    • In assets/js/modules/analytics/components/settings/SettingsView.js:
      • Add a new setting meta item at the first position before all other settings, labelled Account, which should display the account ID. This can be copied over from assets/js/modules/analytics/components/settings/GA4SettingsView.js.

I do realise it doesn't directly correlate to the AC, but it has been specced - having said that you did approve the IB, so if you feel it's out of scope here, I'd be happy to skip this part. What do you think?

@tofumatt
Copy link
Collaborator Author

Oh, right, I meant to cover that here in the technical notes.

We have a separate issue for that here: #6821. I think I meant to mention it in my IB Review and totally forgot 馃う馃徎

I think we should omit it from this issue though. It's pretty unrelated and as discussed in that IB might warrant a new selector, etc., so we should do that separately.

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Hey @tofumatt! Thanks for clarifying that point, I hadn't spotted #6821. Makes sense to leave it out of this issue, and address there instead.

I've noticed there are a few VRT tests that need to be fixed - once these are done, I think this will be good to go.

@tofumatt
Copy link
Collaborator Author

I've noticed there are a few VRT tests that need to be fixed - once these are done, I think this will be good to go.

Ah, cheers, I thought that was just a timeout. I've fixed it, now is good-to-go 馃槃

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Hey @tofumatt, thanks for updating the VRT tests. Sorry to have to send this back again, I had thought it would indeed be good to go. However, I've noticed that you've removed some tests as part of your recent merge of develop into this branch - see this diff.

The thing is, the logic these test cases are testing still exists in the codebase - it's part of the recently merged PR #7590.

So, unless we're also removing this logic here - which I think would be out of scope, and I don't feel entirely confident it would be safe to do so just yet, it would need a good bit of unpicking to check if these cases are not longer reachable - I think we should keep the tests too. It looks like they'd need a bit of a tweak to use an alternative way to modify the return value of isGA4DashboardView(), with the explicit dashboardView setting out of the picture, but beyond that I think they are good to keep. What do you think?

@tofumatt
Copy link
Collaborator Author

Sure thing, I'll make the changes to those tests/logic and restore them 馃憤馃徎

@aaemnnosttv aaemnnosttv changed the base branch from develop to main September 20, 2023 13:54
Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Nice one @tofumatt, this LGTM!

@techanvil techanvil merged commit 68d7282 into main Sep 21, 2023
23 of 24 checks passed
@techanvil techanvil deleted the feat/6786-ua-removal branch September 21, 2023 09:50
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.

None yet

2 participants