Merge lp:~bac/juju-gui/1102640 into lp:juju-gui/experimental
Status: | Merged |
---|---|
Merged at revision: | 339 |
Proposed branch: | lp:~bac/juju-gui/1102640 |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
62 lines (+16/-10) 2 files modified
app/views/topology/relation.js (+8/-10) app/views/topology/service.js (+8/-0) |
To merge this branch: | bzr merge lp:~bac/juju-gui/1102640 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+144389@code.launchpad.net |
Description of the change
When adding a relation, the service menu is shown.
If adding a relation using the 'Build Relation' action from the service menu
on the originating service, the click on the target service produces two
events. The dragend event is handled properly and sets up the relation. Then
the click event calls serviceClick.
Attempts to use the stopPropagation, stopEvent, and preventDefault methods on
the d3.event did not produce the desired results.
This work-around is pretty hacky but it does work. A more general solution
should be found.
Also, attempts to change the test 'must be able to add a relation from the
service menu' to simulate the click events and ensure the service menu was not
left displayed did not work.
This branch is submitted as is in an attempt to finish the last card blocking
the charm announcement.
Reviewers: mp+144389_ code.launchpad. net,
Message:
Please take a look.
Description:
When adding a relation, the service menu is shown.
If adding a relation using the 'Build Relation' action from the service
menu
on the originating service, the click on the target service produces two
events. The dragend event is handled properly and sets up the relation.
Then
the click event calls serviceClick.
Attempts to use the stopPropagation, stopEvent, and preventDefault
methods on
the d3.event did not produce the desired results.
This work-around is pretty hacky but it does work. A more general
solution
should be found.
Also, attempts to change the test 'must be able to add a relation from
the
service menu' to simulate the click events and ensure the service menu
was not
left displayed did not work.
This branch is submitted as is in an attempt to finish the last card
blocking
the charm announcement.
https:/ /code.launchpad .net/~bac/ juju-gui/ 1102640/ +merge/ 144389
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/7179049/
Affected files: topology/ relation. js topology/ service. 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/ topology/ relation. js topology/ relation. js' topology/ relation. js 2013-01-22 14:09:00 +0000 topology/ relation. js 2013-01-22 20:25:32 +0000
.attr( 'y2', d3.event.y); onDragEnd: function() {
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -420,8 +420,6 @@
}
},
-
-
addRelati
// Get the line, the endpoint service, and the target <rect>.
var self = this;
@@ -606,14 +604,14 @@
if (endpoints && endpoints.length === 1) {
view. addRelationEnd( endpoints_ item, view, context);
// Create a relation with the only available endpoint.
- var ep = endpoints[0],
- endpoints_item = [
- [ep[0].service, {
- name: ep[0].name,
- role: 'server' }],
- [ep[1].service, {
- name: ep[1].name,
- role: 'client' }]];
+ var ep = endpoints[0];
+ var endpoints_item = [
+ [ep[0].service,
+ { name: ep[0].name,
+ role: 'server' }],
+ [ep[1].service,
+ { name: ep[1].name,
+ role: 'client' }]];
return;
}
Index: app/views/ topology/ service. js topology/ service. js' topology/ service. js 2013-01-22 13:38:47 +0000 topology/ service. js 2013-01-22 16:24:49 +0000 nt(mouse_ coords, topo.zoom)) {
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -89,6 +89,12 @@
if (!d.containsPoi
return;
}
+ // serviceClick is being called after dragend is processed. In those
+ // cases the current click action should not be invoked.
+ if (topo.ign...