Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Escape key now closes Add Funds dialog #13884

Merged
merged 1 commit into from
Apr 26, 2018
Merged

Escape key now closes Add Funds dialog #13884

merged 1 commit into from
Apr 26, 2018

Conversation

jasonrsadler
Copy link
Contributor

@jasonrsadler jasonrsadler commented Apr 21, 2018

Resolves #3800

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).
  • 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. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

    • Enable payments
    • Click 'Add Funds'
    • Press escape key to verify 'Add Funds' dialog closes

    • Enable payments
    • Click 'Add Funds'
    • Choose a currency
    • Press escape key to verify 'Add Funds' dialog closes
    • Click 'Add Funds' and verify that dialog begins at first step

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@codecov-io
Copy link

codecov-io commented Apr 21, 2018

Codecov Report

Merging #13884 into master will decrease coverage by 0.19%.
The diff coverage is 23.4%.

@@            Coverage Diff            @@
##           master   #13884     +/-   ##
=========================================
- Coverage   56.54%   56.35%   -0.2%     
=========================================
  Files         283      283             
  Lines       29036    29148    +112     
  Branches     4824     4828      +4     
=========================================
+ Hits        16419    16426      +7     
- Misses      12617    12722    +105
Flag Coverage Δ
#unittest 56.35% <23.4%> (-0.2%) ⬇️
Impacted Files Coverage Δ
app/renderer/components/preferences/syncTab.js 16.09% <0%> (-1.28%) ⬇️
...ces/payment/addFundsDialog/addFundsDialogFooter.js 17.56% <0%> (-0.75%) ⬇️
app/renderer/components/preferences/paymentsTab.js 65.56% <14.28%> (-2.72%) ⬇️
...components/preferences/payment/advancedSettings.js 76.92% <14.28%> (-23.08%) ⬇️
...r/components/preferences/payment/ledgerRecovery.js 25% <4.34%> (-13%) ⬇️
js/about/preferences.js 57.17% <40%> (-2.44%) ⬇️
...r/components/preferences/payment/enabledContent.js 66.66% <62.5%> (-1.38%) ⬇️
js/stores/appStoreRenderer.js 91.66% <0%> (-8.34%) ⬇️
app/renderer/components/reduxComponent.js 57.75% <0%> (-3.45%) ⬇️
... and 5 more

@jasonrsadler jasonrsadler changed the title Feature/escape key#6248 Escape key now closes Add Funds dialog Apr 21, 2018
Copy link
Contributor

@ryanml ryanml left a comment

Choose a reason for hiding this comment

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

This works well for the payment tab, which satisfies the issue :) However, it does not work for the sync overlays. It seems it was intended to since onEsc was added to preferenceTabs.SYNC. So all you'd have to do is add checks for the syncOverlayVisible state attributes and it should work fine.

On another note, and probably out of scope for this issue, I have a feeling that some refactoring could be done for the overlays so the code/states could be a little more general, then we'd be able to tie 'esc' to close them in one place.

@jasonrsadler
Copy link
Contributor Author

jasonrsadler commented Apr 22, 2018

I agree. It's still a wip and there's something else going on in sync that isn't allowing it to work. Also, it's losing focus on some of the subdialogs if you click the button to go back and then try escape (example go to add funds, pick a currency, then click previous and esc no longer works until you click somewhere on the page.

Sorry, I requested the review but forgot to mark it as WIP

@jasonrsadler jasonrsadler changed the title Escape key now closes Add Funds dialog WIP -- Escape key now closes Add Funds dialog Apr 22, 2018
@jasonrsadler jasonrsadler requested review from ryanml and removed request for NejcZdovc and ryanml April 22, 2018 02:37
@NejcZdovc NejcZdovc changed the title WIP -- Escape key now closes Add Funds dialog Escape key now closes Add Funds dialog Apr 23, 2018
@jasonrsadler
Copy link
Contributor Author

Escape key should now work with all the payments area.

The Sync area is partially implemented with some areas losing focus.

@NejcZdovc
Copy link
Contributor

@jasonrsadler that's fine

@@ -0,0 +1,49 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this file is not needed here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. It's not.

Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

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

  1. Open advance settings
  2. Open backup/recover dialog
  3. Press ESC

Advance settings dialog is closed and not backup/recover dialog

@jasonrsadler
Copy link
Contributor Author

Can you try that again? On mine, when I go to advanced settings, click backup or recover, then press esc, the backup or recover dialog goes away.

@NejcZdovc
Copy link
Contributor

@jasonrsadler it's working now. The only thing that is not working now is

  1. clean profile
  2. click on add funds
  3. click next
  4. press ESC

@NejcZdovc NejcZdovc self-requested a review April 25, 2018 11:40
@jasonrsadler
Copy link
Contributor Author

jasonrsadler commented Apr 25, 2018

Yes. Forgot I left out the intro screen. I'll make sure it's included.

lint

Implemented escape for Add Funds modal overlay

Refactored overlay code in escape sequence and also applied logic to sub

linting. cherry pick on master rebase.

Removed unused file

Changed onBack to onNavigate. Added focuser for Add Funds batWelcome

Implemented esc overlays on Sync
Copy link
Contributor

@ryanml ryanml left a comment

Choose a reason for hiding this comment

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

Test plan works well, sync dialogues are escaping fine

Copy link
Contributor

@NejcZdovc NejcZdovc 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

@NejcZdovc NejcZdovc merged commit 3d3ec33 into brave:master Apr 26, 2018
NejcZdovc added a commit that referenced this pull request Apr 26, 2018
NejcZdovc added a commit that referenced this pull request Apr 26, 2018
@NejcZdovc
Copy link
Contributor

master 3d3ec33
0.23 eb5de93
0.22 6b53911

@NejcZdovc NejcZdovc added this to the 0.22.x Release 3 (Beta channel) milestone Apr 26, 2018
@jasonrsadler jasonrsadler deleted the feature/escape-key#6248 branch April 26, 2018 10:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Escape key not closing add funds dialog
4 participants