The only downside to the new approach is that sometimes we separate the
two names (deploy vs deployBundle) and sometimes we merge them. That
makes it just a bit harder to figure out what's going on while reading.
In your shoes, I'd be tempted to rename the charm-only deploy function
to "deployCharm" so as to make a parallel with "deployBundle" and a
contrast with the more mutable "deploy". I am sure there are other
solutions, some better than this one. Moreover, this is just a
suggestion. What you have done is OK with me as is, and an improvement.
https://codereview.appspot.com/18920045/diff/20001/app/widgets/charm-search.js#newcode278
app/widgets/charm-search.js:278: if
(ev.target.hasClass('search_add_to_canvas')) {
I'm guessing we can't have an event registration for
li.search_add_to_canvas or whatever that simply catches the event first
because it is a more specific selector, and then calls ev.halt()?
If not, I suggest changing the body of this block to something like the
following.
Then handleDeploy can look at the data and do the right thing (that is,
the code you have below) within its own code. That feels like a
readability improvement to me.
Alternatively, you could expand this to divide up on the basis of bundle
vs charm.
LGTM with comments; thank you!
Gary
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/subapps/ browser/ browser. js browser/ browser. js (right):
File app/subapps/
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/subapps/ browser/ browser. js#newcode1165 browser/ browser. js:1165: deployBundle: {},
app/subapps/
On 2013/10/29 18:31:54, rharding wrote:
> document all the things!
:-) cool
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/subapps/ browser/ views/bundle. js browser/ views/bundle. js (right):
File app/subapps/
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/subapps/ browser/ views/bundle. js#newcode76 browser/ views/bundle. js:76: 'deploy' )(bundle. get('data' ));
app/subapps/
this.get(
On 2013/10/29 18:31:54, rharding wrote:
> so this changes to just deploy vs a diff method
The only downside to the new approach is that sometimes we separate the
two names (deploy vs deployBundle) and sometimes we merge them. That
makes it just a bit harder to figure out what's going on while reading.
In your shoes, I'd be tempted to rename the charm-only deploy function
to "deployCharm" so as to make a parallel with "deployBundle" and a
contrast with the more mutable "deploy". I am sure there are other
solutions, some better than this one. Moreover, this is just a
suggestion. What you have done is OK with me as is, and an improvement.
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/subapps/ browser/ views/view. js browser/ views/view. js (right):
File app/subapps/
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/subapps/ browser/ views/view. js#newcode93 browser/ views/view. js:93: );
app/subapps/
On 2013/10/29 18:31:54, rharding wrote:
> no idea why there were two different "if search" checks. Block them
into one.
Heh. cool.
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/subapps/ browser/ views/view. js#newcode318 browser/ views/view. js:318: deploy: {},
app/subapps/
So this is the one I'd call deployCharm.
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/templates/ bundle- token.handlebar s bundle- token.handlebar s (right):
File app/templates/
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/templates/ bundle- token.handlebar s#newcode5 bundle- token.handlebar s:5: {{#ifFlag 'searchDeploy'}}
app/templates/
On 2013/10/29 18:31:54, rharding wrote:
> we only feature flag the UX since it's a UX driven feature. Simpler
than FF'ing
> all the code.
Cool.
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/views/ utils.js
File app/views/utils.js (right):
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/views/ utils.js# newcode1567 utils.js: 1567: * {{#ifFlag 'flag_name'}} {{/ifFlag}}
app/views/
On 2013/10/29 18:31:54, rharding wrote:
> Document the real usage.
Uh-oh, the doc string is becoming dangerously close to being helpful.
;-)
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/widgets/ charm-search. js charm-search. js (right):
File app/widgets/
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/widgets/ charm-search. js#newcode273 charm-search. js:273: this.ac. _onItemClick = function(ev) {
app/widgets/
This comment, or a variation of it, deserves to be in the code, IMO.
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/widgets/ charm-search. js#newcode275 charm-search. js:275: // ignore the way autocomplete works.
app/widgets/
It's more of a 'quick search'
'Course, I think we agreed that this is not really autocomplete after
all, anyway.
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/widgets/ charm-search. js#newcode278 charm-search. js:278: if hasClass( 'search_ add_to_ canvas' )) { add_to_ canvas or whatever that simply catches the event first
app/widgets/
(ev.target.
I'm guessing we can't have an event registration for
li.search_
because it is a more specific selector, and then calls ev.halt()?
If not, I suggest changing the body of this block to something like the
following.
this.hide(); oy(ev.target. getData( ));
this.handleDepl
Then handleDeploy can look at the data and do the right thing (that is,
the code you have below) within its own code. That feels like a
readability improvement to me.
Alternatively, you could expand this to divide up on the basis of bundle
vs charm.
https:/ /codereview. appspot. com/18920045/ diff/20001/ app/widgets/ charm-search. js#newcode377 charm-search. js:377: // with entity? Something to clean up.
app/widgets/
Entity seems simplest and reasonable.
https:/ /codereview. appspot. com/18920045/ diff/20001/ test/test_ browser_ app.js browser_ app.js (right):
File test/test_
https:/ /codereview. appspot. com/18920045/ diff/20001/ test/test_ browser_ app.js# newcode182 browser_ app.js: 182: fakeStore = new charmworld. APIv2({ });
test/test_
Y.juju.
v2? expected v3, but doubt it matters.
https:/ /codereview. appspot. com/18920045/