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

Refactor siteInfo.js with Aphrodite #7985

Merged
merged 1 commit into from
Apr 6, 2017
Merged

Refactor siteInfo.js with Aphrodite #7985

merged 1 commit into from
Apr 6, 2017

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Mar 30, 2017

Closes #7949

Also modify messageBox.js, which was introduced with #7107

  • Introduced globalStyles.spacing.dialogInsideMargin
    As the marginTop of title and marginBottom of buttons on messageBox.js had been set to 0.5em, I removed and added them to padding of flyoutDialog. The vaule was calculated this way: calc(10px + 0.5rem) = 18px. Also I applied it to the elements inside messageBox.js

  • Aligned the buttons to the right (same as messageBox.js)

  • Introduced siteInfo__wrapper__large
    As the buttons on mixed content info dialog are so huge that sometimes they are wrapped, epecially on foreign language like Japanese. This is a temporary workaround to avoid it.

  • Moved 'denyRunInsecureContent' button to the right to improve UX

  • Updated automated test code

Auditors:

Test Plan:

  1. Open https://apple.com
  2. Click the lock icon on the URL bar
  3. Make sure the title and description are aligned
  4. Make sure the button is aligned to the right
  5. Open http://apple.com
  6. Click the unlock icon on the URL bar
  7. Make sure the title and description are aligned
  8. Open https://mixed-script.badssl.com
  9. Click the lock icon
  10. Make sure the buttons are aligned to the right and they are not wrapped
  11. Click "Load Unsafe Script"
  12. Click the unlock icon on the URL bar
  13. Click "Stop Loading Unsafe Script"
  14. Visit http://jsbin.com/fiyojusahu/edit?html,output
  15. Make sure the elements are aligned well
  16. Visit http://jsbin.com/sadunogefu/edit?html,output
  17. Make sure the switch next to "Prevent this page from creating additional dialogs" is aligned with the body text
  • 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).

Test Plan:

@luixxiul
Copy link
Contributor Author

luixxiul commented Mar 30, 2017

screenshot 2017-03-30 15 54 49

screenshot 2017-03-30 15 54 59

screenshot 2017-03-30 15 55 10

screenshot 2017-03-30 15 55 21

Note: on the last two dialogs the text is not aligned to the buttons but it is just because the word is not broken. With word-break: break-all,

screenshot 2017-03-30 16 00 51

position: 'absolute'
},
secureIcon__extendedValidation: {
color: 'green'
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change this to HEX

Copy link
Contributor Author

Choose a reason for hiding this comment

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

[css(styles.secureIcon__fa)]: true
})} />
<span className={css(styles.secureIcon__label)}
data-test-id='insecureconnection'
Copy link
Contributor

Choose a reason for hiding this comment

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

change to insecureConnection

<div className={css(styles.flexJustifyEnd, styles.viewCertificateButton__wrapper)}>
<Button l10nId='viewCertificate'
className='primaryButton'
data-test-id='viewCertificate'
Copy link
Contributor

Choose a reason for hiding this comment

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

data-test-id -> testId

<div className={css(styles.flexJustifyEnd, styles.viewCertificateButton__wrapper)}>
<Button l10nId='allowRunInsecureContent'
className='whiteButton'
data-test-id='allowRunInsecureContentButton'
Copy link
Contributor

Choose a reason for hiding this comment

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

data-test-id -> testId

/>
<Button l10nId='dismissAllowRunInsecureContent'
className='primaryButton'
data-test-id='dismissAllowRunInsecureContentButton'
Copy link
Contributor

Choose a reason for hiding this comment

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

data-test-id -> testId

<div className={css(styles.flexJustifyEnd, styles.viewCertificateButton__wrapper)}>
<Button l10nId='dismissDenyRunInsecureContent'
className='whiteButton'
data-test-id='dismissDenyRunInsecureContentButton'
Copy link
Contributor

Choose a reason for hiding this comment

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

data-test-id -> testId

/>
<Button l10nId='denyRunInsecureContent'
className='primaryButton'
data-test-id='denyRunInsecureContentButton'
Copy link
Contributor

Choose a reason for hiding this comment

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

data-test-id -> testId

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.

Just needs to update per @NejcZdovc feedback since some tests are failing due to that. Otherwise LGTM.

Closes #7949

Also modify messageBox.js, which was introduced with #7107

- Introduced globalStyles.spacing.dialogInsideMargin
  As the marginTop of title and marginBottom of buttons on messageBox.js had been set to 0.5em, I removed and added them to padding of flyoutDialog. The vaule was calculated this way: calc(10px + 0.5rem) = 18px. Also I applied it to the elements inside messageBox.js

- Aligned the buttons to the right (same as messageBox.js)

- Introduced siteInfo__wrapperLarge
  As the buttons on mixed content info dialog are so huge that sometimes they are wrapped, epecially on foreign language like Japanese. This is a temporary workaround to avoid it.

- Moved 'denyRunInsecureContent' button to the right to improve UX

- Updated automated test code

Auditors:

Test Plan:
1. Open https://apple.com
2. Click the lock icon on the URL bar
3. Make sure the title and description are aligned
4. Make sure the button is aligned to the right
5. Open http://apple.com
6. Click the unlock icon on the URL bar
7. Make sure the title and description are aligned
8. Open https://mixed-script.badssl.com
9. Click the lock icon
10. Make sure the buttons are aligned to the right and they are not wrapped
11. Click "Load Unsafe Script"
12. Click the unlock icon on the URL bar
13. Click "Stop Loading Unsafe Script"
14. Visit http://jsbin.com/fiyojusahu/edit?html,output
15. Make sure the elements are aligned well
16. Visit http://jsbin.com/sadunogefu/edit?html,output
17. Make sure the switch next to "Prevent this page from creating additional dialogs" is aligned with the body text
@luixxiul luixxiul changed the base branch from master to refactoring-aphrodite April 6, 2017 09:19
@NejcZdovc
Copy link
Contributor

NejcZdovc commented Apr 6, 2017

@luixxiul can we merge this, because I need this PR to start working on something new. I noticed that you changed base branch, so not sure if I can merge it or not

@luixxiul
Copy link
Contributor Author

luixxiul commented Apr 6, 2017

OK, I'm going to change the base branch as this does not depend on another PR of mine.

@luixxiul luixxiul changed the base branch from refactoring-aphrodite to master April 6, 2017 15:27
@luixxiul
Copy link
Contributor Author

luixxiul commented Apr 6, 2017

@NejcZdovc Done! If LGTM, please ping me, thanks!

@NejcZdovc
Copy link
Contributor

@luixxiul LGTM, so you can merge it

@luixxiul luixxiul merged commit 4337315 into brave:master Apr 6, 2017
@luixxiul luixxiul deleted the siteInfo-refactoring branch April 6, 2017 18:38
@luixxiul luixxiul removed the request for review from bsclifton April 9, 2017 12:01
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