Merge lp:~makyo/juju-gui/sub-rel-counter-1107999 into lp:juju-gui/experimental
Proposed by
Madison Scott-Clary
Status: | Merged |
---|---|
Merged at revision: | 355 |
Proposed branch: | lp:~makyo/juju-gui/sub-rel-counter-1107999 |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
144 lines (+52/-34) 2 files modified
app/views/topology/relation.js (+3/-5) test/test_environment_view.js (+49/-29) |
To merge this branch: | bzr merge lp:~makyo/juju-gui/sub-rel-counter-1107999 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+145217@code.launchpad.net |
Description of the change
Correctly count subordinate relations
Subordinate relations were not being properly counted with the new comparison when it came to new services or relations. This was due to object inequality after a component's update method was called. Comparison switched to service modelIds, and test added.
To post a comment you must log in.
Reviewers: mp+145217_ code.launchpad. net,
Message:
Please take a look.
Description:
Correctly count subordinate relations
Subordinate relations were not being properly counted with the new
comparison when it came to new services or relations. This was due to
object inequality after a component's update method was called.
Comparison switched to service modelIds, and test added.
https:/ /code.launchpad .net/~makyo/ juju-gui/ sub-rel- counter- 1107999/ +merge/ 145217
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/7234048/
Affected files: topology/ relation. 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-01-25 12:05:33 +0000 environment_ view.js 2013-01-28 18:14:07 +0000
[' service' , 'add', {
'subordinate' : true,
'endpoints' :
[['wordpress' , {'role': 'server', 'name': 'juju-info'}],
['puppet2' , {'role': 'client', 'name': 'juju-info'}]], 0000000007' 0000000008' 0000000009'
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -193,7 +193,7 @@
db: db,
env: env
});
- var tmp_data = {
+ var addSubordinate = {
result: [
@@ -206,7 +206,20 @@
- 'id': 'relation-
+ 'id': 'new-relation-
+ }]
+ ],
+ op: 'delta'
+ };
+ var addRelation = {
+ result: [
+ ['relation', 'add', {
+ 'interface': 'juju-info',
+ 'scope': 'container',
+ 'endpoints':
+ [['mediawiki', {'role': 'server', 'name': 'juju-info'}],
+ ['puppet', {'role': 'client', 'name': 'juju-info'}]],
+ 'id': 'new-relation-
}]
],
op: 'delta'
@@ -216,21 +229,28 @@
var relationModule = view.topo. modules. RelationModule;
- function validateRelatio nCount( serviceNode, module) { nCount( serviceNode, module, count) { serviceNode. getDOMNode( )).datum( ); subordinateRela tionsForService (service) .length === 1; subordinateRela tionsForService (service)
+ function validateRelatio
var service = d3.select(
- return module.
+ return module.
+ .length === count;
}
- validateRelatio
+ validateRelatio
1).should.
});
- db.on_delta({ data: tmp_data });
- view.render();
+ db.on_delta({ data: addSubordinate });
+ view.update();
- validateRelatio
+ validateRelatio