DescriptionPrototype 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.
https://code.launchpad.net/~hatch/juju-gui/conflict-resolution/+merge/170204
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 27
Patch Set 2 : Prototype of data binding conflict resolution #
MessagesTotal messages: 5
|