Merge lp:~abentley/launchpad/select-owner into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Gavin Panella on 2010-11-11 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 11948 |
| Proposed branch: | lp:~abentley/launchpad/select-owner |
| Merge into: | lp:launchpad |
| Diff against target: |
477 lines (+205/-108) 4 files modified
lib/canonical/widgets/suggestion.py (+169/-103) lib/lp/code/browser/branch.py (+1/-1) lib/lp/code/browser/sourcepackagerecipe.py (+2/-1) lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+33/-3) |
| To merge this branch: | bzr merge lp:~abentley/launchpad/select-owner |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gavin Panella (community) | Approve on 2010-11-11 | ||
| Curtis Hovey (community) | ui | 2010-11-10 | Approve on 2010-11-11 |
| Guilherme Salgado (community) | ui* | 2010-11-10 | Approve on 2010-11-10 |
|
Review via email:
|
|||
Commit Message
Suggest branch owner as recipe owner
Description of the Change
= Summary =
Fix bug #670431: Make it easy to select branch owner as recipe owner when
creating recipe
== Proposed fix ==
Provide a list of suggested owners that includes the logged-in user and, if the
logged-in-user is a member of the branch owner, the branch owner. The normal
list of potential owners is provided as a secondary choice.
See: https:/
== Pre-implementation notes ==
None
== Implementation details ==
Extracted a SuggestionWidget from TargetBranchWidget, and implemented
RecipeOwnerWidget in terms of SuggestionWidget.
== Tests ==
bin/test -t test_create_
== Demo and Q/A ==
Create a branch owned by a team you are a member of. Choose "Create a
packaging recipe". Both you and the owning team should be suggested as
owners.
Leave the team. Now only you should be suggested as an owner.
Create a recipe using a suggested owner.
Create a recipe using "Other".
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/canonical
| Aaron Bentley (abentley) wrote : | # |
Screenshot is here: salgado: http://
| Curtis Hovey (sinzui) wrote : | # |
We discussed making the suggestion menu be subordinate to the (*) other radio item, but our attempt broke other things. I think this is a bigger form CSS issue that needs a separate fix. So this UI is good to land.
| Aaron Bentley (abentley) wrote : | # |
Actually, I was able to make the change such that only RecipeOwnerWidget was affected.
| Gavin Panella (allenap) wrote : | # |
Looks good! Some quite trivial comments.
[1]
+ @classmethod
+ def _generateSugges
Any reason this is a class method? Not complaining, just wondering.
[2]
+ terms = [term for term in full_vocabulary
+ if term.value in suggestions]
Indentation is a bit off.
[3]
+ def _renderSuggesti
This seems like an imperative name, "go and render the
suggestions". Perhaps _shouldRenderSu
me too :)
[4]
In http://
drop-down box has "Foo Bar", but that's already a radio item. I think
it's confusing, or perhaps ugly, to repeat choices. That's more of a
UI thing though, and this is meant to be a code review :)
[5]
+ text = '%s (<a href="%s">branch details</a>)' % (
+ branch.displayname, canonical_
Even if branch.displayname cannot be invalid, please cgi.escape() it,
same for the branch URL. If the implementation of displayname ever
changes it will continue to be safe.
[6]
+ return u'<label for="%s" style="font-weight: normal">%s</label>' % (
+ option_id, text)
Same as [6] for option_id.
[7]
+ def _autoselect_
...
+ def _get_suggestion
Other methods are camel-case, so these probably should be too.
| Aaron Bentley (abentley) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/11/2010 12:32 PM, Gavin Panella wrote:
> Review: Approve
> Looks good! Some quite trivial comments.
>
>
> [1]
>
> + @classmethod
> + def _generateSugges
>
> Any reason this is a class method? Not complaining, just wondering.
It needs to be a method to support polymorphism. I think it doesn't
make sense for something to be an instance method when it doesn't use
the instance. It does use the class, so it can't be a staticmethod.
> [2]
>
> + terms = [term for term in full_vocabulary
> + if term.value in suggestions]
>
> Indentation is a bit off.
Fixed.
> [3]
>
> + def _renderSuggesti
>
> This seems like an imperative name, "go and render the
> suggestions". Perhaps _shouldRenderSu
> me too :)
Done.
> [4]
>
> In http://
> drop-down box has "Foo Bar", but that's already a radio item. I think
> it's confusing, or perhaps ugly, to repeat choices. That's more of a
> UI thing though, and this is meant to be a code review :)
OTOH, if you were looking for one of your teams in the drop-down, I
think it would be confusing if it wasn't there because it was a radio item.
> [5]
>
> + text = '%s (<a href="%s">branch details</a>)' % (
> + branch.displayname, canonical_
>
> Even if branch.displayname cannot be invalid, please cgi.escape() it,
> same for the branch URL. If the implementation of displayname ever
> changes it will continue to be safe.
Done.
> [6]
>
> + return u'<label for="%s" style="font-weight: normal">%s</label>' % (
> + option_id, text)
>
> Same as [6] for option_id.
Done, by creating a new _optionID method for the whole thing.
> [7]
>
> + def _autoselect_
> ...
> + def _get_suggestion
>
> Other methods are camel-case, so these probably should be too.
Done. Also, _other_id => _otherId.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkz
aeEAoIHKcHt4gbN
=2JzN
-----END PGP SIGNATURE-----

Looks good to me. The only improvement I can think of would be to place the dropdown beside the 'Other' label rather than below it. It may not be worth the effort if it's too difficult to do so, though.