← Back to team overview

launchpad-reviewers team mailing list archive

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

 

j.c.sackett has proposed merging lp:~jcsackett/launchpad/pick-2-letters-okay into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jcsackett/launchpad/pick-2-letters-okay/+merge/108839

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
-- 
https://code.launchpad.net/~jcsackett/launchpad/pick-2-letters-okay/+merge/108839
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/pick-2-letters-okay into lp:launchpad.
=== modified file 'lib/lp/registry/javascript/team.js'
--- lib/lp/registry/javascript/team.js	2012-03-21 01:25:32 +0000
+++ lib/lp/registry/javascript/team.js	2012-06-05 22:07:20 +0000
@@ -18,7 +18,8 @@
     var config = {
         header: 'Add a member',
         step_title: step_title,
-        picker_activator: '.menu-link-add_member'
+        picker_activator: '.menu-link-add_member',
+        picker_type: 'person'
     };
 
     config.save = _add_member;


Follow ups