Code review comment for lp:~allenap/launchpad/update-project-group-page-bug-434764

Revision history for this message
Gavin Panella (allenap) wrote :

This branch makes the bug search portlet consistent between the pages
for projects, project groups, distributions, distribution series,
source packages in distribution, and source packages in distribution
series. All of these pages now have a quick-to-load portlet that only
contains links to "canned" searches, and which makes an async request
to load the stats information.

It's a big branch, but most of it is refactoring or removal.

lib/lp/bugs/browser/bugtask.py

  New function get_default_search_params(), which is just the breaking
  out of _getDefaultSearchParams(). Also, _getDefaultSearchParams()
  applied an ordering to the parameters, but none of the call-sites
  cared, so I dropped that.

  Two new mixin classes: BugsInfoMixin and BugsStatsMixin. The latter
  inherits from the former. These provide several properties, like
  open_bugs_url and pending_bugwatches_count. These properties are
  refactored from methods like getUnassignedBugsURL() and several
  *_info properties that hung directly off the view. The *_info
  properties returned dicts containing a count and url; the mixins now
  provide two properties.

  The BugsInfoMixin is mixed into views that need URLs the "canned"
  searches it knows about. BugsStatsMixin is used when views need URLs
  and counts. Because calculating the counts can take a long time,
  this typically means that the latter views are fetched
  asynchronously by the browser.

  Two of these views are BugListingPortletInfoView and
  BugListingPortletStatsView.

lib/lp/bugs/browser/configure.zcml

  Replace the registration of +bugtarget-portlet-bugfilters-content
  with two views, one for just the URLs and the other for URLs and
  counts.

lib/lp/bugs/browser/tests/bugtask-search-views.txt

  Remove some tests that are now in xx-bugs-statistics-portlet. In
  fact, the tests removed were poor tests because a lot of the time
  they were not testing the view at all.

lib/lp/bugs/browser/tests/special/bugs-fixed-elsewhere.txt

  Fix this up to work with the new properties in the mixins. Mostly
  mechanical changes.

lib/lp/bugs/stories/bugtask-searches/xx-advanced-upstream-pending-bugwatch.txt
lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt

  Small mechanical changes.

lib/lp/bugs/stories/distribution/xx-distribution-bug-statistics-portlet-authenticated.txt
lib/lp/bugs/stories/distribution/xx-distribution-bug-statistics-portlet-unauthenticated.txt

  Removed because it's now all in xx-bugs-statistics-portlet, and
  these are very old style tests.

lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt

  New. Explains and demonstrates the new portlet views.

lib/lp/bugs/templates/bugtarget-bugs.pt

  Bits moved to bugtarget-portlet-bugfilters-content.pt.

lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt

  Originally from bugtarget-bugs.pt, but changed since. Pretty simple
  table stuff. There's an comment in there to explain how the template
  can be used for both the without-counts and the with-count views.

lib/lp/bugs/templates/bugtarget-portlet-bugfilters.pt

  Clean up the portlet body and update the javascript to load the
  stats.

lib/lp/registry/browser/project.py

  Add a subscribe link to project groups.

« Back to merge proposal