Merge lp:~gary/juju-gui/fixConflictResolution into lp:juju-gui/experimental
Status: | Merged |
---|---|
Merged at revision: | 1029 |
Proposed branch: | lp:~gary/juju-gui/fixConflictResolution |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
217 lines (+107/-25) 3 files modified
app/views/databinding.js (+19/-17) app/views/inspector.js (+2/-2) test/test_databinding.js (+86/-6) |
To merge this branch: | bzr merge lp:~gary/juju-gui/fixConflictResolution |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+184916@code.launchpad.net |
Description of the change
Fix conflict resolution
Prior to this branch, conflict resolution did not play nicely with our new functionality to show modified fields and to hide/reveal save controls as appropriate. Specifically, these were two problems.
* If you set a model value but choose the user's value, the user's value will not be seen as a modified value.
* If you resolve a conflict that changes the DOM to match the model, the save dialog should disappear but does not.
This branch addresses these issues entirely within the databinding code.
In addition, I added a test of basic conflict handling. I cleaned up _getBinding further from my most recent branch. I bound the "resolve" method with the known arguments to make client code simpler.
Reviewers: mp+184916_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix conflict resolution
Prior to this branch, conflict resolution did not play nicely with our
new functionality to show modified fields and to hide/reveal save
controls as appropriate. Specifically, these were two problems.
* If you set a model value but choose the user's value, the user's value
will not be seen as a modified value.
* If you resolve a conflict that changes the DOM to match the model, the
save dialog should disappear but does not.
This branch addresses these issues entirely within the databinding code.
In addition, I added a test of basic conflict handling. I cleaned up
_getBinding further from my most recent branch. I bound the "resolve"
method with the known arguments to make client code simpler.
To QA, make a service and then open the inspector to the constraints
tab. Change the "CPU cores" field. Then in the console run something
like this (assuming that you did not type "8" in the CPU cores field:
app.db. services. item(0) .set('constrain ts', {'cpu-cores': 8})
Select the second value (8) in the conflict resolution UX. The field
should be marked as unmodified and the save dialog should disappear.
Now change the CPU cores field to 4. In the console, set it the cores
to 6:
app.db. services. item(0) .set('constrain ts', {'cpu-cores': 6})
Select the first value (4) in the conflict resolution UX. The conflict
marker should disappear but it should be replaced with the "modified"
asterisk, and the save button should still be visible (though it is
called "Overwrite," which is still technically accurate).
There are other edge cases I'm still planning on addressing in upcoming
branches, but these two are working, so I'm proposing the branch.
https:/ /code.launchpad .net/~gary/ juju-gui/ fixConflictReso lution/ +merge/ 184916
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/13373052/
Affected files (+109, -25 lines): databinding. js inspector. js databinding. js
A [revision details]
M app/views/
M app/views/
M test/test_