Code review - Issue 7179049: When adding a relation, the service menu is shown.https://codereview.appspot.com/2013-01-22T21:16:36+00:00rietveld
Message from unknown
2013-01-22T20:31:47+00:00bacurn:md5:b2189b3a4f1f5767946458db94f87478
Message from bac@canonical.com
2013-01-22T20:31:53+00:00bacurn:md5:3a0d744aabd74fdfd1ce520b9c1bdf7c
Please take a look.
Message from benji.york@gmail.com
2013-01-22T21:08:18+00:00benjiurn:md5:940353e313286f9012cc31b78695ab3c
Looks good.
https://codereview.appspot.com/7179049/diff/1/app/views/topology/service.js
File app/views/topology/service.js (right):
https://codereview.appspot.com/7179049/diff/1/app/views/topology/service.js#newcode293
app/views/topology/service.js:293: //d3.event.sourceEvent.preventDefault();
Commented code accidentally left in.
Message from bcsaller@gmail.com
2013-01-22T21:09:29+00:00bcsallerurn:md5:031428e6127a5dbe8c7259a9cda279eb
LGTM, an unfortunate but needed work-around for the time being. Thanks. Could you also add a card about (or just add now) a test ensuring the behavior.
https://codereview.appspot.com/7179049/diff/1/app/views/topology/service.js
File app/views/topology/service.js (right):
https://codereview.appspot.com/7179049/diff/1/app/views/topology/service.js#newcode95
app/views/topology/service.js:95: topo.ignoreServiceClick = false;
If the state isn't shared it should be encapsulated at the module level, meaning this.ignoreServiceClick. Nothing else need know about or check this state.
https://codereview.appspot.com/7179049/diff/1/app/views/topology/service.js#newcode293
app/views/topology/service.js:293: //d3.event.sourceEvent.preventDefault();
Prune.
Message from unknown
2013-01-22T21:14:28+00:00bacurn:md5:d7c79cbb570aaf0a9f3cd32cf4395a02
Message from bac@canonical.com
2013-01-22T21:16:36+00:00bacurn:md5:37f9e3dbf7b7223f5ce1a16ade5ba456
*** Submitted:
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.
R=bcsaller
CC=
https://codereview.appspot.com/7179049