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
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2010-01-11 20:07:17 +0000
+++ lib/lp/registry/browser/person.py 2010-01-27 17:51:27 +0000
@@ -748,36 +748,36 @@
748 text = 'List all related bugs'748 text = 'List all related bugs'
749 summary = ('Lists all bug reports which %s reported, is assigned to, '749 summary = ('Lists all bug reports which %s reported, is assigned to, '
750 'or is subscribed to.' % self.context.displayname)750 'or is subscribed to.' % self.context.displayname)
751 return Link('', text, summary=summary)751 return Link('', text, site='bugs', summary=summary)
752752
753 def assignedbugs(self):753 def assignedbugs(self):
754 text = 'List assigned bugs'754 text = 'List assigned bugs'
755 summary = 'Lists bugs assigned to %s.' % self.context.displayname755 summary = 'Lists bugs assigned to %s.' % self.context.displayname
756 return Link('+assignedbugs', text, summary=summary)756 return Link('+assignedbugs', text, site='bugs', summary=summary)
757757
758 def softwarebugs(self):758 def softwarebugs(self):
759 text = 'Show package report'759 text = 'Show package report'
760 summary = (760 summary = (
761 'A summary report for packages where %s is a bug supervisor.'761 'A summary report for packages where %s is a bug supervisor.'
762 % self.context.displayname)762 % self.context.displayname)
763 return Link('+packagebugs', text, summary=summary)763 return Link('+packagebugs', text, site='bugs', summary=summary)
764764
765 def reportedbugs(self):765 def reportedbugs(self):
766 text = 'List reported bugs'766 text = 'List reported bugs'
767 summary = 'Lists bugs reported by %s.' % self.context.displayname767 summary = 'Lists bugs reported by %s.' % self.context.displayname
768 return Link('+reportedbugs', text, summary=summary)768 return Link('+reportedbugs', text, site='bugs', summary=summary)
769769
770 def subscribedbugs(self):770 def subscribedbugs(self):
771 text = 'List subscribed bugs'771 text = 'List subscribed bugs'
772 summary = ('Lists bug reports %s is subscribed to.'772 summary = ('Lists bug reports %s is subscribed to.'
773 % self.context.displayname)773 % self.context.displayname)
774 return Link('+subscribedbugs', text, summary=summary)774 return Link('+subscribedbugs', text, site='bugs', summary=summary)
775775
776 def commentedbugs(self):776 def commentedbugs(self):
777 text = 'List commented bugs'777 text = 'List commented bugs'
778 summary = ('Lists bug reports on which %s has commented.'778 summary = ('Lists bug reports on which %s has commented.'
779 % self.context.displayname)779 % self.context.displayname)
780 return Link('+commentedbugs', text, summary=summary)780 return Link('+commentedbugs', text, site='bugs', summary=summary)
781781
782782
783class PersonSpecsMenu(NavigationMenu):783class PersonSpecsMenu(NavigationMenu):
784784
=== modified file 'lib/lp/registry/stories/person/xx-person-bugs.txt'
--- lib/lp/registry/stories/person/xx-person-bugs.txt 2009-09-23 13:11:52 +0000
+++ lib/lp/registry/stories/person/xx-person-bugs.txt 2010-01-27 17:51:27 +0000
@@ -144,3 +144,23 @@
144 mozilla-firefox (Debian) Low Confirmed144 mozilla-firefox (Debian) Low Confirmed
145 13 Launchpad CSS and JS is not testible145 13 Launchpad CSS and JS is not testible
146 Launchpad Undecided New146 Launchpad Undecided New
147
148=== Person bugs menu ===
149
150The person bugs page can be accessed without being in the bugs
151site, yet all the menu links point to the bugs site.
152
153 >>> anon_browser.open('http://launchpad.dev/~name12/+assignedbugs')
154 >>> print anon_browser.getLink('List commented bugs').url
155 http://bugs.launchpad.dev/~name12/+commentedbugs
156 >>> print anon_browser.getLink('List reported bugs').url
157 http://bugs.launchpad.dev/~name12/+reportedbugs
158 >>> print anon_browser.getLink('List subscribed bugs').url
159 http://bugs.launchpad.dev/~name12/+subscribedbugs
160 >>> print anon_browser.getLink('List all related bugs').url
161 http://bugs.launchpad.dev/~name12
162 >>> print anon_browser.getLink('Show package report').url
163 http://bugs.launchpad.dev/~name12/+packagebugs
164 >>> anon_browser.open('http://launchpad.dev/~name12/+commentedbugs')
165 >>> print anon_browser.getLink('List assigned bugs').url
166 http://bugs.launchpad.dev/~name12/+assignedbugs