-
Notifications
You must be signed in to change notification settings - Fork 975
Conversation
CommonMenu.bookmarksToolbarMenuItem(), | ||
CommonMenu.separatorMenuItem, | ||
CommonMenu.importBookmarksMenuItem() | ||
CommonMenu.bookmarksToolbarMenuItem() | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is some commented out code here in the menu.js
that I think you can delete, now that you've added import functionality. Search for locale.translation('importFrom')
importer.on('add-homepage', (e, detail) => { | ||
}) | ||
|
||
importer.on('add-bookmarks', (e, bookmarks, topLevelFolder) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this handler has a LOT going on in it... Any chance we could break this (or parts of it) out into a method? Looks generic enough (not dependent on electron) to put into a utils class, which means we could eventually unit test it too 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the handler is for electron dependent bookmarks
object and whole block is meant to handle it specifically. So I am not sure that we can pull out a generic method from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah- makes sense. I'm OK w/ it as-is 😄
|
||
**Parameters** | ||
|
||
**selected**: `object`, the browser data to import as per doc/state.md's importBroserDataSelected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely not a big deal, just a misspelling here:
s/importBroserDataSelected/importBrowserDataSelected
cookies: boolean | ||
} | ||
], | ||
importBroserDataSelected: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, another one:
s/importBroserDataSelected/importBrowserDataSelected
@@ -0,0 +1,108 @@ | |||
/* This Source Code Form is subject to the terms of the Mozilla Public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible to move this to the new directory structure?
https://github.com/brave/browser-laptop/blob/master/docs/directoryStructure.md
So for example, this would move to:
app/renderer/components
Great job on the control 😄
Left some comments... great work 😄 |
Thanks for your feedback, @bsclifton. I've addressed it in ec45bdf. |
@@ -693,3 +693,14 @@ module.exports.clearAutofillData = () => { | |||
ses.autofill.clearAutofillData() | |||
} | |||
} | |||
|
|||
module.exports.setCookie = (cookie) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method should be moved out of filtering and only called on the default session
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed it in 1dee63d.
module.exports.sendToFocusedWindow(BrowserWindow.getAllWindows()[0], [messages.IMPORT_BOOKMARKS]), 100) | ||
}) | ||
return | ||
if (process.type === 'browser') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can avoid this check by making it an appAction
see https://github.com/brave/browser-laptop/blob/master/app/browser/basicAuth.js
@@ -374,6 +376,11 @@ class Main extends ImmutableComponent { | |||
windowActions.setContextMenuDetail() | |||
}) | |||
|
|||
ipc.on(messages.IMPORTER_LIST, (e, detail) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would also be better as an appAction. We want to avoid adding more ipc handlers
@@ -374,6 +376,11 @@ class Main extends ImmutableComponent { | |||
windowActions.setContextMenuDetail() | |||
}) | |||
|
|||
ipc.on(messages.IMPORTER_LIST, (e, detail) => { | |||
windowActions.setImportBrowserDataDetail(detail) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally actions should not be setters, they should describe the actual action. In this case something like appAction.supportedBrowsersUpdated
which would then be handled in the windowStore and should call helper methods to update the state (don't call actions from actions).
@@ -532,6 +539,10 @@ class Main extends ImmutableComponent { | |||
windowActions.setClearBrowsingDataDetail() | |||
} | |||
|
|||
onHideImportBrowserDataPanel () { | |||
windowActions.setImportBrowserDataDetail() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
along the same lines as the previous comment this would be something like windowActions.importDataPanelHidden
1dee63d
to
3b94788
Compare
I will do appAction refactoring in follow-up commit. recorded in #2107 (comment) |
sounds good! Only the |
fix #2107 requires brave/muon#57 Auditors: @bridiver, @bbondy, @bsclifton
3b94788
to
2d91041
Compare
merging! |
git rebase -i
to squash commits (if needed).Test Plan:
fix #428
partial fix #2107
requires brave/muon#57
Auditors: @bridiver, @bbondy, @bsclifton