Ajax controls disabled on bugs with many tasks due to multiple redundant copies of person picker make_picker function in view-source:https://bugs.launchpad.net/launchpad-project/+bugs?advanced=1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
j.c.sackett |
Bug Description
We have multiple person picker instances on the page, and in the source the script segment below is emitted once for each, which is wasteful in a few ways:
- the page is larger
- more to evaluate
<script>
LPS.use('node', 'lp.app.picker', 'plugin', function(Y) {
if (Y.UA.ie) {
return;
}
// Args from python.
var args = {"header": "Select a Person or Team", "show_widget_id": "show-widget-
// The vocabulary picker, created when used for the first time.
var picker = null;
function make_picker() {
var config = {
header: args.header,
};
var picker = Y.lp.app.
if (config.
var new_results = e.details[
if (new_results.length === 0) {
}
}
});
}
return picker;
}
// Sort out the "Choose..." link.
var show_widget_node = Y.get('#' + args.show_
show_
show_
show_
show_
if (picker === null) {
picker = make_picker();
}
});
});
</script>
Related branches
- Robert Collins (community): Approve
-
Diff: 192 lines (+74/-17)6 files modifiedlib/lp/answers/browser/tests/test_questiontarget.py (+1/-1)
lib/lp/app/widgets/popup.py (+22/-0)
lib/lp/app/widgets/templates/form-picker-macros.pt (+27/-12)
lib/lp/app/widgets/tests/test_popup.py (+22/-2)
lib/lp/blueprints/browser/tests/test_specificationtarget.py (+1/-1)
lib/lp/bugs/browser/tests/test_bugs.py (+1/-1)
- j.c.sackett (community): Approve
-
Diff: 192 lines (+17/-74)6 files modifiedlib/lp/answers/browser/tests/test_questiontarget.py (+1/-1)
lib/lp/app/widgets/popup.py (+0/-22)
lib/lp/app/widgets/templates/form-picker-macros.pt (+12/-27)
lib/lp/app/widgets/tests/test_popup.py (+2/-22)
lib/lp/blueprints/browser/tests/test_specificationtarget.py (+1/-1)
lib/lp/bugs/browser/tests/test_bugs.py (+1/-1)
- Jeroen T. Vermeulen (community): Approve
-
Diff: 45 lines (+16/-7)2 files modifiedlib/lp/bugs/templates/buglisting-default.pt (+10/-3)
lib/lp/registry/browser/tests/test_subscription_links.py (+6/-4)
summary: |
- multiple redundant copies of person picker make_picker function in view- + Ajax controls disabled on bugs with many tasks due to multiple redundant + copies of person picker make_picker function in view- source:https://bugs.launchpad.net/launchpad-project/+bugs?advanced=1 |
tags: | added: person-picker regression |
tags: | added: disclosure |
Changed in launchpad: | |
importance: | High → Critical |
Changed in launchpad: | |
assignee: | nobody → j.c.sackett (jcsackett) |
status: | Triaged → In Progress |
tags: | added: bad-commit-13251 |
tags: | removed: qa-bad |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
status: | Fix Released → In Progress |
Fixed in stable r13251 <http:// bazaar. launchpad. net/~launchpad- pqm/launchpad/ stable/ revision/ 13251>.