yellow team mailing list archive
-
yellow team
-
Mailing list archive
-
Message #02231
[Merge] lp:~bcsaller/juju-gui/topology-service into lp:juju-gui
Benjamin Saller has proposed merging lp:~bcsaller/juju-gui/topology-service into lp:juju-gui.
Requested reviews:
Juju GUI Hackers (juju-gui)
Related bugs:
Bug #1077046 in juju-gui: "Create Service Topology Module"
https://bugs.launchpad.net/juju-gui/+bug/1077046
For more details, see:
https://code.launchpad.net/~bcsaller/juju-gui/topology-service/+merge/142561
Topology Service module
All that remains in Mega is related to services at this point, rename
and remove references to Mega.
--
https://code.launchpad.net/~bcsaller/juju-gui/topology-service/+merge/142561
Your team Juju GUI Hackers is requested to review the proposed merge of lp:~bcsaller/juju-gui/topology-service into lp:juju-gui.
=== modified file 'app/modules-debug.js'
--- app/modules-debug.js 2013-01-09 14:16:34 +0000
+++ app/modules-debug.js 2013-01-09 17:23:41 +0000
@@ -74,10 +74,6 @@
fullpath: '/juju-ui/views/topology/service.js'
},
- 'juju-topology-mega': {
- fullpath: '/juju-ui/views/topology/mega.js'
- },
-
'juju-topology': {
fullpath: '/juju-ui/views/topology/topology.js'
},
=== modified file 'app/views/environment.js'
--- app/views/environment.js 2013-01-07 14:40:03 +0000
+++ app/views/environment.js 2013-01-09 17:23:41 +0000
@@ -49,7 +49,7 @@
getServiceEndpoints: this.get('getServiceEndpoints'),
container: container});
// Bind all the behaviors we need as modules.
- topo.addModule(views.MegaModule);
+ topo.addModule(views.ServiceModule);
topo.addModule(views.PanZoomModule);
topo.addModule(views.ViewportModule);
topo.addModule(views.RelationModule);
=== renamed file 'app/views/topology/mega.js' => 'app/views/topology/service.js'
--- app/views/topology/mega.js 2013-01-08 18:14:03 +0000
+++ app/views/topology/service.js 2013-01-09 17:23:41 +0000
@@ -1,20 +1,6 @@
'use strict';
-/**
- * IMPORTANT
- *
- * This module represents a single step in the refactor of the environment
- * view. This module is THROW AWAY CODE. Each forthcoming branch should
- * begin by moving relevant code to the proper module, binding that
- * module to Topo and removing code from here.
- *
- * Any patch adding code here (minus some initial cross module callback changes)
- * is highly suspect.
- *
- * @module mega
- **/
-
-YUI.add('juju-topology-mega', function(Y) {
+YUI.add('juju-topology-service', function(Y) {
var views = Y.namespace('juju.views'),
models = Y.namespace('juju.models'),
utils = Y.namespace('juju.views.utils'),
@@ -23,10 +9,10 @@
/**
* @module topology-service
- * @class MegaModule
+ * @class ServiceModule
* @namespace views
**/
- var MegaModule = Y.Base.create('MegaModule', d3ns.Module, [], {
+ var ServiceModule = Y.Base.create('ServiceModule', d3ns.Module, [], {
events: {
scene: {
'.service': {
@@ -140,7 +126,7 @@
},
initializer: function(options) {
- MegaModule.superclass.constructor.apply(this, arguments);
+ ServiceModule.superclass.constructor.apply(this, arguments);
// Build a service.id -> BoundingBox map for services.
this.service_boxes = {};
@@ -262,8 +248,7 @@
// Nodes are mapped by modelId tuples.
this.node = vis.selectAll('.service')
- .data(services, function(d) {
- return d.modelId();});
+ .data(services, function(d) { return d.modelId();});
},
/*
@@ -831,7 +816,7 @@
ATTRS: {}
});
- views.MegaModule = MegaModule;
+ views.ServiceModule = ServiceModule;
}, '0.1.0', {
requires: [
'd3',
=== removed file 'app/views/topology/service.js'
--- app/views/topology/service.js 2012-12-11 04:41:33 +0000
+++ app/views/topology/service.js 1970-01-01 00:00:00 +0000
@@ -1,66 +0,0 @@
-'use strict';
-
-YUI.add('juju-topology-service', function(Y) {
- var views = Y.namespace('juju.views'),
- models = Y.namespace('juju.models'),
- d3ns = Y.namespace('d3');
-
- /**
- * @module topology-service
- * @class ServiceModule
- * @namespace views
- **/
- var ServiceModule = Y.Base.create('ServiceModule', d3ns.Module, [], {
- subordinate_margin: {
- top: 0.05,
- bottom: 0.1,
- left: 0.084848,
- right: 0.084848},
-
- service_margin: {
- top: 0,
- bottom: 0.1667,
- left: 0.086758,
- right: 0.086758},
-
- initializer: function(options) {
- ServiceModule.superclass.constructor.apply(this, arguments);
- // Mapping of serviceId to BoundingBox of service.
- this.service_boxes = {};
-
- },
-
- componentBound: function() {
- var component = this.get('component');
- //component.on('sizeChange', this._scaleLayout);
- this._scaleLayout();
- },
-
- _scaleLayout: function() {
- this.layout = d3.layout.pack()
- .size(this.get('component').get('size'))
- .value(function(d) {return d.unit_count;})
- .padding(300);
- },
-
- render: function() {
- return this;
- },
-
- update: function() {
- }
- }, {
- ATTRS: {}
-
- });
- views.ServiceModule = ServiceModule;
-}, '0.1.0', {
- requires: [
- 'd3',
- 'd3-components',
- 'node',
- 'event',
- 'juju-models',
- 'juju-env'
- ]
-});
=== modified file 'app/views/topology/topology.js'
--- app/views/topology/topology.js 2013-01-09 16:42:50 +0000
+++ app/views/topology/topology.js 2013-01-09 17:23:41 +0000
@@ -186,7 +186,6 @@
'juju-templates',
'juju-models',
'juju-env',
- 'juju-topology-mega',
'juju-topology-service',
'juju-topology-relation',
'juju-topology-panzoom',
=== modified file 'test/test_application_notifications.js'
--- test/test_application_notifications.js 2013-01-07 19:50:46 +0000
+++ test/test_application_notifications.js 2013-01-09 17:23:41 +0000
@@ -222,7 +222,7 @@
function() {
var view = new views.environment({db: db, container: viewContainer});
view.render();
- var module = view.topo.modules.MegaModule;
+ var module = view.topo.modules.ServiceModule;
// The callback uses the 'getModelURL' attribute to retrieve the
// service URL.
module.set('getModelURL', NO_OP);
=== modified file 'test/test_environment_view.js'
--- test/test_environment_view.js 2013-01-09 15:55:25 +0000
+++ test/test_environment_view.js 2013-01-09 17:23:41 +0000
@@ -440,10 +440,10 @@
// Toggle the control panel for the Add Relation button.
var module = view.topo.modules.RelationModule;
- var mega = view.topo.modules.MegaModule;
- mega.service_click_actions.toggleControlPanel(
+ var sm = view.topo.modules.ServiceModule;
+ sm.service_click_actions.toggleControlPanel(
d3.select(service.getDOMNode()).datum(),
- mega,
+ sm,
service);
// Mock an event object so that d3.mouse does not throw a NPE.
d3.event = {};
@@ -532,12 +532,12 @@
// If the user has clicked on the "Add Relation" menu item...
var module = view.topo.modules.RelationModule;
- var mega = view.topo.modules.MegaModule;
+ var sm = view.topo.modules.ServiceModule;
var topo = module.get('component');
module.startRelation(service);
assert.isTrue(topo.buildingRelation);
// ...clicking on the background causes the relation drag to stop.
- mega.backgroundClicked();
+ sm.backgroundClicked();
assert.isFalse(topo.buildingRelation);
});
=== modified file 'test/test_topology.js'
--- test/test_topology.js 2013-01-07 13:59:45 +0000
+++ test/test_topology.js 2013-01-09 17:23:41 +0000
@@ -79,7 +79,8 @@
db = new models.Database();
topo = new views.Topology();
topo.setAttrs({container: container, db: db});
- topo.addModule(views.MegaModule);
+ topo.addModule(views.ServiceModule);
+ topo.addModule(views.RelationModule);
topo.addModule(views.PanZoomModule);
topo.addModule(views.ViewportModule);
return topo;
=== modified file 'undocumented'
--- undocumented 2013-01-09 03:34:36 +0000
+++ undocumented 2013-01-09 17:23:41 +0000
@@ -153,32 +153,13 @@
app/views/service.js:23 "resetUnits"
app/views/service.js:230 "unexposeService"
app/views/service.js:237 "_unexposeServiceCallback"
-app/views/topology/mega.js:794 "destroyService"
-app/views/topology/mega.js:152 "serviceClick"
-app/views/topology/mega.js:170 "serviceDblClick"
-app/views/topology/mega.js:273 "update"
-app/views/topology/mega.js:650 "renderedHandler"
-app/views/topology/mega.js:619 "show"
-app/views/topology/mega.js:771 "destroyServiceConfirm"
-app/views/topology/mega.js:195 "serviceMouseLeave"
-app/views/topology/mega.js:700 "updateServiceMenuLocation"
-app/views/topology/mega.js:683 "showGraphListPicker"
-app/views/topology/mega.js:177 "serviceMouseEnter"
-app/views/topology/mega.js:625 "hide"
-app/views/topology/mega.js:693 "hideGraphListPicker"
-app/views/topology/mega.js:742 "toggleControlPanel"
-app/views/topology/mega.js:803 "_destroyCallback"
-app/views/topology/mega.js:142 "initializer"
-app/views/topology/mega.js:762 "show_service"
-app/views/topology/mega.js:233 "updateData"
-app/views/topology/mega.js:631 "fade"
app/views/topology/panzoom.js:94 "zoom_out"
app/views/topology/panzoom.js:77 "zoomHandler"
app/views/topology/panzoom.js:47 "renderSlider"
-app/views/topology/panzoom.js:141 "rescale"
-app/views/topology/panzoom.js:164 "renderedHandler"
app/views/topology/panzoom.js:112 "_fire_zoom"
+app/views/topology/panzoom.js:165 "renderedHandler"
app/views/topology/panzoom.js:103 "zoom_in"
+app/views/topology/panzoom.js:140 "rescale"
app/views/topology/panzoom.js:33 "componentBound"
app/views/topology/relation.js:78 "processRelation"
app/views/topology/relation.js:403 "_removeRelationCallback"
@@ -210,11 +191,25 @@
app/views/topology/relation.js:221 "drawRelation"
app/views/topology/relation.js:74 "renderedHandler"
app/views/topology/relation.js:548 "ambiguousAddRelationCheck"
-app/views/topology/service.js:46 "render"
-app/views/topology/service.js:33 "componentBound"
-app/views/topology/service.js:26 "initializer"
-app/views/topology/service.js:50 "update"
-app/views/topology/service.js:39 "_scaleLayout"
+app/views/topology/service.js:635 "renderedHandler"
+app/views/topology/service.js:181 "serviceMouseLeave"
+app/views/topology/service.js:604 "show"
+app/views/topology/service.js:219 "updateData"
+app/views/topology/service.js:668 "showGraphListPicker"
+app/views/topology/service.js:610 "hide"
+app/views/topology/service.js:747 "show_service"
+app/views/topology/service.js:616 "fade"
+app/views/topology/service.js:727 "toggleControlPanel"
+app/views/topology/service.js:128 "initializer"
+app/views/topology/service.js:156 "serviceDblClick"
+app/views/topology/service.js:138 "serviceClick"
+app/views/topology/service.js:258 "update"
+app/views/topology/service.js:163 "serviceMouseEnter"
+app/views/topology/service.js:779 "destroyService"
+app/views/topology/service.js:678 "hideGraphListPicker"
+app/views/topology/service.js:788 "_destroyCallback"
+app/views/topology/service.js:756 "destroyServiceConfirm"
+app/views/topology/service.js:685 "updateServiceMenuLocation"
app/views/topology/topology.js:137 "serviceForBox"
app/views/topology/topology.js:175 "setter"
app/views/topology/topology.js:174 "getter"
Follow ups