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

Odyssey: Add opt-out notice for odyssey #72937

Merged
merged 12 commits into from
Feb 7, 2023
Merged

Conversation

kangzj
Copy link
Contributor

@kangzj kangzj commented Feb 3, 2023

Proposed Changes

  • Addspackages/components/src/notice-banner which is forked from Notice adjusted to use Calypso standard
  • Adds Opt-out notice to Traffic page highlight section
  • Adds supports to access existing jetpack/v4 API directly
  • Sends dismissing notice request to JITM endpoint for the site to remember the notice is dismissed

Testing Instructions

  • Use the branch from Stats: Support opt-out notice for Odyssey Stats jetpack#28733 for Jetpack the plugin
  • Setup Odyssey with Option 1 in PejTkB-3E-p2 <- enable New Stats if not yet enabled
  • Open /wp-admin/admin.php?page=stats
  • Ensure an opt-out notice is shown on the Traffic page
  • Click manage your settings
  • Ensure you are taken to Jetpack Stats settings section
  • Return to /wp-admin/admin.php?page=stats
  • Click x
  • Ensure the notice is dismissed
  • Refresh the page
  • Ensure the notice wouldn't appear again

image

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 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-ajp-p2)?

Related to #72736

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

@matticbot
Copy link
Contributor

matticbot commented Feb 3, 2023

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

App Entrypoints (~31 bytes added 📈 [gzipped])

name                   parsed_size           gzip_size
entry-stepper                +81 B  (+0.0%)      +28 B  (+0.0%)
entry-main                   +81 B  (+0.0%)      +26 B  (+0.0%)
entry-login                  +81 B  (+0.0%)      +23 B  (+0.0%)
entry-gutenboarding          +45 B  (+0.0%)       +8 B  (+0.0%)
entry-domains-landing        +45 B  (+0.0%)       +8 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~1756 bytes added 📈 [gzipped])

name   parsed_size           gzip_size
stats      +6325 B  (+0.8%)    +1756 B  (+0.8%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~197 bytes added 📈 [gzipped])

name                                            parsed_size           gzip_size
async-load-calypso-blocks-jitm                       +757 B  (+7.7%)     +182 B  (+5.3%)
async-load-calypso-lib-preferences-helper             +36 B  (+0.0%)      +15 B  (+0.0%)
async-load-calypso-lib-account-settings-helper        +36 B  (+0.0%)      +15 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

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.

@matticbot
Copy link
Contributor

This PR modifies the release build for editing-toolkit

To test your changes on WordPress.com, run install-plugin.sh editing-toolkit add/opt-out-notice-for-odyssey on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-mMA-p2

@kangzj kangzj requested a review from a team February 3, 2023 00:57
@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 3, 2023
@kangzj kangzj self-assigned this Feb 3, 2023
@kangzj kangzj added Stats Everything related to our analytics product at /stats/ Odyssey Stats Calypso Stats in Jetpack labels Feb 3, 2023
@@ -27,7 +27,8 @@ export async function jetpack_site_xhr_wrapper( params, callback ) {
'X-WP-Nonce': config( 'nonce' ),
},
isRestAPI: false,
apiNamespace: 'jetpack/v4/stats-app',
apiNamespace:
params.apiNamespace === 'jetpack/v4' ? params.apiNamespace : 'jetpack/v4/stats-app',
Copy link
Contributor Author

@kangzj kangzj Feb 3, 2023

Choose a reason for hiding this comment

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

If the API is jetpack/v4 then we don't need to prefix it with stats-app, which are only for compensated APIs. This allows Odyssey to access existing jetpack/v4 APIs, but will probably need nonce etc to function in some cases.

@kangzj kangzj marked this pull request as ready for review February 3, 2023 01:22
Copy link
Contributor

@dognose24 dognose24 left a comment

Choose a reason for hiding this comment

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

Works as described! I am still determining the annotation suggestion; please feel free to ship without updating it if unnecessary.

client/state/data-layer/wpcom/sites/jitm/index.js Outdated Show resolved Hide resolved
Copy link
Contributor

@dognose24 dognose24 left a comment

Choose a reason for hiding this comment

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

LGTM!

@kangzj kangzj merged commit 366863a into trunk Feb 7, 2023
@kangzj kangzj deleted the add/opt-out-notice-for-odyssey branch February 7, 2023 04:07
@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, 2023
@a8ci18n
Copy link

a8ci18n commented Feb 7, 2023

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

Thank you @kangzj for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Feb 16, 2023

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
Odyssey Stats Calypso Stats in Jetpack Stats Everything related to our analytics product at /stats/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants