Merge lp://staging/~bcsaller/juju-gui/component-modules into lp://staging/~bcsaller/juju-gui/component-framework

Proposed by Benjamin Saller
Status: Needs review
Proposed branch: lp://staging/~bcsaller/juju-gui/component-modules
Merge into: lp://staging/~bcsaller/juju-gui/component-framework
Diff against target: 6579 lines (+2731/-2310)
53 files modified
.bzrignore (+1/-7)
Makefile (+127/-47)
README (+1/-1)
app/app.js (+86/-44)
app/assets/javascripts/d3-components.js (+56/-11)
app/assets/svgs/service_health_mask.svg (+196/-128)
app/assets/svgs/service_module.svg (+124/-131)
app/index.html (+11/-8)
app/models/models.js (+2/-0)
app/modules-debug.js (+166/-0)
app/modules.js (+12/-109)
app/store/notifications.js (+1/-1)
app/templates/charm-description.handlebars (+20/-11)
app/templates/charm-pre-configuration.handlebars (+14/-14)
app/templates/charm-search-result.handlebars (+6/-3)
app/templates/notifier.handlebars (+3/-0)
app/templates/overview.handlebars (+4/-2)
app/views/charm-panel.js (+82/-16)
app/views/charm.js (+3/-2)
app/views/environment.js (+43/-1612)
app/views/notifications.js (+30/-2)
app/views/service.js (+5/-3)
app/views/topology/panzoom.js (+42/-0)
app/views/topology/relation.js (+42/-0)
app/views/topology/service.js (+361/-0)
app/views/topology/topology.js (+133/-0)
app/views/topology/viewport.js (+41/-0)
app/views/unit.js (+2/-1)
app/views/utils.js (+2/-1)
app/widgets/notifier.js (+148/-0)
bin/merge-files (+80/-0)
docs/style-guide.rst (+38/-0)
grunt.js (+3/-3)
lib/merge-files.js (+136/-0)
lib/server.js (+25/-3)
lib/templates.js (+2/-2)
lib/views/stylesheet.less (+262/-108)
package.json (+2/-1)
test-server.js (+4/-1)
test/index.html (+5/-2)
test/test_app.js (+1/-1)
test/test_app_hotkeys.js (+63/-0)
test/test_application_notifications.js (+1/-1)
test/test_charm_panel.js (+12/-16)
test/test_charm_view.js (+2/-1)
test/test_d3_components.js (+8/-4)
test/test_environment_view.js (+56/-2)
test/test_notifications.js (+61/-0)
test/test_notifier_widget.js (+103/-0)
test/test_service_view.js (+4/-2)
test/test_topology.js (+97/-0)
test/test_unit_view.js (+2/-1)
undocumented (+0/-8)
To merge this branch: bzr merge lp://staging/~bcsaller/juju-gui/component-modules
Reviewer Review Type Date Requested Status
Benjamin Saller Pending
Review via email: mp+135272@code.staging.launchpad.net

Description of the change

Example module for env view refactor

Looking to get more eyes on the way the module code is playing out. In
particular I'm much more interested in if the various parts fit together in
a way that makes sense to people than an details of the impl.

The basic pattern is this

EnvironmentView has a Topology object which is a subclass of the d3-component
stuff. The Env view binds modules to the topology (from app/views/topology/).

The framework will look at each modules declarative structures for events and
bind behavior. The basic cycle the view moves through then is

update() <- called on data change to recompute view models, things like
            position information.

render() <- draw the current scene. Render itself support the notion of one
            time setup code and incremental rendering. For the most part
   scene mutation will happen in the event handlers though, those
   behaviors are facilitated by the framework but not controlled by
   it.

Modules attempt to aid in keeping inter-module code loosely coupled. This is
done by encouraging use of custom YUI events. Module.events.yui is one of the
event binding structures available from the framework, modules can listen for
changes that may be of interest to other modules and fire events which can
trigger handlers.

There isn't always a clean line between what should live in a module and the
topology object itself but the rule of thumb is that if it can reasonably go
in a module it should, the topology layer is mainly configuration and
coordination.

Looking forward to comments. Thanks.

https://codereview.appspot.com/6858045/

To post a comment you must log in.
Revision history for this message
Benjamin Saller (bcsaller) wrote :
Download full text (3.5 KiB)

Reviewers: mp+135272_code.launchpad.net,

Message:
Please take a look.

Description:
Example module for env view refactor

Looking to get more eyes on the way the module code is playing out. In
particular I'm much more interested in if the various parts fit together
in
a way that makes sense to people than an details of the impl.

The basic pattern is this

EnvironmentView has a Topology object which is a subclass of the
d3-component
stuff. The Env view binds modules to the topology (from
app/views/topology/).

The framework will look at each modules declarative structures for
events and
bind behavior. The basic cycle the view moves through then is

update() <- called on data change to recompute view models, things like
             position information.

render() <- draw the current scene. Render itself support the notion of
one
             time setup code and incremental rendering. For the most part

   scene mutation will happen in the event handlers though, those
   behaviors are facilitated by the framework but not controlled by
   it.

Modules attempt to aid in keeping inter-module code loosely coupled.
This is
done by encouraging use of custom YUI events. Module.events.yui is one
of the
event binding structures available from the framework, modules can
listen for
changes that may be of interest to other modules and fire events which
can
trigger handlers.

There isn't always a clean line between what should live in a module and
the
topology object itself but the rule of thumb is that if it can
reasonably go
in a module it should, the topology layer is mainly configuration and
coordination.

Looking forward to comments. Thanks.

https://code.launchpad.net/~bcsaller/juju-gui/component-modules/+merge/135272

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/6858045/

Affected files:
   M .bzrignore
   M Makefile
   M README
   A [revision details]
   M app/app.js
   A app/assets/images/back_triangle.png
   A app/assets/images/notifier-error.png
   M app/assets/javascripts/d3-components.js
   M app/assets/svgs/service_health_mask.svg
   M app/assets/svgs/service_module.svg
   A app/favicon.ico
   M app/index.html
   M app/models/models.js
   A app/modules-debug.js
   M app/modules.js
   M app/store/notifications.js
   M app/templates/charm-description.handlebars
   M app/templates/charm-pre-configuration.handlebars
   M app/templates/charm-search-result.handlebars
   A app/templates/notifier.handlebars
   M app/templates/overview.handlebars
   M app/views/charm-panel.js
   M app/views/charm.js
   M app/views/environment.js
   M app/views/notifications.js
   M app/views/service.js
   A app/views/topology/panzoom.js
   A app/views/topology/relation.js
   A app/views/topology/service.js
   A app/views/topology/topology.js
   A app/views/topology/viewport.js
   M app/views/unit.js
   M app/views/utils.js
   A app/widgets/notifier.js
   A bin/merge-files
   M docs/style-guide.rst
   M grunt.js
   A lib/merge-files.js
   M lib/server.js
   M lib/templates.js
   M lib/views/stylesheet.less
   M package.json
   M test-server.js
   M test/index.html
   M test/test_app.js
   A test/test_app_...

Read more...

Revision history for this message
Benjamin Saller (bcsaller) wrote :
Revision history for this message
Benjamin Saller (bcsaller) wrote :

This created a huge delta, not sure why yet.

https://codereview.appspot.com/6858045/

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

On 2012/11/20 22:44:26, benjamin.saller wrote:
> This created a huge delta, not sure why yet.

Hi ben, i created another mp for this, but if you got a chance it would
be great if you could cleanup this mp and copy the comments over to it.

https://codereview.appspot.com/6858045/

Unmerged revisions

240. By Benjamin Saller

removed yuidoc-lint from make lint... gah

239. By Benjamin Saller

merge trunk

238. By Benjamin Saller

lint

237. By Benjamin Saller

reindent file

236. By Benjamin Saller

checkpoint prior to jsfixstyle

235. By Benjamin Saller

remove need to call renderOnce/update

234. By Benjamin Saller

basic service module, very little crossmodule cutting

233. By Benjamin Saller

checkpoint module event scoping and ordering work

232. By Benjamin Saller

revert back to empty modules

231. By Benjamin Saller

merge trunk (ignoring) env changes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: