metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

feat: adds "data collection for marketing" toggles

Open jonybur opened this issue 1 year ago • 2 comments

Adds data collection for marketing toggles (and toasts/warnings) on:

  • Onboarding
  • Toast in Wallet
  • Settings page

Description

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2525 https://github.com/MetaMask/MetaMask-planning/issues/2439 https://github.com/MetaMask/MetaMask-planning/issues/2440

Manual testing steps

Onboarding checkbox: Set isPastPrivacyPolicyDate to true in OptInMetrics

  1. Start a new account
  2. There should be a new checkbox that asks for marketing consent
  3. Checking it should set the marketing consent to true (check at Settings, Securty tab page)

Security tab:

  1. Go to Security tab
  2. When checking the "Data collection for marketing" to true, the "Participate in MetaMetrics" toggle should turn to true
  3. When checking "Participate in MetaMetrics" to false, "Data collection for marketing" should be set to false
  4. When "Participate in Metametrics" is true and "Data collection for marketing" is true, and the latter is set to false, a warning message should appear.

Toast: An already onboarded user will have the "dataCollectionForMarketing" value as null (neither true or false). This will trigger the toast.

  1. By clicking on "I accept", it should set the "Data collection for marketing" to true.
  2. By closing the toast or clicking on "No thanks", it should set the "Data collection for marketing" to false.

All of these actions should trigger subsequent Segment events.

Screenshots/Recordings

Before

After

https://github.com/MetaMask/metamask-mobile/assets/11148144/d0ebee90-38e1-4362-92ad-73728c82df72

Screenshot 2024-05-20 at 19 18 19 Screenshot 2024-05-20 at 19 19 30

Pre-merge author checklist

  • [ ] I’ve followed MetaMask Coding Standards.
  • [ ] I've completed the PR template to the best of my ability
  • [ ] I’ve included tests if applicable
  • [ ] I’ve documented my code using JSDoc format if applicable
  • [ ] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

jonybur avatar May 20 '24 14:05 jonybur

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: app/components/Nav/App/index.js

Function Unhandled Issue
App Error: TaskQueue: Error with task : The 'navigation' object hasn't been initialized yet. This might happ... useEf...
Event Count: 1.4k Affected Users: 1.7k
App Error: TaskQueue: Error with task : The 'navigation' object hasn't been initialized yet. This might happ... ...
Event Count: 1 Affected Users: 1

Did you find this useful? React with a 👍 or 👎

sentry[bot] avatar May 20 '24 14:05 sentry[bot]

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

github-actions[bot] avatar May 20 '24 14:05 github-actions[bot]

@EtherWizard33 Just confirmed that this will show after the new privacy policy is rolled out, so the legacy onboarding scenario won't be an issue

jonybur avatar May 22 '24 15:05 jonybur

@EtherWizard33 The issue with the toast should be fixed now

jonybur avatar May 22 '24 15:05 jonybur

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 526e22aece49ee6edf82ab4561914f7c1253059c Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5de892c9-61ab-4292-8ce7-6aa13550429b

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 23 '24 19:05 github-actions[bot]

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: d2186d1eb80f01d6e59dab7ea5ba7c46f40b3fde Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/034f2927-f338-4796-9ea9-8e6ac6f66e77

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 23 '24 22:05 github-actions[bot]

Codecov Report

Attention: Patch coverage is 65.21739% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 47.29%. Comparing base (678c2f6) to head (2880efe). Report is 34 commits behind head on main.

Files Patch % Lines
...ews/Settings/SecuritySettings/SecuritySettings.tsx 26.31% 14 Missing :warning:
app/components/UI/OptinMetrics/index.js 14.28% 6 Missing :warning:
app/components/Views/Wallet/index.tsx 62.50% 1 Missing and 2 partials :warning:
app/components/Views/DataCollectionModal/index.tsx 83.33% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9687      +/-   ##
==========================================
+ Coverage   46.66%   47.29%   +0.63%     
==========================================
  Files        1343     1371      +28     
  Lines       32805    33344     +539     
  Branches     3527     3585      +58     
==========================================
+ Hits        15307    15770     +463     
- Misses      16554    16616      +62     
- Partials      944      958      +14     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar May 23 '24 22:05 codecov-commenter

After talking with Yanrong, the checkbox border should be blue. If you can just pull from main to merge this PR to your local, you can override the existing border color of the checkbox with the following code

in styles.ts checkbox: {borderColor: theme.colors.primary.default}

in main file <Checkbox checkboxStyle={styles.checkbox}/ >

brianacnguyen avatar May 23 '24 23:05 brianacnguyen

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 5b10e34fb03b0916ca0000a63ee00803e9479975 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cb570bff-7eb3-4580-9a3f-6a850371972f

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 23 '24 23:05 github-actions[bot]

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 204befc6886bf0631ee4084d0894dfa8ff25c43b Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2ca9906c-aa31-4813-b464-e04d463ea06f

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 24 '24 07:05 github-actions[bot]

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: b3ed6cf103a4c0116d7ec3841c46e18365b1010a Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9f7a94ed-b2fa-4e37-9696-8cdb05195760

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 24 '24 13:05 github-actions[bot]

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: b786baf7982579052c6b36dc519ba5429560748d Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/983262f9-b0ef-4707-afa3-db4b6575a058

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 24 '24 17:05 github-actions[bot]

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 4ea38e8a99f52cc94e65faf5b9468172f83e7ecc Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e118e95a-12a8-4204-a679-f0d24473bff2

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 25 '24 00:05 github-actions[bot]

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 2880efed725719398d7d036b1492843b0992d577 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7d03f163-358a-4ec1-8da5-cd0dbee829e7

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 25 '24 23:05 github-actions[bot]

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 716c2949202366d06ca0dd55b7cd02d6991b1fc6 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/69aa0a05-358c-49cb-a3f2-5f8dec997fcc

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 27 '24 14:05 github-actions[bot]

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: d9a887c2184f84e76721557763dd6cb1a34a687d Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/3de55293-7edf-40d9-b7d9-38248bc8f347

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 27 '24 17:05 github-actions[bot]

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 28dd6a579f770d5aecd608b2dddfa7a01ec5474f Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/37e7ae25-f7a6-4224-80e0-1f0cbd744bd7

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 28 '24 19:05 github-actions[bot]

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: d37ac2d8a9b633417c238d4d5db1243e3f005c79 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d895a3e4-1941-413f-8935-c8d9c4daedb6

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar May 29 '24 10:05 github-actions[bot]

Can we update the initial-background-state and fixture-builder files to have this new data?

tommasini avatar Jun 03 '24 16:06 tommasini

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 5b9f76df7963cd2e64722f769e82d79ff1fafe76 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/93fa3bdd-4390-4dbb-91a1-27b5648a2c84

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar Jun 03 '24 16:06 github-actions[bot]

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 22bf87ca5b9c817f8ce05dc1032fc86111e2d2a5 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/36900fe0-9fbf-4063-850c-9fe8f5c1745d

[!NOTE]

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

github-actions[bot] avatar Jun 03 '24 16:06 github-actions[bot]

Removed the auto-added 7.25.0 label as this is planned for a hotfix based off of 7.24.0 (more on Slack). cc @jonybur @darkwing @Cal-L @NicolasMassart

hesterbruikman avatar Jun 04 '24 11:06 hesterbruikman

@hesterbruikman please see https://github.com/MetaMask/metamask-mobile/issues/9862 that currently makes me think it can't be in 7.24.0 until it gets some improvements.

NicolasMassart avatar Jun 06 '24 19:06 NicolasMassart

No release label on PR. Adding release label release-7.24.3 on PR, as PR was cherry-picked in branch 7.24.3.

metamaskbot avatar Jun 19 '24 20:06 metamaskbot