Code review comment for lp://staging/~gary/juju-gui/bug1228166

Revision history for this message
Gary Poster (gary) wrote :

Reviewers: mp+187311_code.launchpad.net,

Message:
Please take a look.

Description:
Data-bind unit details view

Our unit detail view was not data-bound: it would render and never
update. This branch fixes that, except for the relation information,
which is not really available at the moment (in terms of errors) so I
decided that could live to fight another day.

To qa, deploy a service, turn off the simulator (to avoid surprises),
open the unit view of unit 0, and try the following in the console,
looking on in the unit details view as you do.

myunit = app.db.units.item(0)
myunit.private_address = '10.0.0.1'
myunit.public_address = '10.0.0.2'
myunit.open_ports = [80]
myunit.open_ports = [8080]
myunit.open_ports = [443]
myunit.open_ports = [443, 8080]
myunit.agent_state_info = 'great!'
app.db.environment.set('annotations', {'landscape-url':
'http://landscape.example.com','landscape-computers':
'/computers/criteria/environment:test'})
myunit.annotations = {'landscape-computer': 'kumquat'}

(note that the app.dp.environment.set call does not trigger a change in
the view: it sets up data for the next mutation, which does.)

Thank you!

https://code.launchpad.net/~gary/juju-gui/bug1228166/+merge/187311

(do not edit description out of merge proposal)

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

Affected files (+235, -55 lines):
   A [revision details]
   M app/templates/unitOverview.handlebars
   M app/views/viewlet-manager.js
   M app/views/viewlets/unit-details.js
   M test/test_unit_detail_viewlet.js

« Back to merge proposal