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

Finished Aphrodite restyle of safebrowsing.js. Fixes issue #9025 #13592

Merged
merged 1 commit into from
May 10, 2018
Merged

Finished Aphrodite restyle of safebrowsing.js. Fixes issue #9025 #13592

merged 1 commit into from
May 10, 2018

Conversation

jasonrsadler
Copy link
Contributor

@jasonrsadler jasonrsadler commented Mar 25, 2018

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:

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

Finishes restyle to Aphrodite. Eliminates dependency to 'less' files.
Requesting Review @luixxiul @bsclifton
Requesting Security Review @diracdeltas

fixes #9025

@jasonrsadler
Copy link
Contributor Author

Cleaning up open PRs

}

onAdvancedToggle () {
onAdvancedToggle = () => {
Copy link
Member

Choose a reason for hiding this comment

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

why was this changed?

Copy link
Contributor Author

@jasonrsadler jasonrsadler May 8, 2018

Choose a reason for hiding this comment

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

To prevent having to call .bind from each usage (at the time, anticipated future use).

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.

nice work, comments left

(baseSelector.includes(GLOBALS) ? generateSubtreeStyles(selector) : null)
}

export const childSelector = (selector) => {
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 is a leftover. Is this being used elsewhere?

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. that's a leftover with no cleanup. Removing childSelector

fontWeight: 400,
margin: 0,
padding: 0
},
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we usually add an extra line break between properties when dealing with styles

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I saw that on the styling guidelines after the fact. Done.

[GLOBALS]: {
'*': {
color: globalStyles.color.commonTextColor,
fontFamily: 'Helvetica Neue, Arial, sans-serif',
Copy link
Contributor

Choose a reason for hiding this comment

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

we can replace it with -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", sans-serif; which is the default font set for our app

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}
}
})
export default extended.css(styles[GLOBALS])
Copy link
Contributor

Choose a reason for hiding this comment

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

for parity with other exports we use I think it's preferable to use Node.js module.export utility instead of ES6's so module.exports = extended.css(styles[GLOBALS]) would be better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Done.


class SafebrowsingPage extends React.Component {
constructor (props) {
super(props)
this.state = {
advanced: false
}
let headDiv = document.querySelector('#appContainer')
Copy link
Contributor

Choose a reason for hiding this comment

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

consulting the DOM in React has its cost and we could avoid this by adding a new <div> with the same CSS properties and result is the same i.e.

render () {
  return <div className={css(styles.appContainer)}> 
    <div className={css(styles.error__content)} data-test-id='errorContent'>
      ...stuff
    </div>
</div>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Done.

},
'html, body, #appContainer, #appContainer > div': {
height: '100%'
},
Copy link
Contributor

@cezaraugusto cezaraugusto May 10, 2018

Choose a reason for hiding this comment

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

same as above comment regarding line-break

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one I might need your help understanding.

@jasonrsadler jasonrsadler requested a review from cezaraugusto May 10, 2018 02:38
@jasonrsadler
Copy link
Contributor Author

@cezaraugusto Thank you. Updated with corrections.

@cezaraugusto cezaraugusto added this to the Completed work milestone May 10, 2018
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.

++

@cezaraugusto cezaraugusto merged commit e278ba6 into brave:master May 10, 2018
@jasonrsadler jasonrsadler deleted the safe-browsing-aphrodite-refactor branch May 10, 2018 02:52
@bsclifton bsclifton modified the milestones: Completed work, 0.23.x (Developer Channel) May 10, 2018
bsclifton pushed a commit that referenced this pull request May 10, 2018
…efactor

Finished Aphrodite restyle of safebrowsing.js. Fixes issue #9025
@bsclifton
Copy link
Member

master e278ba6
0.23.x 688f8f9

@bsclifton
Copy link
Member

bsclifton commented May 10, 2018

@jasonrsadler @cezaraugusto after talking with @NejcZdovc, I uplifted this to 0.23.x to avoid getting ourselves into a nasty merge conflict type situation (like we had in the past when cherry picking commits to older releases)

@cezaraugusto cezaraugusto added polish Nice to have — usually related to front-end/visual tasks. QA/no-qa-needed labels May 10, 2018
@cezaraugusto
Copy link
Contributor

Labeled as no-qa-needed as no functionality was added and no design was changed. Thanks all

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
polish Nice to have — usually related to front-end/visual tasks. QA/no-qa-needed refactoring/aphrodite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor safebrowsing.js with Aphrodite
5 participants