Merge lp:~makyo/juju-gui/coords into lp:juju-gui/experimental
Status: | Needs review |
---|---|
Proposed branch: | lp:~makyo/juju-gui/coords |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
37 lines (+7/-0) 2 files modified
app/views/topology/service.js (+3/-0) test/test_environment_view.js (+4/-0) |
To merge this branch: | bzr merge lp:~makyo/juju-gui/coords |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+191034@code.launchpad.net |
Description of the change
Fix initial coordinates for annotated services
As services with annotations have those annotations removed after placement, further updates to the DB were causing them to be treated as new services in a short-circuit || check. They were initially placed at the annotated positions, then re-positioned as default new services on any further updates to the database (e.g.: GetCharm, etc.). This treats them as old services as soon as they've been received by the first delta with their annotations intact by utilizing the already-existing hasBeenPositioned flag which bypasses that check; no more auto-positioning. Asserts added to the appropriate test.
Unmerged revisions
- 1134. By Madison Scott-Clary
-
make prep
- 1133. By Madison Scott-Clary
-
testing hasBeenPositioned.
- 1132. By Madison Scott-Clary
-
Flag to not treat annotated services as new wrt positioning
Reviewers: mp+191034_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix initial coordinates for annotated services
As services with annotations have those annotations removed after
placement, further updates to the DB were causing them to be treated as
new services in a short-circuit || check. They were initially placed at
the annotated positions, then re-positioned as default new services on
any further updates to the database (e.g.: GetCharm, etc.). This treats
them as old services as soon as they've been received by the first delta
with their annotations intact by utilizing the already-existing
hasBeenPositioned flag which bypasses that check; no more
auto-positioning. Asserts added to the appropriate test.
https:/ /code.launchpad .net/~makyo/ juju-gui/ coords/ +merge/ 191034
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/14430061/
Affected files (+9, -0 lines): topology/ service. js environment_ view.js
A [revision details]
M app/views/
M test/test_
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: test/test_ environment_ view.js environment_ view.js' environment_ view.js 2013-10-07 19:38:23 +0000 environment_ view.js 2013-10-14 19:00:03 +0000
db.onDelta( { data: tmp_data });
view.update( ); equal(db. services. getById( 'wordpressa' ).get(' hasBeenPosition ed'),
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -637,8 +637,11 @@
}
]]
};
+ db.reset();
+
assert.
+ true);
@@ -655,6 +658,7 @@
}
]]
};
+ db.reset();
Index: app/views/ topology/ service. js topology/ service. js' topology/ service. js 2013-10-11 20:13:50 +0000 topology/ service. js 2013-10-14 19:07:38 +0000 'useTransitions ') && !fromGhost;
self. drag.call( this, d, self, {x: x, y: y}, useTransitions); set('hasBeenPos itioned' , true);
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -110,6 +110,9 @@
if (!d.inDrag) {
var useTransitions = self.get(
+ // When selecting new services in update this value allows the
+ // filter function to skip over annotated services.
+ d.model.
}
}});