Merge lp:~gmb/launchpad/scars-of-ajax-dupefinding into lp:launchpad

Proposed by Graham Binns
Status: Merged
Merged at revision: not available
Proposed branch: lp:~gmb/launchpad/scars-of-ajax-dupefinding
Merge into: lp:launchpad
Prerequisite: lp:~gmb/launchpad/taste-the-blood-of-ajax-dupefinding
Diff against target: 70 lines (+12/-19)
3 files modified
lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js (+5/-3)
lib/lp/bugs/browser/bugtarget.py (+0/-7)
lib/lp/bugs/templates/bugtarget-filebug-search.pt (+7/-9)
To merge this branch: bzr merge lp:~gmb/launchpad/scars-of-ajax-dupefinding
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Canonical Launchpad Engineering code js Pending
Review via email: mp+16009@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) wrote :

This branch enables the async dupesearch for packages and distros.

I've done this by:

 - Removing the use_async_dupefinder property from FileBugViewBase and
   the bugtarget-filebug-search template, since it's no longer needed.
 - Updating the JS in filebug-dupefinder.js to make sure that the onChange
   handler that calls reload_filebug_form() only gets called when the project
   field gets changed (without this change it gets called when the package
   field is changed, too, which makes no sense).

Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js'
--- lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js 2009-12-11 11:39:14 +0000
+++ lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js 2009-12-11 11:39:14 +0000
@@ -349,9 +349,11 @@
349349
350 // If there's a product field, hook it up to the350 // If there's a product field, hook it up to the
351 // reload_filebug_form() function.351 // reload_filebug_form() function.
352 Y.on('change', function(e) {352 var product_field = Y.one(Y.DOM.byId('field.product'));
353 reload_filebug_form();353 if (Y.Lang.isValue(product_field)) {
354 }, Y.DOM.byId('field.product'));354 Y.log(product_field);
355 product_field.on('change', reload_filebug_form);
356 }
355357
356 // Update the label on the search button so that it no longer358 // Update the label on the search button so that it no longer
357 // says "Continue".359 // says "Continue".
358360
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2009-12-11 11:39:14 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2009-12-11 11:39:14 +0000
@@ -360,13 +360,6 @@
360 if 'field.actions' in key] != [] or360 if 'field.actions' in key] != [] or
361 self.user.inTeam(bug_supervisor))361 self.user.inTeam(bug_supervisor))
362362
363 @property
364 def use_asynchronous_dupefinder(self):
365 """Return True if the asynchronous dupe finder can be used."""
366 return (
367 IProduct.providedBy(self.context) or
368 IProject.providedBy(self.context))
369
370 def getPackageNameFieldCSSClass(self):363 def getPackageNameFieldCSSClass(self):
371 """Return the CSS class for the packagename field."""364 """Return the CSS class for the packagename field."""
372 if self.widget_errors.get("packagename"):365 if self.widget_errors.get("packagename"):
373366
=== modified file 'lib/lp/bugs/templates/bugtarget-filebug-search.pt'
--- lib/lp/bugs/templates/bugtarget-filebug-search.pt 2009-12-11 11:39:14 +0000
+++ lib/lp/bugs/templates/bugtarget-filebug-search.pt 2009-12-11 11:39:14 +0000
@@ -14,14 +14,12 @@
14 tal:define="lp_js string:${icingroot}/build"14 tal:define="lp_js string:${icingroot}/build"
15 tal:attributes="src string:${lp_js}/bugs/filebug-dupefinder.js"></script>15 tal:attributes="src string:${lp_js}/bugs/filebug-dupefinder.js"></script>
1616
17 <tal:dupe-finder-js condition="view/use_asynchronous_dupefinder">17 <script type="text/javascript">
18 <script type="text/javascript">18 LPS.use(
19 LPS.use(19 'base', 'node', 'oop', 'event', 'bugs.dupe_finder', function(Y) {
20 'base', 'node', 'oop', 'event', 'bugs.dupe_finder', function(Y) {20 Y.bugs.setup_dupe_finder();
21 Y.bugs.setup_dupe_finder();21 });
22 });22 </script>
23 </script>
24 </tal:dupe-finder-js>
25 </metal:block>23 </metal:block>
2624
27 <div metal:fill-slot="heading">25 <div metal:fill-slot="heading">
@@ -116,7 +114,7 @@
116 <div id="filebug-form-container" style="display: none;">114 <div id="filebug-form-container" style="display: none;">
117 </div>115 </div>
118116
119 <p style="display: none" tal:condition="view/use_asynchronous_dupefinder">117 <p style="display: none">
120 <a id="filebug-base-url"118 <a id="filebug-base-url"
121 tal:attributes="href view/inline_filebug_base_url"></a>119 tal:attributes="href view/inline_filebug_base_url"></a>
122 <a id="filebug-form-url"120 <a id="filebug-form-url"