-
Notifications
You must be signed in to change notification settings - Fork 974
Add "forget this domain" feature #12754
Add "forget this domain" feature #12754
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12754 +/- ##
==========================================
+ Coverage 56.09% 56.27% +0.18%
==========================================
Files 279 278 -1
Lines 27307 27610 +303
Branches 4443 4500 +57
==========================================
+ Hits 15318 15538 +220
- Misses 11989 12072 +83
|
@@ -4,6 +4,7 @@ | |||
|
|||
const Immutable = require('immutable') | |||
const BrowserWindow = require('electron').BrowserWindow | |||
const {URL} = require('url') |
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.
please use app/common/urlParse.js
instead
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.
Will do! I'll also use useParse
here to keep it consistent
break | ||
} | ||
|
||
historyState.getSites(state).forEach(something => { |
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.
please use a descriptive variable name like historySite
instead of something
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.
Oh woops, forgot I left that in there. Nice catch!
@@ -350,6 +361,83 @@ describe('historyReducer unit test', function () { | |||
}) | |||
}) | |||
|
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.
thanks for adding tests!
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.
see above
closes brave#3948 This adds an item to the context menu for a url on the about:history page to remove all sites for the selected domain from the history list. Auditors: Test Plan:
f67545c
to
c12b3e7
Compare
@diracdeltas up for another review? I also wasn't sure what to do with the translations - I was unable to find info around this. I have left the text inline, but any guidance on this is appreciated |
@AlexRobinson- If you want to localize the text, here are the steps:
Here's an example: https://github.com/brave/browser-laptop/pull/13010/files. |
} | ||
|
||
historyState.getSites(state).forEach(historySite => { | ||
if (urlParse(historySite.get('location')).hostname === domain) { |
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.
should probably check that urlParse(historySite.get('location'))
is non-falsey
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.
it seems urlParse
always returns an object
https://github.com/brave/browser-laptop/blob/master/app/common/urlParse.js#L19
So it should always be non-falsey
Would you still prefer a check in there? If so should we display any errors to the user? Or just ignore the fail and do nothing?
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.
Any thoughts on this @diracdeltas
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.
nvm original comment
js/contextMenus.js
Outdated
template.push({ | ||
label: 'Delete Domain from History', | ||
click: () => { | ||
const domain = urlParse(siteDetail.get('location')).hostname |
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.
same as above
js/contextMenus.js
Outdated
@@ -356,6 +356,14 @@ const siteSingleDetailTemplate = (siteKey, type, activeFrame) => { | |||
} | |||
} | |||
}) | |||
|
|||
template.push({ | |||
label: 'Delete Domain from History', |
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.
see @liunkae's comment above about localization
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.
works great!
Nice! |
Great job with this, @AlexRobinson- ! Huge thanks for covering the work with a test 😄 Let me know if you'd like to grab another issue |
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.
Looks like there's a trailing space in there (I'm guessing you're on Windows 😄 ). Can you run npm run lint
and fix the line identified? Other than that, looks great!
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.
Disregard my previous review- must have been a bug on Travis' part (see https://travis-ci.org/brave/browser-laptop/jobs/342211676). I pulled your fork and it works great 😄
Definitely not on Windows! shudder front end development has been so much smoother since moving to a mac I'm excited to see this go through! Thank you for all of the help getting it through as well. I'll consider picking up another task soon 😄 |
@AlexRobinson- awesome 😄 Feel free to shoot me an email at clifton@brave.com and I'd be glad to help |
closes #3948
👋 Hey everyone, first time making a PR here. I was unsure what to put in the
Test Plan
section, any help there is appreciate.This adds an item to the context menu for a url on the about:history page to remove all sites for the selected domain from the history list.
What it Looks Like:
Auditors:
Test Plan:
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests