Merge lp:~michael.nelson/launchpad/219222-edit-ppa-dependencies-rename into lp:launchpad

Proposed by Michael Nelson
Status: Merged
Merged at revision: not available
Proposed branch: lp:~michael.nelson/launchpad/219222-edit-ppa-dependencies-rename
Merge into: lp:launchpad
Diff against target: 142 lines
5 files modified
lib/canonical/launchpad/pagetitles.py (+0/-2)
lib/lp/soyuz/browser/archive.py (+4/-1)
lib/lp/soyuz/browser/tests/archive-views.txt (+8/-0)
lib/lp/soyuz/stories/ppa/xx-edit-dependencies.txt (+11/-10)
lib/lp/soyuz/templates/archive-edit-dependencies.pt (+0/-6)
To merge this branch: bzr merge lp:~michael.nelson/launchpad/219222-edit-ppa-dependencies-rename
Reviewer Review Type Date Requested Status
Abel Deuring (community) Approve
Review via email: mp+13468@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

= Summary =

This branch fixes bug 219222 simply by renaming 'Edit dependencies' to
'Edit ppa dependencies'.

http://people.canonical.com/~michaeln/tmp/edit-dependencies-link.png

I also used the opportunity to get rid of the old pagetitles.py entry
and update the related view with the label/page_title.

http://people.canonical.com/~michaeln/tmp/edit-dependencies-heading.png

My main concern is that this makes the action text quite long - meaning
that it wraps when the window is not reasonably wide. Actually, I think
my concern is more generally with *how* those actions with icons wrap
across LP generally - it'd be much nicer if the wrapped line aligned
with the RHS of the icon.

== Tests ==

bin/test -vv -t archive-views.txt -t xx-edit-dependencies.txt

== Demo and Q/A ==

Log in as <email address hidden>:test and visit:

https://launchpad.dev/~cprov/+archive/ppa

Click on 'Edit PPA dependencies'.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/canonical/launchpad/pagetitles.py
  lib/lp/soyuz/browser/tests/archive-views.txt
  lib/lp/soyuz/templates/archive-edit-dependencies.pt
  lib/lp/soyuz/stories/ppa/xx-edit-dependencies.txt
  lib/lp/soyuz/browser/archive.py

--
Michael

Revision history for this message
Abel Deuring (adeuring) wrote :

Hi Michael,

nice work! just one nitpick:

> @@ -39,12 +39,13 @@
> ... auth='Basic <email address hidden>:test')
> >>> no_priv_browser.open("http://launchpad.dev/~no-priv/+archive/ppa")
>
> - >>> no_priv_browser.getLink('Edit dependencies').click()
> + >>> no_priv_browser.getLink('Edit PPA dependencies').click()
> >>> print no_priv_browser.url
> http://launchpad.dev/~no-priv/+archive/ppa/+edit-dependencies
>
> >>> print no_priv_browser.title
> - Edit dependencies for PPA for No Privileges Person...
> + Edit PPA dependencies : PPA for No Privileges Person :
> + No Privileges Person
>
> Only Celso and an administrator can access the 'Edit dependencies'
> page for Celso's PPA.

Not really important, but could you you s/'Edit dependencies'/'Edit PPA dependencies' ?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/pagetitles.py'
2--- lib/canonical/launchpad/pagetitles.py 2009-10-05 22:14:18 +0000
3+++ lib/canonical/launchpad/pagetitles.py 2009-10-30 12:35:24 +0000
4@@ -126,8 +126,6 @@
5
6 archive_edit = ContextDisplayName('Edit %s')
7
8-archive_edit_dependencies = ContextDisplayName('Edit dependencies for %s')
9-
10 bazaar_all_branches = 'All branches in the Launchpad Bazaar'
11
12 bazaar_index = 'Launchpad Branches'
13
14=== modified file 'lib/lp/soyuz/browser/archive.py'
15--- lib/lp/soyuz/browser/archive.py 2009-10-16 11:47:55 +0000
16+++ lib/lp/soyuz/browser/archive.py 2009-10-30 12:35:24 +0000
17@@ -391,7 +391,7 @@
18
19 @enabled_with_permission('launchpad.Edit')
20 def edit_dependencies(self):
21- text = 'Edit dependencies'
22+ text = 'Edit PPA dependencies'
23 return Link('+edit-dependencies', text, icon='edit')
24
25
26@@ -1303,6 +1303,9 @@
27 custom_widget('primary_components', LaunchpadRadioWidget,
28 cssClass='highlight-selected')
29
30+ label = "Edit PPA dependencies"
31+ page_title = label
32+
33 def initialize(self):
34 self.cancel_url = canonical_url(self.context)
35 self._messages = []
36
37=== modified file 'lib/lp/soyuz/browser/tests/archive-views.txt'
38--- lib/lp/soyuz/browser/tests/archive-views.txt 2009-10-28 14:42:40 +0000
39+++ lib/lp/soyuz/browser/tests/archive-views.txt 2009-10-30 12:35:24 +0000
40@@ -634,6 +634,14 @@
41 >>> view = create_initialized_view(
42 ... cprov.archive, name="+edit-dependencies")
43
44+The view's h1 heading and leaf breadcrumb are equivalent.
45+
46+ >>> print view.label
47+ Edit PPA dependencies
48+
49+ >>> print view.page_title
50+ Edit PPA dependencies
51+
52 There is a property indicating whether or not the context PPA has
53 recorded dependencies.
54
55
56=== modified file 'lib/lp/soyuz/stories/ppa/xx-edit-dependencies.txt'
57--- lib/lp/soyuz/stories/ppa/xx-edit-dependencies.txt 2009-09-18 15:24:30 +0000
58+++ lib/lp/soyuz/stories/ppa/xx-edit-dependencies.txt 2009-10-30 12:35:24 +0000
59@@ -9,7 +9,7 @@
60 edit dependencies, even if they try the URL directly.
61
62 >>> anon_browser.open('http://launchpad.dev/~cprov/+archive')
63- >>> anon_browser.getLink('Edit dependencies').click()
64+ >>> anon_browser.getLink('Edit PPA dependencies').click()
65 Traceback (most recent call last):
66 ...
67 LinkNotFoundError
68@@ -21,7 +21,7 @@
69 Unauthorized: ..., 'launchpad.Edit')
70
71 >>> user_browser.open('http://launchpad.dev/~cprov/+archive/ppa')
72- >>> user_browser.getLink('Edit dependencies').click()
73+ >>> user_browser.getLink('Edit PPA dependencies').click()
74 Traceback (most recent call last):
75 ...
76 LinkNotFoundError
77@@ -39,31 +39,32 @@
78 ... auth='Basic no-priv@canonical.com:test')
79 >>> no_priv_browser.open("http://launchpad.dev/~no-priv/+archive/ppa")
80
81- >>> no_priv_browser.getLink('Edit dependencies').click()
82+ >>> no_priv_browser.getLink('Edit PPA dependencies').click()
83 >>> print no_priv_browser.url
84 http://launchpad.dev/~no-priv/+archive/ppa/+edit-dependencies
85
86 >>> print no_priv_browser.title
87- Edit dependencies for PPA for No Privileges Person...
88+ Edit PPA dependencies : PPA for No Privileges Person :
89+ No Privileges Person
90
91-Only Celso and an administrator can access the 'Edit dependencies'
92+Only Celso and an administrator can access the 'Edit PPA dependencies'
93 page for Celso's PPA.
94
95 >>> cprov_browser = setupBrowser(
96 ... auth="Basic celso.providelo@canonical.com:cprov")
97 >>> cprov_browser.open('http://launchpad.dev/~cprov/+archive/ppa')
98- >>> cprov_browser.getLink('Edit dependencies').click()
99+ >>> cprov_browser.getLink('Edit PPA dependencies').click()
100 >>> print cprov_browser.url
101 http://launchpad.dev/~cprov/+archive/ppa/+edit-dependencies
102 >>> print cprov_browser.title
103- Edit dependencies for PPA for Celso Providelo...
104+ Edit PPA dependencies : PPA for Celso Providelo : Celso Providelo
105
106 >>> admin_browser.open('http://launchpad.dev/~cprov/+archive/ppa')
107- >>> admin_browser.getLink('Edit dependencies').click()
108+ >>> admin_browser.getLink('Edit PPA dependencies').click()
109 >>> print admin_browser.url
110 http://launchpad.dev/~cprov/+archive/ppa/+edit-dependencies
111 >>> print admin_browser.title
112- Edit dependencies for PPA for Celso Providelo...
113+ Edit PPA dependencies : PPA for Celso Providelo : Celso Providelo
114
115 Once accessed the page provides a way to remove recorded dependencies
116 via the POST form.
117@@ -507,7 +508,7 @@
118 At anytime the form can be cancelled and the user will be taken to the
119 PPA context page and the action won't be executed.
120
121- >>> admin_browser.getLink('Edit dependencies').click()
122+ >>> admin_browser.getLink('Edit PPA dependencies').click()
123
124 >>> admin_browser.getControl("Add PPA dependency").value = 'no-priv/ppa'
125 >>> admin_browser.getControl(
126
127=== modified file 'lib/lp/soyuz/templates/archive-edit-dependencies.pt'
128--- lib/lp/soyuz/templates/archive-edit-dependencies.pt 2009-08-06 12:59:32 +0000
129+++ lib/lp/soyuz/templates/archive-edit-dependencies.pt 2009-10-30 12:35:24 +0000
130@@ -8,12 +8,6 @@
131 >
132 <body>
133
134-<div metal:fill-slot="heading">
135- <h1 tal:content="CONTEXTS/fmt:pagetitle">
136- Edit dependencies for Blah PPA
137- </h1>
138-</div>
139-
140 <div metal:fill-slot="main">
141 <div class="top-portlet">
142 <div metal:use-macro="context/@@launchpad_form/form">