Repository navigation
Dynamically update the updates tooltip - #778
Conversation
Instead of removing it as soon as it gets clicked, dynamically update the number of updates left as individual packages get updated. When there are no outdated packages left, the tooltip will disappear. Does not work yet due to what I believe to be different package managers being called.
|
This now actually works (yay!). Something else I'd like to do though is also update the update count when packages are detected to be outdated. This will require an event like |
|
Looks good to me. I haven't had a chance to test it. Is this something you're going to continue working on? Or is it something you'd like to merge now and then do the other part as a separate PR? |
Because only showing it when the Settings View first initialized was boring.
|
@lee-dohm I managed to get the other part working, so I guess so! The update count now shows up whenever updates are available, not only when the Settings View first initializes (because that's just boring). I'll start working on the specs, which knowing me might take a long time. Basic testing (setting |
| expiry: Date.now() + @CACHE_EXPIRY | ||
|
|
||
| for pack in packages | ||
| @emitPackageEvent 'update-available', pack |
There was a problem hiding this comment.
This could also be outdated to match the function name.
Also fix this.showDeprecatedNotification not being defined
|
I'm still planning to take a look at this. This week has been bonkers. I've got it on my todo list for Monday. |
|
This looks good except for the tests that are still marked |
…ates-tooltip # Conflicts: # lib/settings-view.coffee
|
No longer WIP. Specs have been finished. |
…ates-tooltip # Conflicts: # lib/package-updates-status-view.coffee
| packageManager = new PackageManager() | ||
| Promise.all([packageManager.getOutdated(), packageManager.getInstalled()]).then (values) -> | ||
| outdatedPackages = values[0] | ||
| packageManager ?= new PackageManager() # TODO: Why is this needed when the package manager is initialized at the top of the file? |
There was a problem hiding this comment.
Does it error without this?
There was a problem hiding this comment.
All the relevant specs (except the first one) fail because packageManager is null without this line. The first spec seems to correctly get the packageManager from the top of the file. It does not matter which spec you make the first (eg, if you comment out the first spec, then the second spec will run successfully and all others will fail).
Instead of removing the updates tooltip as soon as it gets clicked, dynamically update the number of updates left in the tooltip as individual packages get updated. When there are no outdated packages left, the tooltip will disappear.
Closes #511