This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Disable update notification for disabled packages#1005
Open
JonatanPaalsson wants to merge 3 commits intoatom:masterfrom
Open
Disable update notification for disabled packages#1005JonatanPaalsson wants to merge 3 commits intoatom:masterfrom
JonatanPaalsson wants to merge 3 commits intoatom:masterfrom
Conversation
Author
|
I'm having some problems writing specs for my implementation. My problem is trying to disable packages. I want to do something similar to: This probably fails because the package is not loaded, however I'm not sure. In a similar way I'm having problem loading this package. If anyone could help me out or point me in some direction I would be very grateful. |
lee-dohm
reviewed
Oct 31, 2017
| } | ||
| } | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
I believe that these two loops can be replaced with:
const updatesWithoutDisabled = this.updates.filter(update => !atom.packages.isPackageDisabled(update.name))
Author
There was a problem hiding this comment.
Thank you, I refactored the code using filter instead of for-loops and no the specs seem to be working.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
The purpose of this pull request is to fix the bug where a notification is given that updates are available even though the package is disabled.
This is done by looking at all the packages in the list
updatesin thepackage-updates-status-view.jsand then temporarily remove all disabled packages from the list when calculating the number of packages that have available updates.A event is also introduced which is triggered by enabling or disabling a package. The purpose of this is so that the user is immediately informed if the package has an available update or it let's Atom know that the user is not interested to know if updates are available for the selected package.
Alternate Designs
An alternative is the remove all the disabled packages from the list
updatescompletely and then add them when the package is enabled. This however would lead to that the packages won't show up in theavailable-updatesview.Benefits
Now all disabled packages will not trigger the update status message that appears in the lower right corner. The status message will also be updated when enabling or disabling a package.
Possible Drawbacks
The function
updateTilebecomes a bit more complex and also have some impact on performance depending on how many packages that are in theupdateslist.Applicable Issues
Fixes #956