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 Brave Rewards button #1552

Merged
merged 1 commit into from
Feb 7, 2019
Merged

Conversation

mkarolin
Copy link
Collaborator

@mkarolin mkarolin commented Feb 1, 2019

  • Adds a new setting "Hide Brave Rewards button" under the Appearance
    section of settings.

  • Modifies BraveActionsContainer to allow hiding the Brave Rewards
    action when the setting is turned on, but only when Brave Rewards is
    disabled. Hides the action for Guest sessions.

  • Adds a browser test to verify that the button is hidden when expected.

  • Fixes various lint complaints in the affected files.

Fixes brave/brave-browser#2975

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

Automated testing
npm run test -- brave_browser_tests --filter=BraveActionsContainerTest.HideBraveRewardsAction
npm run test -- brave_browser_tests --filter=BraveActionsContainerTest.BraveRewadsActionHiddenInGuestSession

Manual testing

  1. Test new settings toggle
  • Start Brave browser with a fresh profile and verify that the Brave Rewards action button is shown in the location bar,
  • Navigate to brave://settings and verify that Hide Brave Rewards button toggle is present in the Appearance section,
  • Toggle the setting and verify that the Brave Rewards action button is no longer shown in the location bar,
  • Navigate to brave://rewards and click Yes, I am in button, wait for the rewards page to load,
  • Verify that the Brave Rewards action button is now shown in the location bar,
  • On the brave://rewards page, toggle Brave Rewards setting,
  • Verify that the Brave Rewards action button is no longer shown in the location bar.
  1. Test Guest/Tor profile
  • Start Brave browser with a fresh profile and verify that the Brave Rewards action button is shown in the location bar,
  • Click on the Avatar menu -> Open Guest window,
  • Verify that the Guest window does not show the Brave Rewards action button,
  • Close Guest window,
  • In the original window, click on the Avatar menu -> Open Tor window,
  • Verify that the Tor window does not show the Brave Rewards action button,
  • Close Tor window.

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

- Adds a new setting "Hide Brave Rewards button" under the Appearance
  section of settings.

- Modifies BraveActionsContainer to allow hiding the Brave Rewards
  action when the setting is turned on, but only when Brave Rewards is
  disabled. Hides the action for Guest sessions.

- Adds a browser test to verify that the button is hidden when expected.

- Lint fixes.

Fixes brave/brave-browser#2975
@mkarolin mkarolin force-pushed the maxk-hide-brave-rewards-button branch from 0fec438 to 68bf263 Compare February 4, 2019 21:46
@mkarolin mkarolin changed the title WIP: Hide Brave Rewards button Hide Brave Rewards button Feb 4, 2019
@mkarolin mkarolin added this to the 0.62.x - Nightly milestone Feb 4, 2019
Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Works great - automated tests look really good too. Nice lint cleanup. Great job on this one! 😄 👍

@bsclifton bsclifton merged commit cc865eb into master Feb 7, 2019
@bsclifton bsclifton deleted the maxk-hide-brave-rewards-button branch February 7, 2019 17:17
bsclifton added a commit that referenced this pull request Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a new setting that allows Brave Rewards icon to be hidden when inactive
3 participants