-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] return promise from DataService.list #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: console_1.3
Are you sure you want to change the base?
Conversation
…stry - Add angular-extension-registry - TODO: register openshift/angular-extension-registry w/bower & update - Update hawtio javalink extension to new manager - Update online-extensions - Swap java console link icon to fa-share - Update extensions nav-system-status, nav-system-status-mobile, nav-user-dropdown - eliminate documtentation & about link html, register as extension in run block - Move logout link into extension - Style adjustments to needed to position utility nav links
- rename openshiftConsoleExtensions to javaLinkExtension to encourage individual module naming - add /extensions/javalink directory to help encourage extension organization - add hawtioPluginLoader.addModule() back to load module after openshiftConsole bootstraps - fix missing containerStatus check - wrap in IIFE to protect against globals
Use function declarations rather than function expressions when a function is called before defined. This can prevent runtime errors. (The newer jshint is catching these problems.)
URI.expand() returns a URI instance rather than a string, which causes later errors passing query parameters in the $http config object. https://medialize.github.io/URI.js/docs.html#static-expand
`pod-count` class is no longer used in donut title.
Fix UI e2e test failure
Add network metrics to pod page on console
Warn users when navigating away with the terminal window open
Fix httpGet path in pod template
Fix usage rate calculation for network metrics in pod page
Update humanizeKind filter to use lowercase by default
Confirm project delete by typing project name
Edit routes in web console
Changing copy to clipboard button to an input + button
API discovery in the console
…ff in your project
Other resources page
Enabling WebHooks from console will add Generic webhook
Web console support for JenkinsPipeline builds
|
||
var deferred = $q.defer(); | ||
var promises = this._listPromises(resource, context); | ||
promises.push(deferred); | ||
|
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.
How do you feel about hiding away some of the details here to make the flow a little easier:
var key = this._uniqueKeyForResourceContext(resource, context);
// currently we are inferring 'cached' from _watchInFlight and _resourceVersion
if(this.cached(key)) {
this.fireCallbacks(this._data(key));
deferred.resolve(this._data(key));
}
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.
agree its more readable but thats a significantly bigger refactor across this file to change all those method signatures to one param instead of two, to me its not worth the added regression risk, but I'm open to other opinions @spadgett @liggitt
i'd be ok with just adding a cached(resource, context)
that does the checks for watchInFlight and resourceVersion, i think that is your biggest concern right? that its not obvious what watchInFlight && resourceVersion is actually checking.
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.
Yeah, just making DataService as friendly as possible since its the brains behind everything. I'm good with ignoring that for later, Ill make a mental note and may PR it as a tech debt thing down the road.
pushed some updates |
Cool, looks good! |
145b910
to
536125d
Compare
Commenting about the watch/promise deal because I agree its worth tinkering a bit. Would be nice to update .watch() to look more like .get(), etc: DataService
.get('stuff')
.then(function(data) {
// yay
}, function() {
// boo :(
});
DataService
.watch('stuff')
.event(function(evt) {
// yay
}, function(error) {
// boo :(
}); .event() seems meaningful in websocket lingo, dunno if anyone else has thoughts. The trick is just ensuring that .event() has a queue internally (like a promise) rather than just accepting a single callback. Prob is worth investigating as a separate PR as well, though. UPDATE: the streamer is sort of a facade for a promise as well: DataService
.createStream('foo')
.onMessage(function() {
// yay
})
// uh oh, deviant!
.onError(function() {}) |
No description provided.