Merge lp:~bcsaller/juju-gui/update-reductions into lp:juju-gui/experimental
Proposed by
Benjamin Saller
Status: | Merged |
---|---|
Merged at revision: | 467 |
Proposed branch: | lp:~bcsaller/juju-gui/update-reductions |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
130 lines (+29/-25) 2 files modified
app/views/topology/relation.js (+26/-23) app/views/topology/service.js (+3/-2) |
To merge this branch: | bzr merge lp:~bcsaller/juju-gui/update-reductions |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email:
|
Description of the change
Remove some db.update calls
Given the current model we can't remove all calls
to db.fire('update') but we can remove them from
anything using the topology. Change 'update' events
(which redispatch) so simply call topo.update().
service and charm views still redispatch.
To post a comment you must log in.
Reviewers: mp+155972_ code.launchpad. net,
Message:
Please take a look.
Description:
Remove some db.update calls
Given the current model we can't remove all calls
to db.fire('update') but we can remove them from
anything using the topology. Change 'update' events
(which redispatch) so simply call topo.update().
service and charm views still redispatch.
https:/ /code.launchpad .net/~bcsaller/ juju-gui/ update- reductions/ +merge/ 155972
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/8083043/
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-03-22 10:28:31 +0000 topology/ relation. js 2013-03-28 14:22:42 +0000
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -470,7 +470,8 @@
_ removeRelationC allback: function(view,
relationElement , relationId, confirmButton, ev) { 'component' ).get(' db'); 'component' ),
db.notificat ions.add(
db.relations .remove( db.relations. getById( relationId) );
view.get( 'rmrelation_ dialog' ).hide( );
view.get( 'rmrelation_ dialog' ).destroy( ); tionBuild( ); cancelRelationB uild();
- var db = this.get(
+ var topo = this.get(
+ db = topo.get('db');
var service = this.get('model');
if (ev.err) {
@@ -486,7 +487,7 @@
// Remove the relation from the DB.
// Redraw the graph and reattach events.
- db.fire('update');
+ topo.update();
}
@@ -697,19 +698,20 @@
* role: 'client or server'
* }]
*/
- addRelationEnd: function(endpoints, view, context) {
+ addRelationEnd: function(endpoints, module) {
// Redisplay all services
- view.cancelRela
+ module.
// Get the vis, and links, build the new relation. 'component' ).vis; 'component' ).get(' env'); 'component' ).get(' db'); 'addRelationSta rt_service' ); get('component' ); get('addRelatio nStart_ service' );
- var vis = view.get(
- var env = view.get(
- var db = view.get(
- var source = view.get(
+ var topo = module.
+ var vis = topo.vis;
+ var env = topo.get('env');
+ var db = topo.get('db');
+ var source = module.
var relation_id = 'pending-' + endpoints[0][0] + endpoints[1][0];
if (endpoints[0][0] === endpoints[1][0]) { 'currentService ClickAction' , 'hideServiceMenu'); set('currentSer viceClickAction ', 'hideServiceMenu');
- view.set(
+ module.
return;
}
@@ -724,21 +726,20 @@
// Firing the update event on the db will properly redraw the 'update' ); 'component' ).bindAllD3Even ts(); vents() ;
// graph and reattach events.
- //db.fire(
- view.get(
- view.update();
+ topo.update();
+ topo.bindAllD3E
...