~matsubara/juju-gui/tarmac-test

Viewing all changes in revision 750.

  • Committer: Jeff Pihach
  • Date: 2013-06-20 17:15:29 UTC
  • mfrom: (733.1.1 conflict-resolution)
  • Revision ID: jeff.pihach@canonical.com-20130620171529-2qb68sahf7bqs269
Prototype of data binding conflict resolution

This branch changes the way we implement data binding by
moving the bind keys into a data-attribute on the elements.
This makes it easy to have dynamic templates bound to
dynamic attributes on a model.

When changes come in from Juju the databinding engine checks
for dirty fields, a field becomes dirty if the YUI valueChange
event would fire on it. If it finds that a change has come in
for a dirty field it calls the viewlets conflict method which
handles the conflict resolution UI. After the user has resolved
the conflict the field it then returns to a clean state and can
be updated automatically by the databinding engine. 

Please QA

Steps to QA:
Load the application with the flag `serviceInspector`
Deploy the `glance` charm.
Click the service and `view` to open the new inspector
Click `Config` to display the configuration properties
Open the console, paste and run::

g = app.db.services.item(0);gc = g.get('config');gc['db-user'] = 'asdf';g.set('config', gc);

You'll notice that the db-user field is updated with the new value
Edit the db-user field and run the script again
You'll now see that the field is dirty
Resolve the conflict
change the value to set in the above script and then run again
You'll see that the field changes as intended.

R=benjamin.saller, teknico
CC=
https://codereview.appspot.com/10397045

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: