← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jcsackett/launchpad/picker-buttons-should-disappear into lp:launchpad

 

The proposal to merge lp:~jcsackett/launchpad/picker-buttons-should-disappear into lp:launchpad has been updated.

Description changed to:

Summary
=======
Personpicker introduces assign me and remove assignee buttons to all person assigning activities. However, it's confusing to see the assign me and remove me buttons when there are results from a search in the picker.

This branch makes the buttons disappear if there are search results, but provides the buttons if no results are found, in which case one might concievably want to assign one's self.

Proposed fix
============
Using the YUI event model, we want to detect the presence of results and hide the extra buttons if they exist after results are loaded.

Pre-implementation notes
========================
Spoke with Curtis Hovey, explaining likely implementation.

Implementation details
======================
The personpicker now has overrided the picker's bindUI call, adding a section that creates a handler for the 'resultChange' event fired by the picker. This handler checks for the result condition (e.g. are there results, and was a search done) and determines whether to apply the unseen class to the extra buttons based on that information.

There are also some drive by fixes to the method invocations in personpicker, to make better use of the YUI event and widget model.

Tests
=====
firefox lib/lp/app/javascript/tests/test_personpicker.html

Demo and Q/A
============
Do a search with the personpicker (e.g. on launchpad.dev/evolution/+edit-people). If you search for a value with results (e.g. 'name') the extra buttons are not shown. If you search for a value without results (e.g. 'nobody') the buttons are displayed.

Lint
====
Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/app/javascript/widgets.js
  lib/lp/app/javascript/tests/test_personpicker.js
  lib/lp/app/javascript/tests/test_picker.js

./lib/lp/app/javascript/widgets.js
      14: 'Picker' has not been fully defined yet.
      79: 'PersonPicker' has not been fully defined yet.

The errors can be ignored as they're part of the javascript extension.

For more details, see:
https://code.launchpad.net/~jcsackett/launchpad/picker-buttons-should-disappear/+merge/65562
-- 
https://code.launchpad.net/~jcsackett/launchpad/picker-buttons-should-disappear/+merge/65562
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/picker-buttons-should-disappear into lp:launchpad.


References