Merge lp:~makyo/juju-gui/center into lp:juju-gui/experimental
Proposed by
Madison Scott-Clary
Status: | Merged |
---|---|
Merged at revision: | 1143 |
Proposed branch: | lp:~makyo/juju-gui/center |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
105 lines (+28/-28) 2 files modified
app/views/topology/service.js (+20/-12) test/test_environment_view.js (+8/-16) |
To merge this branch: | bzr merge lp:~makyo/juju-gui/center |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email:
|
Description of the change
Fix initial centering of canvas in real env.
In a real environment with positioned services, this centers the services within the viewport, an artifact that was lost in a recent refactor. Also tests that the panToPoint event was fired when a positioned service is added (future designs will complicate this, as the inspector will have an arrow pointing to a service, if it's open; this will be prevented in app/views/
To post a comment you must log in.
Reviewers: mp+191681_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix initial centering of canvas in real env.
In a real environment with positioned services, this centers the topology/ service. js:panToCenter( ) once
services within the viewport, an artifact that was lost in a recent
refactor. Also tests that the panToPoint event was fired when a
positioned service is added (future designs will complicate this, as the
inspector will have an arrow pointing to a service, if it's open; this
will be prevented in app/views/
that's implemented). Other tests in place already test finding and
setting the centroid.
https:/ /code.launchpad .net/~makyo/ juju-gui/ center/ +merge/ 191681
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/14771044/
Affected files (+30, -28 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-15 22:24:17 +0000 environment_ view.js 2013-10-17 16:54:10 +0000
view. topo.service_ boxes.wordpress b.center) ;
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -586,7 +586,7 @@
});
- it('must be able to use position annotations', function() {
match[ 1].should. eql('374. 1');
match[ 2].should. eql('211. 2');
+ it('must be able to use position annotations', function(done) {
var tmp_data = {
op: 'delta',
result: [
@@ -621,7 +621,13 @@
- // A positioned service will never be auto-positioned. on('panToPoint' , function() {
db.onDelta( { data: tmp_data });
view.update( ); wordpress- 6',
+ // A positioned service will never be auto-positioned. It will also
+ // center the canvas on itself.
+ view.topo.
+ // Once we reach here, the view has been updated and the canvas
panned
+ // to the newly added/annotated service.
+ done();
+ });
tmp_data = {
op: 'delta',
result: [
@@ -636,20 +642,6 @@
};
-
- tmp_data = {
- op: 'delta',
- result: [
- ['service', 'add',
- {
- 'subordinate': false,
- 'charm': 'cs:precise/
- 'id': 'wordpressb'
- }
- ]]
- };
- db.onDelta({ data: tmp_data });
- view.update();
});
it('must be able to use Landscape annotations', function() {
Index: app/views/ topology/ service. js topology/ service. js' topology/ service. js 2013-10-15 19:39:05 +0000 topology/ service. js 2013-10-17 17:01:32 +0000
level: 'important'
});
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -714,7 +714,7 @@
} else {
- console.log('import failed', file, result);
+ ...