DescriptionReorganize view code.
Replace most of the view closures with external
private functions.
This has several good side effects in my opinion:
- view functions are shorter;
- we know which objects are used for each callback
function, because we need to explicitly pass them
as arguments;
- external functions can be reused by multiple views
if required (and we have the _use example here);
- if an external callback become less straightforward,
it is now possible to directly unit test it.
Tests: `make check`.
QA:
If unit tests pass we have some confidence that
the interactive session is not broken.
However, some time spent on it would be great,
creating/editing/destroying environments, setting
them as default, canceling the changes, starting
one of them, etc...
Thanks a lot.
https://code.launchpad.net/~frankban/juju-quickstart/no-closure-for-you/+merge/245868
(do not edit description out of merge proposal)
Patch Set 1 #Patch Set 2 : Reorganize view code. #
MessagesTotal messages: 6
|