-
Notifications
You must be signed in to change notification settings - Fork 136
Privacy Banner: handle Settings CTA #9107
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
Privacy Banner: handle Settings CTA #9107
Conversation
…s, mark privacy banner as seen
…rivacy Banner as seen
|
You can test the changes on this Pull Request by downloading an installable build, or scanning this QR code: |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature/new_privacy_screen #9107 +/- ##
================================================================
- Coverage 43.75% 43.71% -0.05%
Complexity 4136 4136
================================================================
Files 845 846 +1
Lines 44323 44369 +46
Branches 5820 5831 +11
================================================================
+ Hits 19394 19395 +1
- Misses 23225 23270 +45
Partials 1704 1704
☔ View full report in Codecov by Sentry. |
Generated by 🚫 dangerJS |
| launch { | ||
| if (repository.isUserWPCOM()) { | ||
| _state.value = _state.value?.copy(loading = true) | ||
| val event = | ||
| repository.updateTracksSetting(_state.value?.analyticsSwitchEnabled ?: false) | ||
| _state.value = _state.value?.copy(loading = false) | ||
|
|
||
| event.fold( | ||
| onSuccess = { | ||
| appPrefsWrapper.savedPrivacyBannerSettings = true | ||
| analyticsTrackerWrapper.sendUsageStats = analyticsPreference | ||
| triggerEvent(ShowSettings) | ||
| }, | ||
| onFailure = { | ||
| triggerEvent( | ||
| ShowErrorOnSettings( | ||
| requestedAnalyticsValue = if (analyticsPreference) RequestedAnalyticsValue.ENABLED | ||
| else RequestedAnalyticsValue.DISABLE | ||
| ) | ||
| ) | ||
| } | ||
| ) | ||
| } else { | ||
| appPrefsWrapper.savedPrivacyBannerSettings = true | ||
| analyticsTrackerWrapper.sendUsageStats = analyticsPreference | ||
| triggerEvent(ShowSettings) | ||
| } | ||
| } |
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.
np: We might want to unit test this in the future
| } | ||
| } | ||
|
|
||
| @Suppress("MagicNumber") |
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.
Nice!
atorresveiga
left a comment
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.
Great work @wzieba. Everything worked as expected!
LGTM! ![]()
Closes: #8949
Description
This PR adds behavior after pressing "Settings" button on the Privacy Banner. The behavior is described in #8949 and should match iOS described in woocommerce/woocommerce-ios#9802
It targets
feature/new_privacy_screenbecause I needed to provide changes in the Privacy Screen to make it possible to show an error message.Testing instructions
Every test case should start with opening the Privacy Banner: you should use VPN connection if needed to any European country. To show the banner at the next fresh app launch without reinstalling the app, please use option in Developer Settings.
WPCOM account
All tests in this section should be performed when logged in as WPCOM user
TC 1 Not updating settings
TC 2 Updating settings
TC 3 Not updating settings + error
TC 4 Updating settings + error
Non-WPCOM account
In the case of non-WPCOM account, it doesn't matter whether we change the initial setting or not, there's also no chance for the error.
TC1
Images/gif
RELEASE-NOTES.txtif necessary.