Merge lp:~sinzui/launchpad/bug-tag-completions into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Curtis Hovey |
Approved revision: | no longer in the source branch. |
Merged at revision: | 15522 |
Proposed branch: | lp:~sinzui/launchpad/bug-tag-completions |
Merge into: | lp:launchpad |
Diff against target: |
381 lines (+198/-29) 10 files modified
lib/lp/app/javascript/autocomplete/autocomplete.js (+2/-0) lib/lp/app/javascript/autocomplete/tests/test_autocomplete.js (+3/-3) lib/lp/bugs/browser/widgets/bug.py (+34/-1) lib/lp/bugs/browser/widgets/tests/test_bug.py (+81/-0) lib/lp/bugs/javascript/bug_tags_entry.js (+20/-11) lib/lp/bugs/javascript/tests/test_bug_tags_entry.html (+9/-0) lib/lp/bugs/javascript/tests/test_bug_tags_entry.js (+45/-8) lib/lp/bugs/templates/bugtask-index.pt (+2/-2) lib/lp/bugs/templates/bugtask-macros-tableview.pt (+0/-2) lib/lp/registry/javascript/milestoneoverlay.js (+2/-2) |
To merge this branch: | bzr merge lp:~sinzui/launchpad/bug-tag-completions |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Richard Harding (community) | Approve | ||
j.c.sackett (community) | Approve | ||
Review via email: mp+112580@code.launchpad.net |
Commit message
Enable bug tag completions on +filebug and advanced bug search.
Description of the change
Recent refactorings of the bug tag entry code make it possible to
reuse the autocompletion part on +filebug and advanced bug search.
-------
RULES
Pre-
* Extract the autocompletion from setup_tag_entry() so that
other use cases can reuse it when the tag input field already
exists.
* Update +filebug to provide available_
* setup autocomplete in the template.
* Update advanced search to provide available_
* setup autocomplete in the template.
Addendum
* I tried to extend the Autocomplete widget, but I discovered that
I would also need to write a lot of duplicate css rules. The
subclass effectively renames all the presentation rules :(
* I tried a plugin, but it did not generate the markup before
the widget was initialised.
* I settled on a simple setup function.
QA
* Visit https:/
* Verify the bug tags input will complete tags.
* Choose Report a bug.
* Enter "testing", Continue, expand Extra options.
* Verify the bug tags input will complete tags.
LINT
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
TEST
./bin/test -vvc lp.bugs.
./bin/test -vvc --layer=YUITest
IMPLEMENTATION
I turn of the browser's autocomplete when the widget is run. The bug tag
completions were hidden under Chromium's completions. The browser must
be turned off for every input we add completions to.
lib/
lib/
I extracted the setup the autocomplete widget to a separate function
that could be called without the editor. I removed the "on('queryChange'"
because I discovered it did nothing when I wrote a test for it...it
was probably used to debug key input when the widget was created.
lib/
lib/
lib/
I Updated the BugTagsWidget to include the script to progressively
enhance any bug tag input to support autocomplete. This widget is used
both on advanced search and on +filebug. I moved the help link into the
widget to ensure it is always rendered and that it is rendered
consistently. I discovered that both +filebug and advanced bug had
duplicate ids in their crafted forms. A simple selector was not enough;
the selector must find the bug tag input field that is type="text".
lib/
lib/
lib/
Curtis--
This looks good. Just one style note.
In a few places (line 226 or 311, for example): It looks like you're doing
pythonic brace/paren closure in places. I think for javascript we have the
closing brace at the same tab level as the opening call, rather than at the
tab level of the enclosed lines.
In other words, I believe we prefer:
some_ call(function () {
stuff;
});
Rather than:
some_ call(function () {
stuff;
});