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

Hide auto-contribute section in brave://settings when region is JP #11014

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

emerick
Copy link
Contributor

@emerick emerick commented Nov 11, 2021

Resolves brave/brave-browser#19355

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally: npm run test -- brave_browser_tests, npm run test -- brave_unit_tests, npm run lint, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

JP Region

  • Clean profile
  • Run brave with --rewards=countryid=19024 option to simulate running in JP region
  • Visit brave://settings
  • Click on Rewards
  • Click link in right pane to open Rewards panel
  • Enable Rewards
  • Verify that auto-contribution settings aren't shown in settings

Non-JP Region

  • Clean profile
  • Visit brave://settings
  • Click on Rewards
  • Click link in right pane to open Rewards panel
  • Enable Rewards
  • Verify that auto-contribution settings are shown in settings

@emerick emerick requested a review from a team as a code owner November 11, 2021 16:16
@emerick emerick self-assigned this Nov 11, 2021
@emerick emerick force-pushed the rewards-brave-settings-hide-ac-when-bitflyer-active branch 2 times, most recently from 9497ccd to 6c4a0c5 Compare November 11, 2021 21:15

const std::string external_wallet_type =
rewards_service->GetExternalWalletType();
return RespondNow(OneArgument(base::Value(external_wallet_type)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit:

std::string external_wallet_type = rewards_service->GetExternalWalletType();
return RespondNow(OneArgument(base::Value(std::move(external_wallet_type))));

or even:

return RespondNow(OneArgument(base::Value(rewards_service->GetExternalWalletType())));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I went with your second suggestion!

@emerick emerick force-pushed the rewards-brave-settings-hide-ac-when-bitflyer-active branch 2 times, most recently from d416fee to 93989a7 Compare November 12, 2021 04:23
Copy link
Collaborator

@zenparsing zenparsing left a comment

Choose a reason for hiding this comment

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

In this PR, "AC supported" is derived from the "current external wallet type". Although this is status quo, we might want to think about moving away from that and just surfacing "AC supported" as its own thing from the rewards service.

The primary advantage, to me, would be that we could get rid of the idea of "current external wallet type", which isn't really meaningful in the context of an unverified user and breaks down when there are more than one supported external wallet providers.

@emerick emerick force-pushed the rewards-brave-settings-hide-ac-when-bitflyer-active branch 2 times, most recently from 05244f1 to 0dbe895 Compare November 15, 2021 16:57
@emerick emerick added CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS CI/skip-linux labels Nov 15, 2021
@emerick emerick force-pushed the rewards-brave-settings-hide-ac-when-bitflyer-active branch from 0dbe895 to 079dd01 Compare November 15, 2021 20:21
@emerick
Copy link
Contributor Author

emerick commented Nov 15, 2021

Restarting Mac CI (all other platforms passed).

@emerick emerick removed CI/skip-android Do not run CI builds for Android CI/skip-linux CI/skip-ios Do not run CI builds for iOS labels Nov 16, 2021
@emerick
Copy link
Contributor Author

emerick commented Nov 16, 2021

All CI passed, ready to merge.

@emerick emerick merged commit 9f4fda7 into master Nov 16, 2021
@emerick emerick deleted the rewards-brave-settings-hide-ac-when-bitflyer-active branch November 16, 2021 02:27
@emerick emerick added this to the 1.34.x - Nightly milestone Nov 16, 2021
brave-builds pushed a commit that referenced this pull request Nov 16, 2021
@stephendonner
Copy link
Contributor

stephendonner commented Nov 17, 2021

Verified PASSED using

Brave 1.34.20 Chromium: 96.0.4664.45 (Official Build) nightly (64-bit)
Revision 76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947}
OS Windows 10 Version 20H2 (Build 19042.1348)

JP region

  1. clean profile
  2. launched Brave using --rewards-countryid=19024 to simulate running in JP region
  3. opened brave://settings
  4. clicked on Brave Rewards in the left pane
  5. clicked the link in the right pane to open the Rewards panel
  6. clicked on Start using Brave Rewards
  7. clicked Skip for now
  8. clicked Continue
  9. clicked Do it later
  10. dismissed the panel
  11. looked at brave://settings/rewards

Confirmed there was no Auto-Contribution section under Brave Rewards
Additionally, confirmed no A-C on brave://rewards or the tips panel

example example example example
19355-2 19355-5 19355-6 19355-7

Non-JP region

  1. clean profile
  2. launched Brave in en-US region
  3. opened brave://settings
  4. clicked on Brave Rewards in the left pane
  5. clicked the link in the right pane to open the Rewards panel
  6. clicked on Start using Brave Rewards
  7. clicked Skip for now
  8. clicked Continue
  9. clicked Do it later
  10. dismissed the panel
  11. loaded duckduckgo.com and waited for auto-contribution to occur
  12. looked at brave://settings/rewards

Confirmed there was an Auto-Contribution section under Brave Rewards
Additionally, confirmed an auto-contribution was scheduled for duckduckgo.com

example example example example
19355-8 19355-9 19355-10 19355-12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide A-C section in Rewards settings on brave://settings when region is JP
4 participants