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

Removes non-primitive types from TabPage #9794

Merged
merged 1 commit into from
Jul 5, 2017

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Jun 30, 2017

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.

Resolves #9793

Auditors: @bsclifton @bridiver

Test Plan:

  • create two tap pages
  • open youtube video in both tab pages
  • right click on a tab page and try to mute/unmute
  • try to close the whole tab page

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

@NejcZdovc NejcZdovc added this to the 0.19.x (Nightly Channel) milestone Jun 30, 2017
@NejcZdovc NejcZdovc self-assigned this Jun 30, 2017
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.

Comments left- otherwise looks good 😄

}]

const tabPageMenu = Menu.buildFromTemplate(template)
tabPageMenu.popup(getCurrentWindow())
Copy link
Member

Choose a reason for hiding this comment

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

Would be great to have a unit test that ensures when windowConstants.WINDOW_ON_TAB_PAGE_MENU happens that electron.remote.Menu.buildFromTemplate fires and that popup is called on the instance that it returns 😄

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


const frames = frameStateUtil.getNonPinnedFrames(state) || Immutable.List()
const tabsPerPage = Number(getSetting(settings.TABS_PER_PAGE))
const tabPageFrames = frames.slice(action.get('index') * tabsPerPage, (action.get('index') * tabsPerPage) + tabsPerPage)
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to read action.get('index') into a variable and skip processing if:

  • index is null /undefined
  • index is out of bounds (negative value, over the max number of tab pages)

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

@NejcZdovc NejcZdovc requested a review from bsclifton July 4, 2017 08:28
@NejcZdovc NejcZdovc force-pushed the refactor/#9793-tabpage branch 2 times, most recently from ce69e5f to 28baeee Compare July 4, 2017 08:33
@NejcZdovc
Copy link
Contributor Author

@bsclifton can we merged this one?

Copy link
Collaborator

@bridiver bridiver left a comment

Choose a reason for hiding this comment

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

++

@@ -69,6 +70,15 @@ class TabPage extends React.Component {
e.preventDefault()
}

onContextMenu (e) {
e.stopPropagation()
windowActions.onTabPageMenu(this.props.index)
Copy link
Collaborator

Choose a reason for hiding this comment

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

just a nit, but I think windowActions. onTabPageContextMenu would be better 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.

done

@NejcZdovc NejcZdovc merged commit ee7e6da into brave:master Jul 5, 2017
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.

++ great job w/ tests 😄

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.

Only primitives in TabPage
3 participants