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

Removing sites from history - siteUtil functionality #1856

Closed
snird opened this issue May 21, 2016 · 1 comment
Closed

Removing sites from history - siteUtil functionality #1856

snird opened this issue May 21, 2016 · 1 comment

Comments

@snird
Copy link

snird commented May 21, 2016

Test plan

#10136 (comment)


Coming to implement #1458 , I needed a way to remove a site from history.
Currently, on the siteUtil state, there is a function called removeSite, for convenience, here is it:

module.exports.removeSite = function (sites, siteDetail, tag) {
  const index = module.exports.getSiteIndex(sites, siteDetail, tag)
  if (index === -1) {
    return sites
  }
  const tags = sites.getIn([index, 'tags'])
  return sites.setIn([index, 'tags'], tags.toSet().remove(tag).toList())
}

It currently only removes tags from sites in the list (such as bookmark tag, which is the main thing this function is used for now, removing bookmarks).

sites without tags are sites saved in history, so there are these possibilities I had in mind, but I wanted someone who has a better grasp of the code to tell me which seems to be the best:

  • Add the functionality of removing a site from history to this function, when there is not tag specified. This effectively makes the function have two responsibilities.
  • Add a new function removeHistorySite that removes sites without tags from the map, but have the chance of being confusing in the future (naming)
  • Refactor the current removeSite name to be removeTag, and make the removeSite function removes sites without tags from the map.

Sorry for being a hard to deal with contributor (:

@NejcZdovc
Copy link
Contributor

NejcZdovc commented Jul 20, 2017

This will be resolved in #10136, where we split sites object and it should be easy to manipulate history now.

@NejcZdovc NejcZdovc self-assigned this Jul 20, 2017
@NejcZdovc NejcZdovc added this to the 0.20.x (Developer Channel) milestone Jul 20, 2017
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Jul 22, 2017
Resolves brave#1856
Resolves brave#2771
Resolves brave#3646
Resolves brave#3694
Resolves brave#4224
Resolves brave#4260
Resolves brave#4833
Resolves brave#4868
Resolves brave#4929
Resolves brave#5699
Resolves brave#6104
Resolves brave#6108
Resolves brave#6585
Resolves brave#8022
Resolves brave#9301
Resolves brave#9326
Resolves brave#9978
Resolves brave#10026

Auditors:

Test Plan:
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Jul 22, 2017
Resolves brave#1856
Resolves brave#2771
Resolves brave#3646
Resolves brave#3694
Resolves brave#4224
Resolves brave#4260
Resolves brave#4833
Resolves brave#4868
Resolves brave#4929
Resolves brave#5699
Resolves brave#6104
Resolves brave#6108
Resolves brave#6585
Resolves brave#8022
Resolves brave#9301
Resolves brave#9326
Resolves brave#9978
Resolves brave#10026

Auditors:

Test Plan:
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Jul 25, 2017
Resolves brave#1856
Resolves brave#2771
Resolves brave#3646
Resolves brave#3694
Resolves brave#4224
Resolves brave#4260
Resolves brave#4833
Resolves brave#4868
Resolves brave#4929
Resolves brave#5699
Resolves brave#6104
Resolves brave#6108
Resolves brave#6585
Resolves brave#8022
Resolves brave#9301
Resolves brave#9326
Resolves brave#9978
Resolves brave#10026

Auditors:

Test Plan:
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Jul 25, 2017
Resolves brave#1856
Resolves brave#2771
Resolves brave#3646
Resolves brave#3694
Resolves brave#4224
Resolves brave#4260
Resolves brave#4833
Resolves brave#4868
Resolves brave#4929
Resolves brave#5699
Resolves brave#6104
Resolves brave#6108
Resolves brave#6585
Resolves brave#8022
Resolves brave#9301
Resolves brave#9326
Resolves brave#9978
Resolves brave#10026

Auditors:

Test Plan:
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Jul 25, 2017
Resolves brave#1856
Resolves brave#2771
Resolves brave#3646
Resolves brave#3694
Resolves brave#4224
Resolves brave#4260
Resolves brave#4833
Resolves brave#4868
Resolves brave#4929
Resolves brave#5699
Resolves brave#6104
Resolves brave#6108
Resolves brave#6585
Resolves brave#8022
Resolves brave#9301
Resolves brave#9326
Resolves brave#9978
Resolves brave#10026

Auditors:

Test Plan:
NejcZdovc added a commit to NejcZdovc/browser-laptop that referenced this issue Jul 26, 2017
Resolves brave#1856
Resolves brave#2771
Resolves brave#3646
Resolves brave#3694
Resolves brave#4224
Resolves brave#4260
Resolves brave#4833
Resolves brave#4868
Resolves brave#4929
Resolves brave#5699
Resolves brave#6104
Resolves brave#6108
Resolves brave#6585
Resolves brave#8022
Resolves brave#9301
Resolves brave#9326
Resolves brave#9978
Resolves brave#10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Jul 27, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Jul 27, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Jul 27, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Jul 28, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Jul 28, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Jul 28, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Jul 31, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Jul 31, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Aug 1, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
NejcZdovc added a commit that referenced this issue Aug 3, 2017
Resolves #1856
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5699
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
@NejcZdovc NejcZdovc modified the milestones: 0.21.x (Nightly Channel), 0.20.x (Developer Channel) Aug 4, 2017
NejcZdovc added a commit that referenced this issue Aug 4, 2017
Resolves #1646
Resolves #1856
Resolves #2655
Resolves #2771
Resolves #3646
Resolves #3694
Resolves #4224
Resolves #4260
Resolves #4833
Resolves #4868
Resolves #4929
Resolves #5072
Resolves #5699
Resolves #5382
Resolves #6104
Resolves #6108
Resolves #6585
Resolves #8022
Resolves #9301
Resolves #9326
Resolves #9978
Resolves #10026

Auditors:

Test Plan:
dfperry5 pushed a commit to dfperry5/browser-laptop that referenced this issue Aug 18, 2017
Resolves brave#1646
Resolves brave#1856
Resolves brave#2655
Resolves brave#2771
Resolves brave#3646
Resolves brave#3694
Resolves brave#4224
Resolves brave#4260
Resolves brave#4833
Resolves brave#4868
Resolves brave#4929
Resolves brave#5072
Resolves brave#5699
Resolves brave#5382
Resolves brave#6104
Resolves brave#6108
Resolves brave#6585
Resolves brave#8022
Resolves brave#9301
Resolves brave#9326
Resolves brave#9978
Resolves brave#10026

Auditors:

Test Plan:
@bbondy bbondy modified the milestones: 0.21.x (Developer Channel), 0.20.x (Beta Channel) Oct 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.