Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2632)

Issue 10397045: Prototype of data binding conflict resolution

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by jeff.pihach
Modified:
10 years, 10 months ago
Reviewers:
benjamin.saller, mp+170204, teknico
Visibility:
Public.

Description

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. 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+279 lines, -103 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M app/models/models.js View 2 chunks +2 lines, -1 line 0 comments Download
A app/templates/service-configuration.handlebars View 1 chunk +4 lines, -0 lines 0 comments Download
A app/templates/service-configuration.partial View 1 chunk +33 lines, -0 lines 0 comments Download
M app/templates/serviceOverview.handlebars View 1 chunk +5 lines, -2 lines 0 comments Download
M app/templates/view-container.handlebars View 1 chunk +2 lines, -0 lines 0 comments Download
M app/views/databinding.js View 8 chunks +98 lines, -32 lines 0 comments Download
M app/views/service.js View 2 chunks +42 lines, -8 lines 0 comments Download
M app/views/topology/service.js View 1 chunk +3 lines, -1 line 0 comments Download
M app/views/view-container.js View 3 chunks +36 lines, -6 lines 0 comments Download
M lib/views/stylesheet.less View 2 chunks +8 lines, -1 line 0 comments Download
M test/test_databinding.js View 1 chunk +44 lines, -52 lines 0 comments Download

Messages

Total messages: 5
jeff.pihach
Please take a look.
10 years, 10 months ago (2013-06-18 21:15:56 UTC) #1
benjamin.saller
LGTM There is still a lot I think we can improve, but given this is ...
10 years, 10 months ago (2013-06-19 20:01:35 UTC) #2
teknico
LGTM, even if it doesn't mean much yet. :-) Will QA later.
10 years, 10 months ago (2013-06-20 15:53:46 UTC) #3
jeff.pihach
Thanks for the reviews guys, I have created a number of cards on the board ...
10 years, 10 months ago (2013-06-20 16:43:01 UTC) #4
jeff.pihach
10 years, 10 months ago (2013-06-20 17:16:12 UTC) #5
*** Submitted:

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
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b