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

Converts ImportBrowserDataPanel into redux component #9485

Merged
merged 1 commit into from Jun 17, 2017

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Jun 15, 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 #9442

Auditors: @bsclifton @bridiver

Test Plan:

  • try to import all possible options from all browsers
  • try if browser selection is working
  • try if you can toggle all options

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 15, 2017
@NejcZdovc NejcZdovc self-assigned this Jun 15, 2017
@NejcZdovc NejcZdovc force-pushed the redux/importBrowserDataPanel branch 7 times, most recently from 7a4ed0e to fe19bdb Compare June 15, 2017 10:36
@NejcZdovc NejcZdovc mentioned this pull request Jun 15, 2017
51 tasks
Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

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

I manually test this PR with toggling the option off and it couldn't.
it shows

windowStore.js:548 Uncaught TypeError: action.selected.forEach is not a function

@NejcZdovc
Copy link
Contributor Author

Let me try it again, it was working correctly for me when I was testing it

@NejcZdovc
Copy link
Contributor Author

@darkdh can you please try again

props.browserNames = importBrowserDataDetail.map((browser) => browser.get('name'))
props.browserIndexes = importBrowserDataDetail.map((browser) => browser.get('index'))
props.isSupportingHistory = currentBrowser.get('history', false)
props.isSupportingFavourites = currentBrowser.get('favorites', false)
Copy link
Member

Choose a reason for hiding this comment

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

s/Favourites/Favorites/

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 importBrowserDataSelected = currentWindow.get('importBrowserDataSelected', Immutable.Map())
const importBrowserDataDetail = currentWindow.get('importBrowserDataDetail', Immutable.Map())
const index = importBrowserDataSelected.get('index', '0')
const currentBrowser = importBrowserDataDetail.get(index, Immutable.Map())
Copy link
Member

Choose a reason for hiding this comment

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

currentSelectedBrowser 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.

Done

data.favorites = this.props.favorites
data.history = this.props.history

if (this.props.type != null) {
Copy link
Member

Choose a reason for hiding this comment

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

we can remove this check. type will always has value which comes from muon.

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


componentWillMount () {
if (this.props.selectedIndex == null) {
windowActions.setImportBrowserDataSelected(0)
Copy link
Member

Choose a reason for hiding this comment

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

nice cleanup

}

componentWillMount () {
if (this.props.selectedIndex == null) {
Copy link
Member

Choose a reason for hiding this comment

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

I think this check can be removed. Is there any case it will have value when componentWillMount being called?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would leave it

@NejcZdovc NejcZdovc requested a review from darkdh June 17, 2017 13:21
@NejcZdovc NejcZdovc force-pushed the redux/importBrowserDataPanel branch from 2243e9b to 701c9b4 Compare June 17, 2017 13:21
Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

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

++

@NejcZdovc NejcZdovc merged commit c5968c5 into brave:master Jun 17, 2017
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.

None yet

3 participants