Merge lp://qastaging/~hatch/juju-gui/unit-breakout-1253114 into lp://qastaging/juju-gui/experimental
Proposed by
Jeff Pihach
Status: | Merged |
---|---|
Merged at revision: | 1221 |
Proposed branch: | lp://qastaging/~hatch/juju-gui/unit-breakout-1253114 |
Merge into: | lp://qastaging/juju-gui/experimental |
Diff against target: |
150 lines (+55/-49) 2 files modified
app/views/databinding.js (+54/-49) app/views/viewlets/unit-details.js (+1/-0) |
To merge this branch: | bzr merge lp://qastaging/~hatch/juju-gui/unit-breakout-1253114 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email:
|
Description of the change
Add support to mix in delayed delta changes
Due to a race condition the unit details view would sometimes not update
as per the databinding because there were some deltas which had not yet
been applied. This adds the functionality to mix these deltas in or
filter by them as was the previous functionality.
To post a comment you must log in.
Reviewers: mp+197619_ code.launchpad. net,
Message:
Please take a look.
Description:
Add support to mix in delayed delta changes
Due to a race condition the unit details view would sometimes not update
as per the databinding because there were some deltas which had not yet
been applied. This adds the functionality to mix these deltas in or
filter by them as was the previous functionality.
To QA:
In sandbox deploy service with 10 units, wait a minute or so for a
number
of deltas to come through. Then start clicking on units in the inspector
unit list to display the details, after viewing about 50 units if you
haven't
seen the unit details header unpopulated it's safe to assume that the
issue is resolved.
https:/ /code.launchpad .net/~hatch/ juju-gui/ unit-breakout- 1253114/ +merge/ 197619
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/36850043/
Affected files (+24, -11 lines): databinding. js viewlets/ unit-details. js
A [revision details]
M app/views/
M app/views/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: app/views/ databinding. js databinding. js' databinding. js 2013-10-11 03:18:33 +0000 databinding. js 2013-12-03 22:42:52 +0000
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -155,12 +155,15 @@
@method deltaFromChange (modelChangeKey s) { (modelChangeKey s, mixin) {
result. wildcards = indexBindings( bindings, function(binding) {
@param {Array} modelChangeKeys array of {String} keys that have
changed.
+ @param {Boolean} mixin if you want to mix the modelChangeKeys into
the
+ changed value list or filter to use only those bindings. Default
false.
@return {Array} bindings array filtered by keys when present.
*/
- function deltaFromChange
+ function deltaFromChange
/* jshint -W040 */
// Ignore 'possible strict violation'
var bindings = this._bindings;
+ mixin = mixin || false;
var result = {bindings: [], wildcards: {}};
// Handle wildcards.
@@ -172,19 +175,26 @@
if (modelChangeKeys !== undefined && modelChangeKeys .length !== 0) { filter( function( binding) { s.indexOf( binding. name.split( '.')[0] ) >
// In this branch of the the conditional, we only have a specific
set
- // of keys that have changed, so we want to limit the resulting
+ // of keys that have changed, so we may want to limit the resulting
// bindings appropriately.
- // Find the bindings that match the modelChangeKeys.
- var filteredBindings = bindings.
- // Change events don't honor nested key paths. This means
- // we may update bindings that impact multiple DOM nodes
- // (our granularity is too low).
- return (modelChangeKey
-1);
- });
+ var filteredBindings;
+ if (mixin) {
+ filteredBindings = bindings;
+ ...