Merge lp:~jamalta/launchpad/relatedbugs-118609 into lp:launchpad

Proposed by Jamal Fanaian
Status: Merged
Approved by: Gavin Panella
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~jamalta/launchpad/relatedbugs-118609
Merge into: lp:launchpad
Diff against target: 74 lines (+26/-6)
2 files modified
lib/lp/registry/browser/person.py (+6/-6)
lib/lp/registry/stories/person/xx-person-bugs.txt (+20/-0)
To merge this branch: bzr merge lp:~jamalta/launchpad/relatedbugs-118609
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+18149@code.launchpad.net

Commit message

Specified 'bugs' as the site for links in the PersonBugsMenu, so that those links will work correctly, even outside the bugs site.

To post a comment you must log in.
Revision history for this message
Jamal Fanaian (jamalta) wrote :

= Summary =

Link in side menu from person's bug pages is not specifying the bugs site. So when a user clicks "List all related bugs", it will go to the person's overview instead of the related bugs list. (Bug #118609).

== Proposed fix ==

Add site='bugs' to related bugs link in PersonBugsMenu.

== Pre-implementation notes ==

EdwinGrubbs suggested the implementation and noted the correct place for the test.

== Implementation notes ==

To maintain consistency, site='bugs' was added as a parameter for all links in PersonBugsMenu.

== Tests ==

% bin/test -vvct xx-person-bugs

== Demo and Q/A ==

From https://launchpad.dev/~cprov/+assignedbugs click "List all related bugs"

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

This looks great, thanks for doing it!

I have only one comment. The description in the doctest is a little stylistically off. It should read like documentation. Can I suggest an alternative?

  The person bugs page can be accessed without being in the bugs
  site, yet all the menu links point to the bugs site.

There's no need to mention the bug number.

review: Approve
Revision history for this message
Jamal Fanaian (jamalta) wrote :

Updated the description for the doctest. Thanks so much!

=== modified file 'lib/lp/registry/stories/person/xx-person-bugs.txt'
--- lib/lp/registry/stories/person/xx-person-bugs.txt 2010-01-27 17:29:28 +0000
+++ lib/lp/registry/stories/person/xx-person-bugs.txt 2010-01-27 17:49:15 +0000
@@ -147,9 +147,8 @@

 === Person bugs menu ===

-The person bugs page can be accessed without being in the bugs site, so
-make sure the person bugs menu is linking to the bugs site correctly
-(https://launchpad.net/bugs/118609).
+The person bugs page can be accessed without being in the bugs
+site, yet all the menu links point to the bugs site.

     >>> anon_browser.open('http://launchpad.dev/~name12/+assignedbugs')
     >>> print anon_browser.getLink('List commented bugs').url

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/person.py'
2--- lib/lp/registry/browser/person.py 2010-01-11 20:07:17 +0000
3+++ lib/lp/registry/browser/person.py 2010-01-27 17:51:27 +0000
4@@ -748,36 +748,36 @@
5 text = 'List all related bugs'
6 summary = ('Lists all bug reports which %s reported, is assigned to, '
7 'or is subscribed to.' % self.context.displayname)
8- return Link('', text, summary=summary)
9+ return Link('', text, site='bugs', summary=summary)
10
11 def assignedbugs(self):
12 text = 'List assigned bugs'
13 summary = 'Lists bugs assigned to %s.' % self.context.displayname
14- return Link('+assignedbugs', text, summary=summary)
15+ return Link('+assignedbugs', text, site='bugs', summary=summary)
16
17 def softwarebugs(self):
18 text = 'Show package report'
19 summary = (
20 'A summary report for packages where %s is a bug supervisor.'
21 % self.context.displayname)
22- return Link('+packagebugs', text, summary=summary)
23+ return Link('+packagebugs', text, site='bugs', summary=summary)
24
25 def reportedbugs(self):
26 text = 'List reported bugs'
27 summary = 'Lists bugs reported by %s.' % self.context.displayname
28- return Link('+reportedbugs', text, summary=summary)
29+ return Link('+reportedbugs', text, site='bugs', summary=summary)
30
31 def subscribedbugs(self):
32 text = 'List subscribed bugs'
33 summary = ('Lists bug reports %s is subscribed to.'
34 % self.context.displayname)
35- return Link('+subscribedbugs', text, summary=summary)
36+ return Link('+subscribedbugs', text, site='bugs', summary=summary)
37
38 def commentedbugs(self):
39 text = 'List commented bugs'
40 summary = ('Lists bug reports on which %s has commented.'
41 % self.context.displayname)
42- return Link('+commentedbugs', text, summary=summary)
43+ return Link('+commentedbugs', text, site='bugs', summary=summary)
44
45
46 class PersonSpecsMenu(NavigationMenu):
47
48=== modified file 'lib/lp/registry/stories/person/xx-person-bugs.txt'
49--- lib/lp/registry/stories/person/xx-person-bugs.txt 2009-09-23 13:11:52 +0000
50+++ lib/lp/registry/stories/person/xx-person-bugs.txt 2010-01-27 17:51:27 +0000
51@@ -144,3 +144,23 @@
52 mozilla-firefox (Debian) Low Confirmed
53 13 Launchpad CSS and JS is not testible
54 Launchpad Undecided New
55+
56+=== Person bugs menu ===
57+
58+The person bugs page can be accessed without being in the bugs
59+site, yet all the menu links point to the bugs site.
60+
61+ >>> anon_browser.open('http://launchpad.dev/~name12/+assignedbugs')
62+ >>> print anon_browser.getLink('List commented bugs').url
63+ http://bugs.launchpad.dev/~name12/+commentedbugs
64+ >>> print anon_browser.getLink('List reported bugs').url
65+ http://bugs.launchpad.dev/~name12/+reportedbugs
66+ >>> print anon_browser.getLink('List subscribed bugs').url
67+ http://bugs.launchpad.dev/~name12/+subscribedbugs
68+ >>> print anon_browser.getLink('List all related bugs').url
69+ http://bugs.launchpad.dev/~name12
70+ >>> print anon_browser.getLink('Show package report').url
71+ http://bugs.launchpad.dev/~name12/+packagebugs
72+ >>> anon_browser.open('http://launchpad.dev/~name12/+commentedbugs')
73+ >>> print anon_browser.getLink('List assigned bugs').url
74+ http://bugs.launchpad.dev/~name12/+assignedbugs