Merge lp:~jcsackett/launchpad/pick-2-letters-okay into lp:launchpad

Proposed by j.c.sackett
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 15371
Proposed branch: lp:~jcsackett/launchpad/pick-2-letters-okay
Merge into: lp:launchpad
Diff against target: 13 lines (+2/-1)
1 file modified
lib/lp/registry/javascript/team.js (+2/-1)
To merge this branch: bzr merge lp:~jcsackett/launchpad/pick-2-letters-okay
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Review via email: mp+108839@code.launchpad.net

Commit message

Passes in correct config to pickerpatcher for adding members to a team via person picker.

Description of the change

Summary
=======
The person picker appeared to not allow searching on less than 3 characters,
like other pickers in LP. The picker has a min_search_chars attribute that
determines how many characters are required to perform a search. A quick check
showed that the person picker has correctly set the min_search_chars attribute
to 2; the base picker attribute is 3.

The only place that actually has this problem is the addmember code. Checking
team.js reveals that it's calling the picker_patcher `create` function
without passing in "person" as the picker type.

Preimp
======
Spoke with Curtis Hovey.

Implementation
==============
The quickest fix is to just change the config passed into addmember; that's
all this branch does. I started to really clean up the picker code to make
this sort of mistake easier to find elsewhere and less likely to happen again,
but decided the work was out of scope and there was no good reason to keep
this bug open another day. I'll follow up on cleanup in slack time.

Tests
=====
bin/test -vvct team --layer=YUI

QA
==
Confirm that you can search for 'ev' in the addmember button.

LoC
===
This is part of disclosure. That said, a picker cleanup will more than offset
the line added here.

Lint
====

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/javascript/team.js

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/javascript/team.js'
2--- lib/lp/registry/javascript/team.js 2012-03-21 01:25:32 +0000
3+++ lib/lp/registry/javascript/team.js 2012-06-06 13:08:19 +0000
4@@ -18,7 +18,8 @@
5 var config = {
6 header: 'Add a member',
7 step_title: step_title,
8- picker_activator: '.menu-link-add_member'
9+ picker_activator: '.menu-link-add_member',
10+ picker_type: 'person'
11 };
12
13 config.save = _add_member;