Merge lp:~bac/launchpad/bug-639703-pg-bugs into lp:launchpad
- bug-639703-pg-bugs
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Gavin Panella |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11737 |
Proposed branch: | lp:~bac/launchpad/bug-639703-pg-bugs |
Merge into: | lp:launchpad |
Diff against target: |
557 lines (+242/-74) 13 files modified
lib/canonical/launchpad/pagetitles.py (+0/-2) lib/lp/bugs/browser/bugtask.py (+12/-2) lib/lp/bugs/browser/tests/test_bugtask.py (+108/-2) lib/lp/bugs/configure.zcml (+6/-0) lib/lp/bugs/stories/bug-release-management/xx-review-nominated-bugs.txt (+4/-4) lib/lp/bugs/stories/bugs/xx-front-page-search.txt (+2/-2) lib/lp/bugs/stories/bugs/xx-portlets-bug-milestones.txt (+13/-1) lib/lp/bugs/stories/bugs/xx-portlets-bug-series.txt (+13/-1) lib/lp/bugs/stories/bugs/xx-project-bugs-page.txt (+1/-1) lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt (+1/-1) lib/lp/bugs/templates/buglisting-default.pt (+77/-54) lib/lp/soyuz/stories/packaging/package-pages-navigation.txt (+1/-2) lib/lp/testing/views.py (+4/-2) |
To merge this branch: | bzr merge lp:~bac/launchpad/bug-639703-pg-bugs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Abstain | ||
Henning Eggers (community) | code ui* | Approve | |
Curtis Hovey (community) | ui | Approve | |
Matthew Revell (community) | text | Approve | |
Review via email: mp+37463@code.launchpad.net |
Commit message
Correctly report bug tracking status for project groups.
Description of the change
= Summary =
Currently if a project group has sub-projects but none use Launchpad for
bug tracking a user will be allowed to attempt to file a bug. At the
next step the user is informed there are no projects that track bugs in LP.
== Proposed fix ==
Prevent such a project group from displaying the portlets and providing
links to bug reporting and other bug activities.
== Pre-implementation notes ==
Talk with Curtis
== Implementation details ==
As above
== Tests ==
bin/test -vvm lp.bugs -t test_bugtask
== Demo and Q/A ==
Create a project group and see that it states it does not use Launchpad
for bug tracking. Add a project that does not use bug tracking and
ensure the message is the same. Set one of the project to do bug
tracking and observe the change in the page.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
2201: Line exceeds 78 characters.
Brad Crittenden (bac) wrote : | # |
Henning Eggers (henninge) wrote : | # |
Hello Bac,
thanks for making Launchpad a bit more user-friendly! ;-) I still need to send
you on another round-trip, though. Please find my comments below.
Henning
Am 04.10.2010 15:44, schrieb Brad Crittenden:
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -168,6 +168,7 @@
> ObjectImageDisp
> PersonFormatterAPI,
> )
> +
> from canonical.
> from canonical.
> from canonical.
> @@ -2987,8 +2988,17 @@
> return False
>
> @property
> + def should_
> + """Return False if a project group that does not use Launchpad."""
> + if not self._projectCo
> + return True
> + involvement = getMultiAdapter
> + name="+
> + return involvement.
This seems odd, to create a view just to get a property that is really a
property of the context. The "official_malone" property should be defined in
ProjectGroup and could be implemented like this: ;-)
@cachedproperty
def offcial_
return any([product.
Unless I misunderstood something, I see this misuse of a view as a real
blocker for landing this. This earned you the "need-fixing" ;-)
> +
> + @property
> def form_has_
> - """Return True of the form has errors, otherwise False."""
> + """Return True if the form has errors, otherwise False."""
Good catch! ;)
> return len(self.errors) > 0
>
> def validateVocabul
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
[...]
> @@ -418,6 +424,88 @@
> view.form_
>
>
> +class TestProjectGrou
> + """Test the bugs overview page for Project Groups."""
> +
> + layer = LaunchpadFuncti
> +
> + def setUp(self):
> + super(TestProje
> + self.owner = self.factory.
> + self.projectgroup = self.factory.
> + owner=self.owner)
> +
> + def makeSubordinate
> + """Create a new product and add it to the project group."""
> + product = self.factory.
> + with person_
> + product.project = self.projectgroup
> + expected = {True: 'LAUNCHPAD',
> + False: 'UNKNOWN',
> + }
> + self.assertEqual(
> + expected[
This looks like a forgotten sanity check? If you wish t...
Matthew Revell (matthew.revell) wrote : | # |
Very happy to see this change, thanks Brad.
I'd like to suggest some alternative text:
Sorry, you can't report a bug for the $ProjectGroup project group. None of the
projects within the group use Launchpad for bug tracking. Please check the
$ProjectGroup website for details of where they track bug reports.
I have suggested this change because I think the most important thing about the message is that you can't report the bug you wanted to. Only then should we explain why. I think we should then give the person a next step ... ideally we should link to their external bug tracker, or as a second-best we should link to the project's website. If we can't do either, I think the above text is a nod towards being helpful.
Brad Crittenden (bac) wrote : | # |
On Oct 4, 2010, at 22:39 , Henning Eggers wrote:
> Review: Needs Fixing code
> Hello Bac,
> thanks for making Launchpad a bit more user-friendly! ;-) I still need to send
> you on another round-trip, though. Please find my comments below.
>
Thanks for the review Henning.
> Henning
>
> Am 04.10.2010 15:44, schrieb Brad Crittenden:
>> === modified file 'lib/lp/
>>
>> @property
>> + def should_
>> + """Return False if a project group that does not use Launchpad."""
>> + if not self._projectCo
>> + return True
>> + involvement = getMultiAdapter
>> + name="+
>> + return involvement.
>
> This seems odd, to create a view just to get a property that is really a
> property of the context. The "official_malone" property should be defined in
> ProjectGroup and could be implemented like this: ;-)
>
> @cachedproperty
> def offcial_
> return any([product.
>
> Unless I misunderstood something, I see this misuse of a view as a real
> blocker for landing this. This earned you the "need-fixing" ;-)
It does look odd, Henning. For a lot of pillars, including ProjectGroup, the official usage flags are set in PillarView. The pattern you see here is repeated elsewhere.
On IRC we discussed landing this branch and later looking at moving the settings to the appropriate models. The bug for that work is bug 655036.
>
>> @@ -418,6 +424,88 @@
>> view.form_
>>
>>
>> +class TestProjectGrou
>> + """Test the bugs overview page for Project Groups."""
>> +
>> + layer = LaunchpadFuncti
>> +
>> + def setUp(self):
>> + super(TestProje
>> + self.owner = self.factory.
>> + self.projectgroup = self.factory.
>> + owner=self.owner)
>> +
>> + def makeSubordinate
>> + """Create a new product and add it to the project group."""
>> + product = self.factory.
>> + with person_
>> + product.project = self.projectgroup
>> + expected = {True: 'LAUNCHPAD',
>> + False: 'UNKNOWN',
>> + }
>> + self.assertEqual(
>> + expected[
>
> This looks like a forgotten sanity check? If you wish to keep it in here you
> should give it its own tests and mention in the comment their sanity nature.
Yes, it serves no purpose and is removed.
>
>> +
>> + def test_empty_
>
> This one and the next three tests belong in the model tests for
> ProjectGroup.
Deferred.
>> + def test_project_
>> + # A project group that has no projects using Launchpad ...
Brad Crittenden (bac) wrote : | # |
Thanks for the text changes Matthew. On IRC we agreed on:
You cannot report a bug for <tal:name replace="name"/> as none of
the projects within the group use Launchpad for bug tracking.
Please check the individual projects for details
of where bugs are reported.
Matthew Revell (matthew.revell) : | # |
Henning Eggers (henninge) wrote : | # |
So, the code is good now. Thanks for adding the XXX and filing the bug.
UI-wise I find the page too empty and inconsistent with similar pages we have on project groups and projects. Please have a look here:
http://
http://
The page will at least need a page heading and bread crumbs. The text should most likely be <strong> like on the other pages to indicate that it needs attention. Add a help link for bonus points. ;-)
Thanks
approved code
needs-fixing ui*
Brad Crittenden (bac) wrote : | # |
Hi Henning,
Thanks for the UI review. I have added the page heading and breadcrumbs:
http://
http://
I have not yet added a help link but will do so, pending Curtis' UI mentoring review.
Curtis Hovey (sinzui) wrote : | # |
Thanks Brad and Henning. This is a very nice fix and I am very pleased we fixed some 3.0-ism too. As Henning pointed, we want a consistent experience:
The page should show the owner the same help link as is shown on projects:
(i) Getting started with bug tracking in Launchpad.
<https:/
There is a secondary issue that help does not explain exactly what bug tracking features project groups provide. Actually, Lp has a poor understanding of what PGs provide. I think PG documentation is a secondary issue. We will discuss PGs over the next few months and decide their fate.
Henning Eggers (henninge) wrote : | # |
All good now, thanks for improving this! ;-)
Gavin Panella (allenap) wrote : | # |
Looks like this is all reviewed, so abstaining on behalf of Launchpad code reviewers.
Preview Diff
1 | === modified file 'lib/canonical/launchpad/pagetitles.py' |
2 | --- lib/canonical/launchpad/pagetitles.py 2010-10-03 15:30:06 +0000 |
3 | +++ lib/canonical/launchpad/pagetitles.py 2010-10-18 01:11:10 +0000 |
4 | @@ -146,8 +146,6 @@ |
5 | |
6 | buglinktarget_unlinkbugs = 'Remove links to bug reports' |
7 | |
8 | -buglisting_default = ContextTitle("Bugs in %s") |
9 | - |
10 | def buglisting_embedded_advanced_search(context, view): |
11 | """Return the view's page heading.""" |
12 | return view.getSearchPageHeading() |
13 | |
14 | === modified file 'lib/lp/bugs/browser/bugtask.py' |
15 | --- lib/lp/bugs/browser/bugtask.py 2010-10-14 20:20:47 +0000 |
16 | +++ lib/lp/bugs/browser/bugtask.py 2010-10-18 01:11:10 +0000 |
17 | @@ -2297,7 +2297,7 @@ |
18 | |
19 | @cachedproperty |
20 | def bug_tracking_usage(self): |
21 | - """Whether the context tracks bugs in launchpad. |
22 | + """Whether the context tracks bugs in Launchpad. |
23 | |
24 | :returns: ServiceUsage enum value |
25 | """ |
26 | @@ -2305,6 +2305,12 @@ |
27 | return service_usage.bug_tracking_usage |
28 | |
29 | @property |
30 | + def page_title(self): |
31 | + return "Bugs in %s" % self.context.title |
32 | + |
33 | + label = page_title |
34 | + |
35 | + @property |
36 | def schema(self): |
37 | """Return the schema that defines the form.""" |
38 | if self._personContext(): |
39 | @@ -2838,8 +2844,12 @@ |
40 | return False |
41 | |
42 | @property |
43 | + def should_show_bug_information(self): |
44 | + return self.bug_tracking_usage == ServiceUsage.LAUNCHPAD |
45 | + |
46 | + @property |
47 | def form_has_errors(self): |
48 | - """Return True of the form has errors, otherwise False.""" |
49 | + """Return True if the form has errors, otherwise False.""" |
50 | return len(self.errors) > 0 |
51 | |
52 | def validateVocabulariesAdvancedForm(self): |
53 | |
54 | === modified file 'lib/lp/bugs/browser/tests/test_bugtask.py' |
55 | --- lib/lp/bugs/browser/tests/test_bugtask.py 2010-10-04 19:50:45 +0000 |
56 | +++ lib/lp/bugs/browser/tests/test_bugtask.py 2010-10-18 01:11:10 +0000 |
57 | @@ -19,6 +19,7 @@ |
58 | login, |
59 | login_person, |
60 | ) |
61 | +from canonical.launchpad.testing.pages import find_tag_by_id |
62 | from canonical.launchpad.testing.systemdocs import ( |
63 | LayeredDocFileSuite, |
64 | setUp, |
65 | @@ -33,7 +34,10 @@ |
66 | BugTasksAndNominationsView, |
67 | ) |
68 | from lp.bugs.interfaces.bugtask import BugTaskStatus |
69 | -from lp.testing import TestCaseWithFactory |
70 | +from lp.testing import ( |
71 | + person_logged_in, |
72 | + TestCaseWithFactory, |
73 | + ) |
74 | from lp.testing._webservice import QueryCollector |
75 | from lp.testing.matchers import HasQueryCount |
76 | from lp.testing.sampledata import ( |
77 | @@ -41,6 +45,7 @@ |
78 | NO_PRIVILEGE_EMAIL, |
79 | USER_EMAIL, |
80 | ) |
81 | +from lp.testing.views import create_initialized_view |
82 | |
83 | |
84 | class TestBugTaskView(TestCaseWithFactory): |
85 | @@ -69,7 +74,8 @@ |
86 | self.addCleanup(recorder.unregister) |
87 | self.invalidate_caches(task) |
88 | self.getUserBrowser(url, person_no_teams) |
89 | - # This may seem large: it is; there is easily another 30% fat in there. |
90 | + # This may seem large: it is; there is easily another 30% fat in |
91 | + # there. |
92 | self.assertThat(recorder, HasQueryCount(LessThan(62))) |
93 | count_with_no_teams = recorder.count |
94 | # count with many teams |
95 | @@ -418,6 +424,106 @@ |
96 | view.form_fields['assignee'].field.vocabularyName) |
97 | |
98 | |
99 | +class TestProjectGroupBugs(TestCaseWithFactory): |
100 | + """Test the bugs overview page for Project Groups.""" |
101 | + |
102 | + layer = LaunchpadFunctionalLayer |
103 | + |
104 | + def setUp(self): |
105 | + super(TestProjectGroupBugs, self).setUp() |
106 | + self.owner = self.factory.makePerson(name='bob') |
107 | + self.projectgroup = self.factory.makeProject(name='container', |
108 | + owner=self.owner) |
109 | + |
110 | + def makeSubordinateProduct(self, tracks_bugs_in_lp): |
111 | + """Create a new product and add it to the project group.""" |
112 | + product = self.factory.makeProduct(official_malone=tracks_bugs_in_lp) |
113 | + with person_logged_in(product.owner): |
114 | + product.project = self.projectgroup |
115 | + |
116 | + def test_empty_project_group(self): |
117 | + # An empty project group does not use Launchpad for bugs. |
118 | + view = create_initialized_view( |
119 | + self.projectgroup, name=u'+bugs', rootsite='bugs') |
120 | + self.assertFalse(self.projectgroup.hasProducts()) |
121 | + self.assertFalse(view.should_show_bug_information) |
122 | + |
123 | + def test_project_group_with_subordinate_not_using_launchpad(self): |
124 | + # A project group with all subordinates not using Launchpad |
125 | + # will itself be marked as not using Launchpad for bugs. |
126 | + self.makeSubordinateProduct(False) |
127 | + self.assertTrue(self.projectgroup.hasProducts()) |
128 | + view = create_initialized_view( |
129 | + self.projectgroup, name=u'+bugs', rootsite='bugs') |
130 | + self.assertFalse(view.should_show_bug_information) |
131 | + |
132 | + def test_project_group_with_subordinate_using_launchpad(self): |
133 | + # A project group with one subordinate using Launchpad |
134 | + # will itself be marked as using Launchpad for bugs. |
135 | + self.makeSubordinateProduct(True) |
136 | + self.assertTrue(self.projectgroup.hasProducts()) |
137 | + view = create_initialized_view( |
138 | + self.projectgroup, name=u'+bugs', rootsite='bugs') |
139 | + self.assertTrue(view.should_show_bug_information) |
140 | + |
141 | + def test_project_group_with_mixed_subordinates(self): |
142 | + # A project group with one or more subordinates using Launchpad |
143 | + # will itself be marked as using Launchpad for bugs. |
144 | + self.makeSubordinateProduct(False) |
145 | + self.makeSubordinateProduct(True) |
146 | + self.assertTrue(self.projectgroup.hasProducts()) |
147 | + view = create_initialized_view( |
148 | + self.projectgroup, name=u'+bugs', rootsite='bugs') |
149 | + self.assertTrue(view.should_show_bug_information) |
150 | + |
151 | + def test_project_group_has_no_portlets_if_not_using_LP(self): |
152 | + # A project group that has no projects using Launchpad will not have |
153 | + # bug portlets. |
154 | + self.makeSubordinateProduct(False) |
155 | + view = create_initialized_view( |
156 | + self.projectgroup, name=u'+bugs', rootsite='bugs', |
157 | + current_request=True) |
158 | + self.assertFalse(view.should_show_bug_information) |
159 | + contents = view.render() |
160 | + report_a_bug = find_tag_by_id(contents, 'bug-portlets') |
161 | + self.assertIs(None, report_a_bug) |
162 | + |
163 | + def test_project_group_has_portlets_link_if_using_LP(self): |
164 | + # A project group that has projects using Launchpad will have a |
165 | + # portlets. |
166 | + self.makeSubordinateProduct(True) |
167 | + view = create_initialized_view( |
168 | + self.projectgroup, name=u'+bugs', rootsite='bugs', |
169 | + current_request=True) |
170 | + self.assertTrue(view.should_show_bug_information) |
171 | + contents = view.render() |
172 | + report_a_bug = find_tag_by_id(contents, 'bug-portlets') |
173 | + self.assertIsNot(None, report_a_bug) |
174 | + |
175 | + def test_project_group_has_help_link_if_not_using_LP(self): |
176 | + # A project group that has no projects using Launchpad will have |
177 | + # a 'Getting started' help link. |
178 | + self.makeSubordinateProduct(False) |
179 | + view = create_initialized_view( |
180 | + self.projectgroup, name=u'+bugs', rootsite='bugs', |
181 | + current_request=True) |
182 | + contents = view.render() |
183 | + help_link = find_tag_by_id(contents, 'getting-started-help') |
184 | + self.assertIsNot(None, help_link) |
185 | + |
186 | + def test_project_group_has_no_help_link_if_using_LP(self): |
187 | + # A project group that has no projects using Launchpad will not have |
188 | + # a 'Getting started' help link. |
189 | + self.makeSubordinateProduct(True) |
190 | + view = create_initialized_view( |
191 | + self.projectgroup, name=u'+bugs', rootsite='bugs', |
192 | + current_request=True) |
193 | + contents = view.render() |
194 | + help_link = find_tag_by_id(contents, 'getting-started-help') |
195 | + print help_link |
196 | + self.assertIs(None, help_link) |
197 | + |
198 | + |
199 | def test_suite(): |
200 | suite = unittest.TestLoader().loadTestsFromName(__name__) |
201 | suite.addTest(DocTestSuite(bugtask)) |
202 | |
203 | === modified file 'lib/lp/bugs/configure.zcml' |
204 | --- lib/lp/bugs/configure.zcml 2010-10-07 10:12:25 +0000 |
205 | +++ lib/lp/bugs/configure.zcml 2010-10-18 01:11:10 +0000 |
206 | @@ -1036,6 +1036,12 @@ |
207 | for="lp.bugs.interfaces.bugtarget.IBugTarget" |
208 | factory="lp.bugs.browser.bugtarget.BugsVHostBreadcrumb" |
209 | permission="zope.Public"/> |
210 | + <adapter |
211 | + name="bugs" |
212 | + provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
213 | + for="lp.registry.interfaces.projectgroup.IProjectGroup" |
214 | + factory="lp.bugs.browser.bugtarget.BugsVHostBreadcrumb" |
215 | + permission="zope.Public"/> |
216 | |
217 | <!-- ProcessApportBlobJobs --> |
218 | <class class="lp.bugs.model.apportjob.ProcessApportBlobJob"> |
219 | |
220 | === modified file 'lib/lp/bugs/stories/bug-release-management/xx-review-nominated-bugs.txt' |
221 | --- lib/lp/bugs/stories/bug-release-management/xx-review-nominated-bugs.txt 2010-09-28 03:01:37 +0000 |
222 | +++ lib/lp/bugs/stories/bug-release-management/xx-review-nominated-bugs.txt 2010-10-18 01:11:10 +0000 |
223 | @@ -8,7 +8,7 @@ |
224 | >>> anon_browser.open('http://bugs.launchpad.dev/ubuntu/hoary') |
225 | >>> anon_browser.getLink('Review nominations').click() |
226 | >>> print anon_browser.title |
227 | - Bugs nominated for Hoary... |
228 | + Bugs in The Hoary Hedgehog Release : Bugs : Hoary (5.04) : Ubuntu |
229 | |
230 | All the basic bug details are displayed. |
231 | |
232 | @@ -22,7 +22,7 @@ |
233 | >>> user_browser.open('http://bugs.launchpad.dev/ubuntu/hoary') |
234 | >>> user_browser.getLink('Review nominations').click() |
235 | >>> print anon_browser.title |
236 | - Bugs nominated for Hoary... |
237 | + Bugs in The Hoary Hedgehog Release : Bugs : Hoary (5.04) : Ubuntu |
238 | |
239 | >>> print_bugtasks(user_browser.contents) |
240 | 1 Firefox does not support SVG mozilla-firefox Medium New |
241 | @@ -63,7 +63,7 @@ |
242 | >>> admin_browser.open('http://bugs.launchpad.dev/ubuntu/hoary') |
243 | >>> admin_browser.getLink('Review nominations').click() |
244 | >>> print anon_browser.title |
245 | - Bugs nominated for Hoary... |
246 | + Bugs in The Hoary Hedgehog Release : Bugs : Hoary (5.04) : Ubuntu |
247 | |
248 | >>> print_bugtasks(admin_browser.contents) |
249 | 1 Firefox does not support SVG mozilla-firefox Medium New |
250 | @@ -114,7 +114,7 @@ |
251 | >>> user_browser.open('http://bugs.launchpad.dev/firefox/1.0') |
252 | >>> user_browser.getLink('Review nominations').click() |
253 | >>> print user_browser.title |
254 | - Bugs nominated for 1.0... |
255 | + Bugs in Mozilla Firefox 1.0 series : Bugs : Series 1.0 : Mozilla Firefox |
256 | |
257 | >>> print_bugtasks(user_browser.contents) |
258 | 1 Firefox does not support SVG Low New |
259 | |
260 | === modified file 'lib/lp/bugs/stories/bugs/xx-front-page-search.txt' |
261 | --- lib/lp/bugs/stories/bugs/xx-front-page-search.txt 2010-04-16 15:06:55 +0000 |
262 | +++ lib/lp/bugs/stories/bugs/xx-front-page-search.txt 2010-10-18 01:11:10 +0000 |
263 | @@ -142,8 +142,8 @@ |
264 | >>> anon_browser.getControl(name='field.scope.target').value = 'gnome' |
265 | >>> anon_browser.getControl(name='field.searchtext').value = 'test bug' |
266 | >>> anon_browser.getControl('Search Bug Reports').click() |
267 | - >>> anon_browser.title |
268 | - 'Bugs in The GNOME Project' |
269 | + >>> print anon_browser.title |
270 | + Bugs : GNOME |
271 | >>> anon_browser.url |
272 | 'http://bugs.launchpad.dev/gnome/+bugs?field.searchtext=test+bug...' |
273 | >>> print_bugtasks(anon_browser.contents) |
274 | |
275 | === modified file 'lib/lp/bugs/stories/bugs/xx-portlets-bug-milestones.txt' |
276 | --- lib/lp/bugs/stories/bugs/xx-portlets-bug-milestones.txt 2009-09-20 22:11:49 +0000 |
277 | +++ lib/lp/bugs/stories/bugs/xx-portlets-bug-milestones.txt 2010-10-18 01:11:10 +0000 |
278 | @@ -4,7 +4,19 @@ |
279 | The milestone-targeted bugs portlet displays the number of bugs that have |
280 | been targeted to a specific milestone. |
281 | |
282 | -This portlet is available from a distribution's bug page. |
283 | +This portlet is not available from a distribution's bug page if it |
284 | +does not use Launchpad for tracking bugs. |
285 | + |
286 | + >>> anon_browser.open("http://bugs.launchpad.dev/debian/+bugs") |
287 | + >>> portlet = find_portlet( |
288 | + ... anon_browser.contents, "Milestone-targeted bugs") |
289 | + >>> print portlet |
290 | + None |
291 | + |
292 | +Change debian to track bugs in Launchpad and the portlet becomes visible. |
293 | + |
294 | + >>> from lp.testing.service_usage_helpers import set_service_usage |
295 | + >>> set_service_usage('debian', bug_tracking_usage='LAUNCHPAD') |
296 | |
297 | >>> anon_browser.open("http://bugs.launchpad.dev/debian/+bugs") |
298 | >>> portlet = find_portlet( |
299 | |
300 | === modified file 'lib/lp/bugs/stories/bugs/xx-portlets-bug-series.txt' |
301 | --- lib/lp/bugs/stories/bugs/xx-portlets-bug-series.txt 2010-01-18 20:06:06 +0000 |
302 | +++ lib/lp/bugs/stories/bugs/xx-portlets-bug-series.txt 2010-10-18 01:11:10 +0000 |
303 | @@ -1,6 +1,19 @@ |
304 | The series-targeted portlet displays the number of open bugs that have |
305 | been accepted as targeting a specific series of a distribution: |
306 | |
307 | +This portlet is not available from a distribution's bug page if it |
308 | +does not use Launchpad for tracking bugs. |
309 | + |
310 | + >>> anon_browser.open("http://bugs.launchpad.dev/debian/+bugs") |
311 | + >>> portlet = find_portlet(anon_browser.contents, "Series-targeted bugs") |
312 | + >>> print portlet |
313 | + None |
314 | + |
315 | +Change debian to track bugs in Launchpad and the portlet becomes visible. |
316 | + |
317 | + >>> from lp.testing.service_usage_helpers import set_service_usage |
318 | + >>> set_service_usage('debian', bug_tracking_usage='LAUNCHPAD') |
319 | + |
320 | >>> anon_browser.open("http://bugs.launchpad.dev/debian/+bugs") |
321 | >>> portlet = find_portlet(anon_browser.contents, "Series-targeted bugs") |
322 | >>> print extract_text(portlet) |
323 | @@ -51,4 +64,3 @@ |
324 | >>> print extract_text(portlet) |
325 | Series-targeted bugs |
326 | 1.0 1 |
327 | - |
328 | |
329 | === modified file 'lib/lp/bugs/stories/bugs/xx-project-bugs-page.txt' |
330 | --- lib/lp/bugs/stories/bugs/xx-project-bugs-page.txt 2010-04-16 15:06:55 +0000 |
331 | +++ lib/lp/bugs/stories/bugs/xx-project-bugs-page.txt 2010-10-18 01:11:10 +0000 |
332 | @@ -5,4 +5,4 @@ |
333 | |
334 | >>> anon_browser.open('http://bugs.launchpad.dev/gnome') |
335 | >>> print anon_browser.title |
336 | - Bugs in The GNOME Project |
337 | + Bugs : GNOME |
338 | |
339 | === modified file 'lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt' |
340 | --- lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt 2010-10-05 22:04:38 +0000 |
341 | +++ lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.txt 2010-10-18 01:11:10 +0000 |
342 | @@ -176,7 +176,7 @@ |
343 | >>> anon_browser.getControl('Bug subscriber').value = subscriber |
344 | >>> anon_browser.getControl('Search', index=0).click() |
345 | >>> print extract_text(find_main_content(anon_browser.contents)) |
346 | - Mozilla Firefox ... |
347 | + Bugs in Mozilla Firefox ... |
348 | No results for search |
349 | |
350 | We'll continue by subscribing the same user to a couple of bugs. However, |
351 | |
352 | === modified file 'lib/lp/bugs/templates/buglisting-default.pt' |
353 | --- lib/lp/bugs/templates/buglisting-default.pt 2010-10-06 22:05:15 +0000 |
354 | +++ lib/lp/bugs/templates/buglisting-default.pt 2010-10-18 01:11:10 +0000 |
355 | @@ -6,17 +6,18 @@ |
356 | metal:use-macro="view/macro:page/main_side" |
357 | i18n:domain="malone" |
358 | > |
359 | - <body> |
360 | - |
361 | - <metal:block fill-slot="head_epilogue"> |
362 | - <meta tal:condition="not: view/bug_tracking_usage/enumvalue:LAUNCHPAD" |
363 | - name="robots" content="noindex,nofollow" /> |
364 | - </metal:block> |
365 | + |
366 | +<metal:block fill-slot="head_epilogue"> |
367 | + <meta condition="not: view/should_show_bug_information" |
368 | + name="robots" content="noindex,nofollow" /> |
369 | +</metal:block> |
370 | + |
371 | +<body> |
372 | |
373 | <div metal:fill-slot="main"> |
374 | <div tal:condition="not: view/bug_tracking_usage/enumvalue:UNKNOWN" |
375 | class="top-portlet"> |
376 | - <tal:block condition="view/_projectContext"> |
377 | + <tal:is_project_group condition="view/_projectContext"> |
378 | <tal:block condition="view/required:launchpad.Edit"> |
379 | <p tal:condition="not: context/products" class="warning message"> |
380 | There are no projects registered for |
381 | @@ -27,66 +28,88 @@ |
382 | associate an existing project with it. |
383 | </p> |
384 | </tal:block> |
385 | - </tal:block> |
386 | - <h1 |
387 | - tal:condition="view/shouldShowAdvancedForm" |
388 | - tal:content="view/getAdvancedSearchPageHeading" |
389 | - >Bugs in Fooix: Advanced search</h1> |
390 | - |
391 | - <tal:do_not_show_advanced_form |
392 | - condition="not: view/shouldShowAdvancedForm"> |
393 | - <div tal:define="batch_navigator view/search"> |
394 | - |
395 | - <div metal:use-macro="context/@@+bugtarget-macros-search/simple-search-form"></div> |
396 | - <tal:buglisting content="structure batch_navigator/@@+table-view" /> |
397 | - </div> |
398 | - </tal:do_not_show_advanced_form> |
399 | - |
400 | - <tal:show_advanced_form condition="view/shouldShowAdvancedForm"> |
401 | - <metal:advanced_form |
402 | - use-macro="context/@@+bugtask-macros-tableview/advanced_search_form" /> |
403 | - </tal:show_advanced_form> |
404 | + |
405 | + <tal:has_products condition="context/products"> |
406 | + <tal:no_bug_info condition="not:view/should_show_bug_information"> |
407 | + <p tal:define="name context/displayname"> |
408 | + <strong> |
409 | + You cannot report a bug for <tal:name replace="name"/> as none |
410 | + of the projects within the group use Launchpad for bug |
411 | + tracking. Please check the individual projects for details of |
412 | + where bugs are reported. |
413 | + </strong> |
414 | + </p> |
415 | + <p id="getting-started-help"> |
416 | + <a class="sprite maybe" |
417 | + href="https://help.launchpad.net/Bugs">Getting started |
418 | + with bug tracking in Launchpad</a>. |
419 | + </p> |
420 | + </tal:no_bug_info> |
421 | + </tal:has_products> |
422 | + </tal:is_project_group> |
423 | + |
424 | + <h1 |
425 | + tal:condition="view/shouldShowAdvancedForm" |
426 | + tal:content="view/getAdvancedSearchPageHeading" |
427 | + >Bugs in Fooix: Advanced search</h1> |
428 | + |
429 | + <tal:do_not_show_advanced_form |
430 | + condition="not: view/shouldShowAdvancedForm"> |
431 | + <div tal:define="batch_navigator view/search"> |
432 | + <div metal:use-macro="context/@@+bugtarget-macros-search/simple-search-form"></div> |
433 | + <tal:buglisting content="structure batch_navigator/@@+table-view" /> |
434 | + </div> |
435 | + </tal:do_not_show_advanced_form> |
436 | + |
437 | + <tal:show_advanced_form condition="view/shouldShowAdvancedForm"> |
438 | + <metal:advanced_form |
439 | + use-macro="context/@@+bugtask-macros-tableview/advanced_search_form" /> |
440 | + </tal:show_advanced_form> |
441 | + |
442 | + |
443 | </div> |
444 | <div tal:condition="view/bug_tracking_usage/enumvalue:UNKNOWN" |
445 | class="top-portlet"> |
446 | <p> |
447 | - <tal:displayname replace="context/displayname" /> |
448 | - does not use Launchpad for bug tracking. |
449 | + <strong> |
450 | + <tal:displayname replace="context/displayname" /> |
451 | + does not use Launchpad for bug tracking. |
452 | + </strong> |
453 | </p> |
454 | - <p> |
455 | + <p id="getting-started-help"> |
456 | <a class="sprite maybe" |
457 | href="https://help.launchpad.net/Bugs">Getting started |
458 | with bug tracking in Launchpad</a>. |
459 | </p> |
460 | </div> |
461 | </div> |
462 | + |
463 | <tal:side metal:fill-slot="side"> |
464 | - <div id="involvement" class="portlet involvement" |
465 | - tal:condition="view/bug_tracking_usage/enumvalue:LAUNCHPAD"> |
466 | - <ul> |
467 | - <li style="border: 0"> |
468 | - <a href="+filebug" class="menu-link-filebug sprite bugs"> |
469 | - Report a bug |
470 | - </a> |
471 | - </li> |
472 | - </ul> |
473 | - </div> |
474 | - <tal:menu replace="structure view/@@+related-pages" /> |
475 | - <tal:do_not_show_portlets_advanced_form |
476 | - condition="not: view/shouldShowAdvancedForm"> |
477 | - <tal:block content="structure context/@@+portlet-bugfilters" |
478 | - tal:condition="view/bug_tracking_usage/enumvalue:LAUNCHPAD"/> |
479 | - <tal:block |
480 | - content="structure context/@@+portlet-publishing-details | nothing"/> |
481 | - <tal:block content="structure context/@@+portlet-bugtags" |
482 | - tal:condition="view/bug_tracking_usage/enumvalue:LAUNCHPAD"/> |
483 | - <tal:releasecriticalbugs |
484 | + <div id="bug-portlets" tal:condition="view/should_show_bug_information"> |
485 | + <div id="involvement" class="portlet involvement"> |
486 | + <ul> |
487 | + <li style="border: 0"> |
488 | + <a href="+filebug" class="menu-link-filebug sprite bugs"> |
489 | + Report a bug |
490 | + </a> |
491 | + </li> |
492 | + </ul> |
493 | + </div> |
494 | + <tal:menu replace="structure view/@@+related-pages" /> |
495 | + <tal:do_not_show_portlets_advanced_form |
496 | + condition="not: view/shouldShowAdvancedForm"> |
497 | + <tal:block content="structure context/@@+portlet-bugfilters" /> |
498 | + <tal:block |
499 | + content="structure context/@@+portlet-publishing-details | nothing"/> |
500 | + <tal:block content="structure context/@@+portlet-bugtags"/> |
501 | + <tal:releasecriticalbugs |
502 | + tal:condition="view/shouldShowReleaseCriticalPortlet" |
503 | + tal:content="structure context/@@+portlet-bugtasklist-seriesbugs" /> |
504 | + <tal:milestonecriticalbugs |
505 | tal:condition="view/shouldShowReleaseCriticalPortlet" |
506 | - tal:content="structure context/@@+portlet-bugtasklist-seriesbugs" /> |
507 | - <tal:milestonecriticalbugs |
508 | - tal:condition="view/shouldShowReleaseCriticalPortlet" |
509 | - tal:content="structure context/@@+portlet-bugtasklist-milestonebugs" /> |
510 | - </tal:do_not_show_portlets_advanced_form> |
511 | + tal:content="structure context/@@+portlet-bugtasklist-milestonebugs" /> |
512 | + </tal:do_not_show_portlets_advanced_form> |
513 | + </div> |
514 | </tal:side> |
515 | </body> |
516 | |
517 | |
518 | === modified file 'lib/lp/soyuz/stories/packaging/package-pages-navigation.txt' |
519 | --- lib/lp/soyuz/stories/packaging/package-pages-navigation.txt 2010-05-19 05:47:50 +0000 |
520 | +++ lib/lp/soyuz/stories/packaging/package-pages-navigation.txt 2010-10-18 01:11:10 +0000 |
521 | @@ -39,7 +39,7 @@ |
522 | * Blueprints - not linked |
523 | * Translations - not linked |
524 | * Answers - http://answers.launchpad.dev/ubuntu/+source/alsa-utils |
525 | - Main heading: (No main heading) |
526 | + Main heading: Bugs in ?alsa-utils? package in Ubuntu |
527 | |
528 | |
529 | == Distribution source package release == |
530 | @@ -196,4 +196,3 @@ |
531 | * Translations - http://translations.launchpad.dev/ubuntu/hoary |
532 | * Answers - not linked |
533 | Main heading: pmount 0.1-1 (i386 binary) in ubuntu hoary |
534 | - |
535 | |
536 | === modified file 'lib/lp/testing/views.py' |
537 | --- lib/lp/testing/views.py 2010-09-19 03:09:49 +0000 |
538 | +++ lib/lp/testing/views.py 2010-10-18 01:11:10 +0000 |
539 | @@ -85,7 +85,8 @@ |
540 | def create_initialized_view(context, name, form=None, layer=None, |
541 | server_url=None, method=None, principal=None, |
542 | query_string=None, cookie=None, request=None, |
543 | - path_info='/', rootsite=None): |
544 | + path_info='/', rootsite=None, |
545 | + current_request=False): |
546 | """Return a view that has already been initialized.""" |
547 | if method is None: |
548 | if form is None: |
549 | @@ -94,7 +95,8 @@ |
550 | method = 'POST' |
551 | view = create_view( |
552 | context, name, form, layer, server_url, method, principal, |
553 | - query_string, cookie, request, path_info, rootsite=rootsite) |
554 | + query_string, cookie, request, path_info, rootsite=rootsite, |
555 | + current_request=current_request) |
556 | view.initialize() |
557 | return view |
558 |
Screenshot at http:// people. canonical. com/~bac/ pg-no-buggy. png