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

Enhancement/3291 property selection updates #3384

Merged
merged 15 commits into from
May 21, 2021

Conversation

eugene-manuilov
Copy link
Collaborator

@eugene-manuilov eugene-manuilov commented May 19, 2021

Summary

Addresses issue #3291

Relevant technical choices

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

@google-cla google-cla bot added the cla: yes label May 19, 2021
@github-actions
Copy link

github-actions bot commented May 19, 2021

Size Change: +941 B (0%)

Total Size: 1.3 MB

Filename Size Change
./dist/assets/js/googlesitekit-activation.********************.js 35.5 kB +21 B (0%)
./dist/assets/js/googlesitekit-adminbar.********************.js 67.5 kB +29 B (0%)
./dist/assets/js/googlesitekit-api.********************.js 9.41 kB +18 B (0%)
./dist/assets/js/googlesitekit-dashboard-details.********************.js 79.1 kB +33 B (0%)
./dist/assets/js/googlesitekit-dashboard-splash.********************.js 49.4 kB +23 B (0%)
./dist/assets/js/googlesitekit-dashboard.********************.js 79.8 kB +31 B (0%)
./dist/assets/js/googlesitekit-datastore-forms.********************.js 9.09 kB +20 B (0%)
./dist/assets/js/googlesitekit-datastore-site.********************.js 12.6 kB +107 B (+1%)
./dist/assets/js/googlesitekit-datastore-ui.********************.js 9.04 kB +19 B (0%)
./dist/assets/js/googlesitekit-datastore-user.********************.js 16 kB +8 B (0%)
./dist/assets/js/googlesitekit-module.********************.js 79.9 kB +31 B (0%)
./dist/assets/js/googlesitekit-modules-adsense.********************.js 57.3 kB +165 B (0%)
./dist/assets/js/googlesitekit-modules-analytics-4.********************.js 16.9 kB +19 B (0%)
./dist/assets/js/googlesitekit-modules-analytics.********************.js 63.3 kB +176 B (0%)
./dist/assets/js/googlesitekit-modules-idea-hub.********************.js 11.4 kB +20 B (0%)
./dist/assets/js/googlesitekit-modules-optimize.********************.js 17.6 kB +32 B (0%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights.********************.js 24.3 kB +16 B (0%)
./dist/assets/js/googlesitekit-modules-search-console.********************.js 28.1 kB +24 B (0%)
./dist/assets/js/googlesitekit-modules-tagmanager.********************.js 31.6 kB +21 B (0%)
./dist/assets/js/googlesitekit-modules.********************.js 17.2 kB +20 B (0%)
./dist/assets/js/googlesitekit-settings.********************.js 87.2 kB +29 B (0%)
./dist/assets/js/googlesitekit-user-input.********************.js 84.6 kB +31 B (0%)
./dist/assets/js/googlesitekit-vendor.********************.js 271 kB -1 B (0%)
./dist/assets/js/googlesitekit-widgets.********************.js 11.5 kB +22 B (0%)
./dist/assets/js/googlesitekit-wp-dashboard.********************.js 67.4 kB +27 B (0%)
ℹ️ View Unchanged
Filename Size Change
./dist/assets/css/admin.css 36.2 kB 0 B
./dist/assets/css/adminbar.css 7.33 kB 0 B
./dist/assets/css/wpdashboard.css 4.43 kB 0 B
./dist/assets/js/analytics-advanced-tracking.js 769 B 0 B
./dist/assets/js/googlesitekit-base.********************.js 1.57 kB 0 B
./dist/assets/js/googlesitekit-data.********************.js 1.65 kB 0 B
./dist/assets/js/googlesitekit-datastore-location.********************.js 2.03 kB 0 B
./dist/assets/js/googlesitekit-i18n.js 3.92 kB 0 B
./dist/assets/js/runtime.********************.js 763 B 0 B

compressed-size-action

Copy link
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

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

Thanks @eugene-manuilov – this looks good overall and is close to ready, just a few suggestions and questions (including one for @felixarntz)

assets/js/googlesitekit/datastore/site/info.js Outdated Show resolved Hide resolved
assets/js/modules/analytics/datastore/accounts.js Outdated Show resolved Hide resolved
assets/js/modules/analytics/datastore/accounts.js Outdated Show resolved Hide resolved
assets/js/modules/analytics/datastore/properties.js Outdated Show resolved Hide resolved
tests/e2e/plugins/module-setup-analytics.php Show resolved Hide resolved
assets/js/modules/analytics/datastore/properties.test.js Outdated Show resolved Hide resolved
* @param {Array.<string>|string} url A list of URLs or a signle URL to match properties.
* @return {Object|null} A property object if found. NULL if nothing is found.
*/
*matchPropertyByURL( properties, url ) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't need to be a generator 😄

Suggested change
*matchPropertyByURL( properties, url ) {
matchPropertyByURL( properties, url ) {

@felixarntz is there any reason why this can't be a utility instead since it doesn't use the datastore at all?

I understand it mirrors the action in the GA4 store, but I don't think we should add it for that reason alone since these stores will always have some methods the other does not (e.g. profile/webdatastream).

Copy link
Member

Choose a reason for hiding this comment

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

@aaemnnosttv Fair point. I don't have a strong opinion on this - we can make this a utility function if preferred.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's do it in a separate ticket then? Since we already have similar functionality in the analytics-4 module.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This doesn't need to be a generator

It needs to be a generator because otherwise, we would need to return a regular redux action object.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't need to be a generator

It needs to be a generator because otherwise, we would need to return a regular redux action object.

Oops, yeah you're right, although I don't think we use actions in this way anywhere else except for those that yield controlled actions since these must be a generator. I suppose it's okay for now then, but this as a generator only for this reason when it doesn't yield anything is an odd detail that someone else might see and "fix" which breaks it. For this reason I'd prefer we extract it sooner than later. If you feel that this would take too much time right now then let's clearly document this as an intentional requirement of the function.

we already have similar functionality in the analytics-4 module.

The use in analytics-4 looks okay to me since it's actually yielding actions although maybe that could be cleaned up with a utility in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aaemnnosttv sounds good to me. Updated.

Copy link
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

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

Looks great, just the one detail in the new test which I'll apply real quick.

assets/js/modules/analytics/util/property.test.js Outdated Show resolved Hide resolved
assets/js/modules/analytics/util/property.test.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

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

Great, thanks @eugene-manuilov !

@aaemnnosttv aaemnnosttv merged commit 3c789c4 into develop May 21, 2021
@aaemnnosttv aaemnnosttv deleted the enhancement/3291-property-selection-updates branch May 21, 2021 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants