The proposal to merge lp:~sinzui/launchpad/adapt-subscription-to-pillar into lp:launchpad has been updated.
Description changed to: bug tags do not complete because the IBugSubscriptionFilter 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-implementation: no one * 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://bugs.qastaging.launchpad.net/~/+structural-subscriptions * Choose Create new filter * Verify that tags autocomplete * https://bugs.qastaging.launchpad.net/launchpad * 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/lp/app/javascript/autocomplete/autocomplete.js lib/lp/app/javascript/autocomplete/tests/test_autocomplete.js lib/lp/bugs/configure.zcml lib/lp/bugs/adapters/bugsubscriptionfilter.py lib/lp/bugs/adapters/tests/test_bugsubscriptionfilter.py lib/lp/bugs/javascript/bug_tags_entry.js lib/lp/bugs/javascript/tests/test_bug_tags_entry.js lib/lp/registry/javascript/structural-subscription.js lib/lp/registry/javascript/tests/test_structural_subscription.html lib/lp/registry/javascript/tests/test_structural_subscription.js TEST ./bin/test -vv lp.bugs.adapters.tests.test_bugsubscriptionfilter ./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/lp/app/javascript/autocomplete/autocomplete.js lib/lp/app/javascript/autocomplete/tests/test_autocomplete.js Created and registered adapters that convert the bugsubscriptionfilter to their product or distribution. The bug tag completer code knows how to generate the list of official tags when the pillar is available. lib/lp/bugs/configure.zcml lib/lp/bugs/adapters/bugsubscriptionfilter.py lib/lp/bugs/adapters/tests/test_bugsubscriptionfilter.py 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/lp/bugs/javascript/bug_tags_entry.js lib/lp/bugs/javascript/tests/test_bug_tags_entry.js I added setup_tag_complete() with the input and official bug tags. The 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/lp/registry/javascript/structural-subscription.js lib/lp/registry/javascript/tests/test_structural_subscription.html lib/lp/registry/javascript/tests/test_structural_subscription.js For more details, see: https://code.launchpad.net/~sinzui/launchpad/adapt-subscription-to-pillar/+merge/116095 -- https://code.launchpad.net/~sinzui/launchpad/adapt-subscription-to-pillar/+merge/116095 Your team Launchpad code reviewers is requested to review the proposed merge of lp:~sinzui/launchpad/adapt-subscription-to-pillar into lp:launchpad. _______________________________________________ Mailing list: https://launchpad.net/~launchpad-reviewers Post to : [email protected] Unsubscribe : https://launchpad.net/~launchpad-reviewers More help : https://help.launchpad.net/ListHelp

