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

Reorganize ledgerBackup.js #11344

Merged
merged 1 commit into from
Oct 9, 2017
Merged

Reorganize ledgerBackup.js #11344

merged 1 commit into from
Oct 9, 2017

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Oct 7, 2017

Fixes #11332
Closes #11343

  • Remove obsolete styles
  • Split l10n strings to force font-weight: strong (On Transifex HTML tags may be deleted by contributors, which should not happen)
  • Set cursor: text to indicate where you can select the passphrase manually. Since the mouse cursor does not change you often see that the passphrase is not selected, while you though you did.
  • Set the same styles as syncTab.js to avoid possible style inconsistency
  • Split font shorthand to ensure that the styles could be cascaded properly. See: https://github.com/Khan/aphrodite#object-key-ordering

Auditors: @cezaraugusto

Test Plan:

  1. Open about:preferences#payments
  2. Enable Payments
  3. Go to the advanced setting
  4. Click Backup your wallet
  5. Make sure that the cursor changes on the passphrase div

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.

Test Plan:

Reviewer Checklist:

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

ledgerBackupContent: {
// Align the buttons and keys even when the width of the strings is not equal
width: 'max-content',
margin: 'auto',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's not forget to remove what becomes obsolete.


ledgerBackupContent__copyKey__key__phrase: {
// See syncTab.js
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could create a common component to avoid style inconsistency, like PassPhraseContainer.

@codecov-io
Copy link

Codecov Report

Merging #11344 into master will decrease coverage by 0.03%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master   #11344      +/-   ##
==========================================
- Coverage   52.51%   52.47%   -0.04%     
==========================================
  Files         267      267              
  Lines       24982    24983       +1     
  Branches     3997     3997              
==========================================
- Hits        13120    13111       -9     
- Misses      11862    11872      +10
Flag Coverage Δ
#unittest 52.47% <0%> (-0.04%) ⬇️
Impacted Files Coverage Δ
.../payment/addFundsDialog/steps/addFundsBatScreen.js 68.75% <ø> (ø) ⬆️
app/renderer/components/preferences/syncTab.js 17.01% <ø> (ø) ⬆️
...rer/components/preferences/payment/ledgerBackup.js 36.84% <0%> (-1%) ⬇️
js/stores/appStoreRenderer.js 91.17% <0%> (-8.83%) ⬇️
app/renderer/components/reduxComponent.js 84.37% <0%> (-6.25%) ⬇️
js/stores/windowStore.js 27.27% <0%> (-0.31%) ⬇️

@codecov-io
Copy link

codecov-io commented Oct 7, 2017

Codecov Report

Merging #11344 into master will increase coverage by <.01%.
The diff coverage is 25%.

@@            Coverage Diff             @@
##           master   #11344      +/-   ##
==========================================
+ Coverage   52.53%   52.53%   +<.01%     
==========================================
  Files         267      267              
  Lines       24975    24978       +3     
  Branches     3996     3996              
==========================================
+ Hits        13120    13122       +2     
- Misses      11855    11856       +1
Flag Coverage Δ
#unittest 52.53% <25%> (ø) ⬆️
Impacted Files Coverage Δ
app/renderer/components/preferences/syncTab.js 17.01% <ø> (ø) ⬆️
...rer/components/preferences/payment/ledgerBackup.js 36.84% <0%> (-1%) ⬇️
.../payment/addFundsDialog/steps/addFundsBatScreen.js 72.22% <100%> (+3.47%) ⬆️

@luixxiul luixxiul mentioned this pull request Oct 7, 2017
8 tasks
@@ -18,10 +19,13 @@ class BatWelcomeScreen extends React.Component {
className={css(styles.batScreen)}
>
<AboutPageSectionTitle data-canWrap data-l10n-id='helloBat' />
<p data-l10n-id='helloBatText1'
<div data-l10n-id='helloBatText1'
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason why not paragraph?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not really. I just thought I have not seen p many times under app/renderer/components (we have a lot of div and span instead of p) and standardizing would help us to keep consistency.

If it should be left as p, I'll revert them and that's no problem for me :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

ya not sure why but please revert this part, the current way is not semantic

Copy link
Contributor

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

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

lgtm but please see comment

@cezaraugusto
Copy link
Contributor

also heads-up I just merged #11342

Closes #11343

- Remove obsolete styles
- Split l10n strings to force `font-weight: strong`
- Set `cursor: text` to indicate where you can select the passphrase manually. Since the mouse cursor does not change you often see that the passphrase is not selected.
- Set the same styles as `syncTab.js` to avoid possible style inconsistency
- Split font shorthand to ensure that the styles could be cascaded properly. See: https://github.com/Khan/aphrodite#object-key-ordering

Auditors: @cezaraugusto

Test Plan:
1. Open about:preferences#payments
2. Enable Payments
3. Go to the advanced setting
4. Click `Backup your wallet`
5. Make sure that the cursor changes on the passphrase div
@luixxiul
Copy link
Contributor Author

luixxiul commented Oct 9, 2017

@cezaraugusto reverted! would you please check again and merge this one if it looks good to you?

Copy link
Contributor

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

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

++ thanks!

@cezaraugusto cezaraugusto merged commit 1bb8ff1 into brave:master Oct 9, 2017
@cezaraugusto cezaraugusto deleted the polish-addfunds-dialog branch October 9, 2017 14:06
@luixxiul
Copy link
Contributor Author

luixxiul commented Oct 9, 2017

@cezaraugusto would you please merge this to 0.19.x and 0.20.x as well? I'm not quite sure how to and feel I would break the branches. thanks!

@cezaraugusto
Copy link
Contributor

I'm doing it now

cezaraugusto added a commit that referenced this pull request Oct 9, 2017
cezaraugusto added a commit that referenced this pull request Oct 9, 2017
@cezaraugusto
Copy link
Contributor

master 1bb8ff1
0.20.x b1f8771
0.19.x 0f118dc

@luixxiul
Copy link
Contributor Author

luixxiul commented Oct 9, 2017

thanks! 🙏

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.

3 participants