Merge lp:~makyo/juju-gui/add-rel-improvements into lp:juju-gui/experimental
Proposed by
Madison Scott-Clary
Status: | Merged |
---|---|
Merged at revision: | 233 |
Proposed branch: | lp:~makyo/juju-gui/add-rel-improvements |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
183 lines (+55/-37) 2 files modified
app/views/environment.js (+52/-37) test/test_environment_view.js (+3/-0) |
To merge this branch: | bzr merge lp:~makyo/juju-gui/add-rel-improvements |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+131542@code.launchpad.net |
Description of the change
Add-relation improvements
UX improvements per Jovan: draglines should start with the long-click as an indicator that the user will be dragging a line; draglines should be on top of all services/lines, as they are currently the most important thing the user is working with; and draglines should be used when adding a relation from the service menu as well, showing that a relation will be created.
To post a comment you must log in.
Reviewers: mp+131542_ code.launchpad. net,
Message:
Please take a look.
Description:
Add-relation improvements
UX improvements per Jovan: draglines should start with the long-click as
an indicator that the user will be dragging a line; draglines should be
on top of all services/lines, as they are currently the most important
thing the user is working with; and draglines should be used when adding
a relation from the service menu as well, showing that a relation will
be created.
https:/ /code.launchpad .net/~makyo/ juju-gui/ add-rel- improvements/ +merge/ 131542
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6786050/
Affected files: environment. 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 2012-10-20 18:16:19 +0000 environment_ view.js 2012-10-26 07:54:00 +0000
container. all('.selectabl e-service' )
.size( )
.should. equal(2) ; all('.dragline' )
service. next(). simulate( 'click' );
container. all('.selectabl e-service' ).size( )
.should. equal(0) ;
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -339,6 +339,9 @@
+ container.
+ .size()
+ .should.equal(1);
Index: app/views/ environment. js environment. js' environment. js 2012-10-26 06:35:16 +0000 environment. js 2012-10-26 07:48:26 +0000 'active_ service' ),
service = this.serviceFor Box(box) ,
context = this.get( 'active_ context' ); nDragStart. call(this, box, context); lation = true;
this. service_ click_actions
.toggleCon trolPanel( box, this, context);
this. service_ click_actions nt(mouse_ coords, self.zoom)) {
return; 'addRelationSta rt_service' )) {
self. set('potential_ drop_point_ service' , d);
self. set('potential_ drop_point_ rect', rect);
self. addSVGClass( rect, 'hover');
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -33,6 +33,8 @@
var box = this.get(
+ this.addRelatio
+ this.clickAddRe
@@ -81,6 +83,12 @@
if (!d.containsPoi
}
+
+ // Do not fire if we're on the same service.
+ if (d === self.get(
+ return;
+ }
+
@@ -162,6 +170,17 @@
container. all('.environme nt-menu. active' ).removeClass( 'active' );
self. service_ click_actions. toggleControlPa nel(null, self);
self. cancelRelationB uild();
+ },
+ mousemove: function(d, self) {
+ // If we're clicking to add a relation, make sure a dragline
+ // follows the mouse cursor.
+ ...