Merge lp://staging/~sinzui/launchpad/pillar-portlets into lp://staging/launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Aaron Bentley
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~sinzui/launchpad/pillar-portlets
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~sinzui/launchpad/pillar-portlets
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+10932@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

This is my branch to fix involvement links.

    lp:~sinzui/launchpad/pillar-portlets
    Diff size: 53
    Launchpad bug: https://bugs.launchpad.net/bugs/416125
                   https://bugs.launchpad.net/bugs/418548
                   https://bugs.launchpad.net/bugs/421899
    Test command: ./bin/test -vvt "pillar-views"
    Pre-implementation: no-one, I trust the bug reporters
    Target release: 3.1.0

= Fix involvement links and official portlets =

Bug 416125 [product homepage's submit code link leads to +filebug]
    The link is to file a bug, not register a branch.

Bug 418548 [Help translate" link in Get involved portlet is broken]
    The link is missing the pillar; it goes to the root.

Bug 421899 [register a blueprint" leads to a 404 on edge]
    The link is register a branch, not a spec.

== Rules ==

Bug 416125 [product homepage's submit code link leads to +filebug]
    * Change the link to +addbranch.

Bug 418548 [Help translate" link in Get involved portlet is broken]
    * Replace '/' with '' because the former removes the context from
      the URL.

Bug 421899 [register a blueprint" leads to a 404 on edge]
    * Change the link to +addspec.

== QA ==

Bug 416125 [product homepage's submit code link leads to +filebug]
    * Visit https://edge.launchpad.net/epidermis
    * Verify that the submit code link goes to +addbranch

Bug 418548 [Help translate" link in Get involved portlet is broken]
    * Visit https://edge.launchpad.net/epidermis
    * Verify that the submit code link goes to
      https://translate.edge.launchpad.net/epidermis

Bug 421899 [register a blueprint" leads to a 404 on edge]
    * Visit https://edge.launchpad.net/epidermis
     * Verify that the register a blueprint link goes to +addspec

== Lint ==

Linting changed files:
  lib/lp/registry/browser/pillar.py
  lib/lp/registry/browser/tests/pillar-views.txt

== Test ==

    * lib/lp/registry/browser/tests/pillar-views.txt
      * Added a test of the entire menu. The tests for whether a link
        is enabled are fine, but there was not a test to verify the target.

== Implementation ==

    * lib/lp/registry/browser/pillar.py
      * Fixed the target param of three links.

Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Curtis Hovey wrote:
> Curtis Hovey has proposed merging lp:~sinzui/launchpad/pillar-portlets into lp:launchpad/devel.
>
> Requested reviews:
> Canonical Launchpad Engineering (launchpad)
>
> This is my branch to fix involvement links.

 merge approved

Looks good.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqcJY4ACgkQ0F+nu1YWqI3L6ACfYMa3EwkryNe7cBWIaAUR5qR/
UQEAnidFb+sCUZUEbZr9FdiJ9OhgyrxG
=ebQn
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/pillar.py'
2--- lib/lp/registry/browser/pillar.py 2009-08-28 13:58:36 +0000
3+++ lib/lp/registry/browser/pillar.py 2009-08-31 16:37:27 +0000
4@@ -49,17 +49,17 @@
5
6 def help_translate(self):
7 return Link(
8- '/', 'Help translate', site='translations', icon='translations',
9+ '', 'Help translate', site='translations', icon='translations',
10 enabled=self.context.official_rosetta)
11
12 def submit_code(self):
13 return Link(
14- '+filebug', 'Submit code', site='code', icon='code',
15+ '+addbranch', 'Submit code', site='code', icon='code',
16 enabled=self.context.official_codehosting)
17
18 def register_blueprint(self):
19 return Link(
20- '+addbranch', 'Register a blueprint', site='blueprints',
21+ '+addspec', 'Register a blueprint', site='blueprints',
22 icon='blueprints', enabled=self.context.official_blueprints)
23
24
25
26=== modified file 'lib/lp/registry/browser/tests/pillar-views.txt'
27--- lib/lp/registry/browser/tests/pillar-views.txt 2009-08-28 12:01:43 +0000
28+++ lib/lp/registry/browser/tests/pillar-views.txt 2009-08-31 16:37:27 +0000
29@@ -120,3 +120,23 @@
30 >>> for link in view.enabled_links:
31 ... print link.name
32 report_bug ask_question
33+
34+
35+Involvement links
36+-----------------
37+
38+The pillar involvement view uses the InvolvedMenu when rendering links:
39+
40+ >>> from operator import attrgetter
41+ >>> from canonical.launchpad.webapp.tales import MenuAPI
42+
43+ >>> view = create_view(product, '+get-involved')
44+ >>> menuapi = MenuAPI(view)
45+ >>> for link in sorted(
46+ ... menuapi.navigation.values(), key=attrgetter('sort_key')):
47+ ... print link.url
48+ http://bugs.launchpad.dev/bread/+filebug
49+ http://answers.launchpad.dev/bread/+addquestion
50+ http://translations.launchpad.dev/bread
51+ http://code.launchpad.dev/bread/+addbranch
52+ http://blueprints.launchpad.dev/bread/+addspec
53