Merge lp:~sinzui/launchpad/adapt-subscription-to-pillar into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Curtis Hovey on 2012-07-23 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 15669 |
| Proposed branch: | lp:~sinzui/launchpad/adapt-subscription-to-pillar |
| Merge into: | lp:launchpad |
| Diff against target: |
338 lines (+161/-16) 10 files modified
lib/lp/app/javascript/autocomplete/autocomplete.js (+4/-2) lib/lp/app/javascript/autocomplete/tests/test_autocomplete.js (+10/-0) lib/lp/bugs/adapters/bugsubscriptionfilter.py (+26/-0) lib/lp/bugs/adapters/tests/test_bugsubscriptionfilter.py (+64/-0) lib/lp/bugs/configure.zcml (+8/-0) lib/lp/bugs/javascript/bug_tags_entry.js (+5/-5) lib/lp/bugs/javascript/tests/test_bug_tags_entry.js (+4/-3) lib/lp/registry/javascript/structural-subscription.js (+17/-3) lib/lp/registry/javascript/tests/test_structural_subscription.html (+5/-1) lib/lp/registry/javascript/tests/test_structural_subscription.js (+18/-2) |
| To merge this branch: | bzr merge lp:~sinzui/launchpad/adapt-subscription-to-pillar |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Benji York (community) | code | 2012-07-20 | Approve on 2012-07-23 |
|
Review via email:
|
|||
Commit Message
enable bug tag autocompletion in subscription filters.
Description of the Change
bug tags do not complete because the IBugSubscriptio
class cannot be adapted to an IProduct or IDistribution to provide
the official list of bug tags. Adding autocomplete to the filter's
input field is two lines of code.
-------
RULES
Pre-
* Create an adapter for IProduct and IDistribution
* Verify autocompletion works in the HTML forms
* Call bug_tags_entry() when the input is created and pass in the
official list of bug tags.
ADDENDUM
* OMG! This was so must harder than is should be.
* We have never used autocomplete in an overlay before...It runs but
you cannot see it because it is 1000 z-index's below the overlay!
* The bug tag completer setup code can only be called once because
it uses ids!
* The structural subscription module is just a namespace of procedural
code with few entry points to call, return, or instrument to test!
QA
* https:/
* Choose Create new filter
* Verify that tags autocomplete
* https:/
* Choose Subscribe to bug mail and expand the tag section
* Verify the tag editor completes.
* Save the subscription
* Choose Edit bug mail
* Edit a subscription, expand the tags
* Enter text to see the suggestions, press Esc
* Edit a different subscription, expand the tags
* Enter text, verify you do not see the previous list of suggests...
you only see the list for what you are typing.
LINT
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
TEST
./bin/test -vv lp.bugs.
./bin/test -vvc --layer=YUITest lp
IMPLEMENTATION
Let me see the autocomplete list that decorates the input field. This is
set at 31000 because something might need to be higher, but in general
user input is always the highest thing on the stack, so autocomplete should
be the highest.
lib/
lib/
Created and registered adapters that convert the bugsubscription
their product or distribution. The bug tag completer code knows how to
generate the list of official tags when the pillar is available.
lib/
lib/
lib/
I discovered that the +subscriptions view created multiple overlays, each
with its own autocomplete. Editing failed after a few uses because the
bug_tags_entry() assumes it is used once and can use an id.
lib/
lib/
I added setup_tag_
completer has to be cleaned up to ensure there is only one list of
suggestions in existence at any one time. I made the tag split() code
more robust by stripping leading and trailing white-space.
lib/
lib/
lib/

Looks good.