-
Notifications
You must be signed in to change notification settings - Fork 179
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
Dashboard: Telemetry Opt In Banner #4374
Conversation
Size Change: +2.65 kB (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
if ( | ||
bannerPreviouslyClosed || // The banner has been closed before | ||
currentPath === APP_ROUTES.EDITOR_SETTINGS || // The user is on the settings page | ||
!dataIsLoaded || // currentUser is not loaded yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good to not show the banner prematurely if the user data hasn't come in yet.
Tests and functionality works. I think if we want to tie the dismissal of the banner to the user's persisted state over localStorage in the API then that would be a nice follow on evolution. Also tested the Settings page too and that works well. |
Codecov Report
@@ Coverage Diff @@
## main #4374 +/- ##
==========================================
- Coverage 83.47% 83.43% -0.04%
==========================================
Files 862 864 +2
Lines 15118 15165 +47
==========================================
+ Hits 12619 12653 +34
- Misses 2499 2512 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works great! I know this is already moved to QA but I wanted to look anyway, sorry for the late review. Few teeny tiny nits if you feel like it, i'm not worried about them at all. I love the clean up you did for this, thank you for doing that.
@@ -0,0 +1,41 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo on this file name (telemetyBanner
) - missing the r
Non-admins need to be able to update their telemetry opt-in preferences
…-stories-wp into feature/4226-telemetry-banner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-tested this locally with all the updates to verify changes. Everything still looks good, Pascal's adds that eliminated the need for my other PR look great. All tests still pass locally.
if (canManageSettings) { | ||
fetchSettings(); | ||
} | ||
}, [fetchSettings, canManageSettings]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Summary
This adds an opt in banner for telemetry tracking that will display until the user either closes it or interacts with the telemetry opt in checkbox on the
Edit Settings
page/view. It will be visible on all top level views using thePageHeader
shared component with the exception of theEdit Settings
page/view.Relevant Technical Choices
useTelemetryOptIn
hook so as not to duplicate logic between the banner and settings page.telemetry
props to thePageHeader
component and end up editing all of our top level views.@testing-library/user-events
dependency to circumvent the following issue: onChange is called when checkbox is disabled testing-library/react-testing-library#275MockApiProvider
andrenderWithProvider
utils to make view integration tests easier.User-facing changes
Editor Settings page
, the banner should not display again. In addition, when opting in using the banner the title should change toYour selection has been updated. Thank you for helping to improve the editor!
.Testing Instructions
Your selection has been updated. Thank you for helping to improve the editor.
and unchecking it reverts it back.#4226