Merge lp:~sinzui/launchpad/needs-packaging-bug-509848 into lp:launchpad/db-devel

Proposed by Curtis Hovey
Status: Merged
Approved by: Curtis Hovey
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/needs-packaging-bug-509848
Merge into: lp:launchpad/db-devel
Prerequisite: lp:~sinzui/launchpad/needs-linking-bug-507937
Diff against target: 858 lines (+503/-89)
17 files modified
lib/canonical/launchpad/doc/hierarchical-menu.txt (+15/-1)
lib/canonical/launchpad/icing/style-3-0.css (+1/-1)
lib/lp/app/browser/tests/base-layout.txt (+3/-3)
lib/lp/app/templates/base-layout-macros.pt (+17/-0)
lib/lp/app/templates/launchpad-hierarchy.pt (+8/-11)
lib/lp/registry/browser/configure.zcml (+14/-0)
lib/lp/registry/browser/distroseries.py (+30/-7)
lib/lp/registry/browser/sourcepackage.py (+58/-3)
lib/lp/registry/browser/tests/packaging-views.txt (+38/-1)
lib/lp/registry/browser/tests/sourcepackage-views.txt (+64/-0)
lib/lp/registry/stories/distroseries/xx-show-distroseries-packaging.txt (+60/-2)
lib/lp/registry/stories/packaging/xx-sourcepackage-packaging.txt (+4/-3)
lib/lp/registry/stories/person/xx-admin-person-review.txt (+1/-1)
lib/lp/registry/templates/distroseries-needs-packaging.pt (+91/-0)
lib/lp/registry/templates/distroseries-packaging.pt (+1/-1)
lib/lp/registry/templates/sourcepackage-index.pt (+1/-55)
lib/lp/registry/templates/sourcepackage-portlet-associations.pt (+97/-0)
To merge this branch: bzr merge lp:~sinzui/launchpad/needs-packaging-bug-509848
Reviewer Review Type Date Requested Status
Martin Albisetti (community) ui Approve
Eleanor Berger (community) code Approve
Review via email: mp+17848@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (3.4 KiB)

This is my branch to add the view for +needs-packaging. It also fixes two
bread crumb bugs: do not link the last item and white space is underlined.

    lp:~sinzui/launchpad/needs-packaging-bug-509848
    Diff size: 340
    Launchpad bug: https://bugs.launchpad.net/bugs/509848
                   https://bugs.launchpad.net/bugs/83613
                   https://bugs.launchpad.net/bugs/480473
    Test command: ./bin/test -vv \
        -t hierarchical-menu \
        -t packaging-views \
        -t xx-show-distroseries-packaging
    Pre-implementation: bac, beuno
    Target release: 10.01

Add the view for +needs-packaging
---------------------------------

Add a view and template to list the packages that need packaging links.
The view should follow the example in the ubuntu-link-to-upstream blueprint.

Rules
-----

    * Create a view that shows the prioritised listing of packages that need
      packaging links
    * Each item must show information that encourages users to link the
      package to an upstream project.
    * ADDENDUM: Fix the trailing bread crumb, it should not be linked because
      it is the current page. Fix the white space too.

QA
--

Visit staging (This relies on a model that depends upon a schema change)

    * https://staging.launchpad.net/ubuntu/lucid/+needs-packaging
    * Verify it lists the source packages that are not linked to upstream
    * Verify the link link to Upstream links works
    * Verify the page lists 100 packages.
    * Verify that the packages appear to be listed in order of bugs with
      the highest heat and most translatable messages. Since this information
      is not visible, it is difficult to judge. The crucial issue is, does
      the ordering look sane?

Lint
----

Linting changed files:
  lib/canonical/launchpad/doc/hierarchical-menu.txt
  lib/canonical/launchpad/icing/style-3-0.css
  lib/lp/app/templates/launchpad-hierarchy.pt
  lib/lp/registry/browser/configure.zcml
  lib/lp/registry/browser/distroseries.py
  lib/lp/registry/browser/tests/packaging-views.txt
  lib/lp/registry/stories/distroseries/xx-show-distroseries-packaging.txt
  lib/lp/registry/templates/distroseries-needs-packaging.pt

Test
----

    * lib/canonical/launchpad/doc/hierarchical-menu.txt
      * Updated test to verify that the last bread crumb is not linked.
    * lib/lp/registry/browser/tests/packaging-views.txt
      * Add a test for the new view to verify the page_title and label, as
        well as the BatchNavigator settings.
    * lib/lp/registry/stories/distroseries/xx-show-distroseries-packaging.txt
      * Add a simple story to demonstrate what any user can do with the
        page.
      * There is an XXX for a the portlet that will be added in my next
        branch.

Implementation
--------------

    * lib/canonical/launchpad/icing/style-3-0.css
      * Added a "narrow" class that uses the paragraph for content that
        is difficult to use when it fills the available space.
    * lib/lp/app/templates/launchpad-hierarchy.pt
      * Removed the access white space that cause the odd underlining in
        some browsers.
      * Added an omit-tag rule so that the last bread crumb is not linked.
  ...

Read more...

Revision history for this message
Curtis Hovey (sinzui) wrote :

Hi Martin.

This branch adds the +needs-packaging page as proposed in
    https://blueprints.launchpad.net/launchpad-registry/+spec/ubuntu-link-to-upstream

It differs from the design in the proposal because the missing branch column will always be missing, as noted by Brad; it was not adding information. The content was difficult to read at full width so I contrained to to match the paragraph's width. Please note tha the odd numbers in the table are because sample data is bad.

    http://launchpadlibrarian.net/38198401/needs-packaging.png

You asked if the user could edit the information from this page. The answer is no. We are linking directly to the source package page because that page *will* ask the user to select the upstream project from a list of candidates, or choose by search.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

(10:51:18) intellectronica: sinzui: unless it's necessary (because the extra whitespace creates formatting problems), i prefer closing html tags on a new line. can you change the anchor on line 19 of your diff?
(10:51:45) intellectronica: and in the template too, of course
(10:52:19) beuno is now known as beuno-lunch
(10:52:22) sinzui: oh, that is clumbs of me. I will fix both
(10:52:27) sinzui: clumbsy
(10:52:36) intellectronica: cool, thanks
(10:55:00) intellectronica: sinzui: 'packagings' reads quite funny to me. are you sure this is the best choice? i would have dropped the plural s (but i'm not a native speaker so be critical with my english advice)
(10:56:56) intellectronica: sinzui: everything else looks good to me, so r=me
(10:57:04) sinzui: thanks
(10:57:28) intellectronica: sinzui: note that i haven't done any ui reviewing at all. i'll leave that for beuno-lunch (or noodles)
(10:58:10) sinzui: intellectronica: understood

review: Approve (code)
Revision history for this message
Martin Albisetti (beuno) wrote :

Hi Curtis,

A few quick thoughts:

- I think that the table can be re-worked to something like this:

------------------------------------------------------
       Source Package | Bugs | Translations |
------------------------------------------------------
  [] pmount | _12 bugs_ | _12 strings_ |
  [] alsa-utils | _1 bug_ | _0 strings_ |
  [] cnews | No bugs | No strings |
------------------------------------------------------

What's the "Upstream links" option? I don't understand the difference between that one and the one we're on.

review: Needs Fixing (ui)
Revision history for this message
Curtis Hovey (sinzui) wrote :

Hi Martin.

I updated the format and content of the table.
http://people.canonical.com/~curtis/needs-packaging.png

Revision history for this message
Martin Albisetti (beuno) wrote :

Thanks for the fixes Curtis.
The only remaining confusion seems to be the "Needs upstream links" / "Upstream links" links.
How about "Needs upstream links" / "All upstream links"?

review: Approve (ui)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/doc/hierarchical-menu.txt'
--- lib/canonical/launchpad/doc/hierarchical-menu.txt 2009-10-15 13:17:58 +0000
+++ lib/canonical/launchpad/doc/hierarchical-menu.txt 2010-01-30 22:41:18 +0000
@@ -233,9 +233,23 @@
233 ... for step in hierarchy]233 ... for step in hierarchy]
234 ... print 'Location:', ' > '.join(segments)234 ... print 'Location:', ' > '.join(segments)
235235
236 >>> print_hierarchy(hierarchy.render())236 >>> markup = hierarchy.render()
237 >>> print_hierarchy(markup)
237 Location: Joy of cooking > Spam238 Location: Joy of cooking > Spam
238239
240The items in the breadcrumbs are linked, except for the last one which
241represents the current location.
242
243 >>> print markup
244 <ol class="breadcrumbs">
245 <li>
246 <a href="http://launchpad.dev/joy-of-cooking">Joy of cooking</a>
247 </li>
248 <li>
249 Spam
250 </li>
251 </ol>
252
239The Launchpad Homepage displays no items in its location bar. We are253The Launchpad Homepage displays no items in its location bar. We are
240considered to be on the home page if there are no breadcrumbs.254considered to be on the home page if there are no breadcrumbs.
241255
242256
=== modified file 'lib/canonical/launchpad/icing/style-3-0.css'
--- lib/canonical/launchpad/icing/style-3-0.css 2010-01-14 04:55:10 +0000
+++ lib/canonical/launchpad/icing/style-3-0.css 2010-01-30 22:41:18 +0000
@@ -161,7 +161,7 @@
161 width: auto;161 width: auto;
162 margin-bottom: 0.8em;162 margin-bottom: 0.8em;
163 }163 }
164p, li, dt, dd, blockquote {164p, li, dt, dd, blockquote, .narrow {
165 max-width: 45em; /* Wrap the text before the eye gets lost. */165 max-width: 45em; /* Wrap the text before the eye gets lost. */
166 }166 }
167pre, code, samp, tt, .console {167pre, code, samp, tt, .console {
168168
=== modified file 'lib/lp/app/browser/tests/base-layout.txt'
--- lib/lp/app/browser/tests/base-layout.txt 2009-10-02 21:00:37 +0000
+++ lib/lp/app/browser/tests/base-layout.txt 2010-01-30 22:41:18 +0000
@@ -94,7 +94,7 @@
94 <div class="yui-b" dir="ltr">94 <div class="yui-b" dir="ltr">
95 <div>95 <div>
96 <h2>Heading</h2>96 <h2>Heading</h2>
97 <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">97 <ol class="breadcrumbs">
98 ...98 ...
9999
100Top portlet.100Top portlet.
@@ -190,7 +190,7 @@
190 <div class="yui-b" dir="ltr">190 <div class="yui-b" dir="ltr">
191 <div>191 <div>
192 <BLANKLINE>192 <BLANKLINE>
193 <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">193 <ol class="breadcrumbs">
194 <BLANKLINE>194 <BLANKLINE>
195 </ol>195 </ol>
196 <BLANKLINE>196 <BLANKLINE>
@@ -310,7 +310,7 @@
310 <div class="yui-b" dir="ltr">310 <div class="yui-b" dir="ltr">
311 <div>311 <div>
312 <BLANKLINE>312 <BLANKLINE>
313 <ol class="breadcrumbs" xmlns="http://www.w3.org/1999/xhtml">313 <ol class="breadcrumbs">
314 <BLANKLINE>314 <BLANKLINE>
315 </ol>315 </ol>
316 ...316 ...
317317
=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt 2010-01-22 15:47:53 +0000
+++ lib/lp/app/templates/base-layout-macros.pt 2010-01-30 22:41:18 +0000
@@ -391,4 +391,21 @@
391 </div>391 </div>
392</metal:site-message>392</metal:site-message>
393393
394<metal:plural-msg define-macro="plural-message">
395 <tal:comment condition="nothing">
396 Expected variables to be defined in a containing tag or global:
397 count - value to check to determine plural form
398 singluar - string to use when count == 1
399 plural - string to use when count > 1. If no plural is given it defaults
400 to the singular value + 's'.
401 </tal:comment>
402 <tal:singular
403 condition="python: count == 1"
404 replace="singular" />
405 <tal:plural
406 define="l_default string:s;
407 l_plural plural | string:$singular$l_default;"
408 condition="python: count != 1"
409 replace="l_plural" />
410</metal:plural-msg>
394</macros>411</macros>
395412
=== modified file 'lib/lp/app/templates/launchpad-hierarchy.pt'
--- lib/lp/app/templates/launchpad-hierarchy.pt 2009-09-18 17:38:50 +0000
+++ lib/lp/app/templates/launchpad-hierarchy.pt 2010-01-30 22:41:18 +0000
@@ -1,6 +1,5 @@
1<ol1<ol
2 class="breadcrumbs"2 class="breadcrumbs"
3 xmlns="http://www.w3.org/1999/xhtml"
4 xmlns:tal="http://xml.zope.org/namespaces/tal"3 xmlns:tal="http://xml.zope.org/namespaces/tal"
5 xmlns:metal="http://xml.zope.org/namespaces/metal"4 xmlns:metal="http://xml.zope.org/namespaces/metal"
6 xmlns:i18n="http://xml.zope.org/namespaces/i18n"5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
@@ -9,16 +8,14 @@
9<tal:breadcrumbs repeat="breadcrumb view/items"8<tal:breadcrumbs repeat="breadcrumb view/items"
10 condition="view/display_breadcrumbs">9 condition="view/display_breadcrumbs">
11 <li>10 <li>
12 <a tal:attributes="href breadcrumb/url">11 <a tal:attributes="href breadcrumb/url"
13 <tal:text condition="not: repeat/breadcrumb/end"12 tal:omit-tag="repeat/breadcrumb/end"><tal:text
14 replace="breadcrumb/text">13 condition="not: repeat/breadcrumb/end"
15 Bugs on redfish14 replace="breadcrumb/text">
16 </tal:text>15 Bugs on redfish</tal:text><tal:text
17 <tal:text condition="repeat/breadcrumb/end"16 condition="repeat/breadcrumb/end"
18 replace="breadcrumb/text/fmt:shorten/40">17 replace="breadcrumb/text/fmt:shorten/40">
19 Bugs on redfish18 Bugs on redfish</tal:text></a>
20 </tal:text>
21 </a>
22 </li>19 </li>
23</tal:breadcrumbs>20</tal:breadcrumbs>
24</ol>21</ol>
2522
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2010-01-21 23:46:24 +0000
+++ lib/lp/registry/browser/configure.zcml 2010-01-30 22:41:18 +0000
@@ -101,6 +101,13 @@
101 template="../templates/distroseries-packaging.pt"/>101 template="../templates/distroseries-packaging.pt"/>
102 <browser:page102 <browser:page
103 for="lp.registry.interfaces.distroseries.IDistroSeries"103 for="lp.registry.interfaces.distroseries.IDistroSeries"
104 class="lp.registry.browser.distroseries.DistroSeriesNeedsPackagesView"
105 permission="zope.Public"
106 name="+needs-packaging"
107 facet="overview"
108 template="../templates/distroseries-needs-packaging.pt"/>
109 <browser:page
110 for="lp.registry.interfaces.distroseries.IDistroSeries"
104 permission="launchpad.Admin"111 permission="launchpad.Admin"
105 facet="overview"112 facet="overview"
106 class="canonical.launchpad.browser.ObjectReassignmentView"113 class="canonical.launchpad.browser.ObjectReassignmentView"
@@ -1937,6 +1944,13 @@
1937 <browser:page1944 <browser:page
1938 for="lp.registry.interfaces.sourcepackage.ISourcePackage"1945 for="lp.registry.interfaces.sourcepackage.ISourcePackage"
1939 permission="zope.Public"1946 permission="zope.Public"
1947 name="+portlet-associations"
1948 facet="overview"
1949 class="lp.registry.browser.sourcepackage.SourcePackageAssociationPortletView"
1950 template="../templates/sourcepackage-portlet-associations.pt"/>
1951 <browser:page
1952 for="lp.registry.interfaces.sourcepackage.ISourcePackage"
1953 permission="zope.Public"
1940 class="lp.registry.browser.sourcepackage.SourcePackageHelpView"1954 class="lp.registry.browser.sourcepackage.SourcePackageHelpView"
1941 name="+gethelp"1955 name="+gethelp"
1942 facet="answers"1956 facet="answers"
19431957
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py 2010-01-05 16:19:13 +0000
+++ lib/lp/registry/browser/distroseries.py 2010-01-30 22:41:18 +0000
@@ -150,9 +150,9 @@
150150
151 usedfor = IDistroSeries151 usedfor = IDistroSeries
152 facet = 'overview'152 facet = 'overview'
153 links = ['edit', 'reassign', 'driver', 'answers', 'packaging',153 links = ['edit', 'reassign', 'driver', 'answers',
154 'add_port', 'create_milestone', 'admin', 'builds', 'queue',154 'packaging', 'needs_packaging', 'builds', 'queue',
155 'subscribe']155 'add_port', 'create_milestone', 'subscribe', 'admin']
156156
157 @enabled_with_permission('launchpad.Admin')157 @enabled_with_permission('launchpad.Admin')
158 def edit(self):158 def edit(self):
@@ -177,8 +177,14 @@
177 return Link('+addmilestone', text, summary, icon='add')177 return Link('+addmilestone', text, summary, icon='add')
178178
179 def packaging(self):179 def packaging(self):
180 text = 'Upstream links'180 text = 'All upstream links'
181 return Link('+packaging', text, icon='info')181 summary = 'A listing of source pakages and their upstream projects'
182 return Link('+packaging', text, summary=summary, icon='info')
183
184 def needs_packaging(self):
185 text = 'Needs upstream links'
186 summary = 'A listing of source pakages without upstream projects'
187 return Link('+needs-packaging', text, summary=summary, icon='info')
182188
183 # A search link isn't needed because the distro series overview189 # A search link isn't needed because the distro series overview
184 # has a search form.190 # has a search form.
@@ -463,7 +469,7 @@
463 """A View to show series package to upstream package relationships."""469 """A View to show series package to upstream package relationships."""
464470
465 label = 'Mapping series packages to upstream project series'471 label = 'Mapping series packages to upstream project series'
466 page_title = 'Upstream packaging links'472 page_title = 'All upstream links'
467473
468 @cachedproperty474 @cachedproperty
469 def unlinked_translatables(self):475 def unlinked_translatables(self):
@@ -486,4 +492,21 @@
486 def cached_packagings(self):492 def cached_packagings(self):
487 """The batched upstream packaging links."""493 """The batched upstream packaging links."""
488 packagings = self.context.packagings494 packagings = self.context.packagings
489 return BatchNavigator(packagings, self.request, size=200)495 navigator = BatchNavigator(packagings, self.request, size=200)
496 navigator.setHeadings('packaging', 'packagings')
497 return navigator
498
499
500class DistroSeriesNeedsPackagesView(DistroSeriesView):
501 """A View to show series package to upstream package relationships."""
502
503 label = 'Packages that need upstream packaging links'
504 page_title = 'Needs upstream links'
505
506 @cachedproperty
507 def cached_unlinked_packages(self):
508 """The batched `ISourcePackage`s that needs packaging links."""
509 packages = self.context.getPriorizedUnlinkedSourcePackages()
510 navigator = BatchNavigator(packages, self.request, size=100)
511 navigator.setHeadings('package', 'packages')
512 return navigator
490513
=== modified file 'lib/lp/registry/browser/sourcepackage.py'
--- lib/lp/registry/browser/sourcepackage.py 2009-12-18 13:25:19 +0000
+++ lib/lp/registry/browser/sourcepackage.py 2010-01-30 22:41:18 +0000
@@ -6,6 +6,7 @@
6__metaclass__ = type6__metaclass__ = type
77
8__all__ = [8__all__ = [
9 'SourcePackageAssociationPortletView',
9 'SourcePackageBreadcrumb',10 'SourcePackageBreadcrumb',
10 'SourcePackageChangeUpstreamView',11 'SourcePackageChangeUpstreamView',
11 'SourcePackageFacets',12 'SourcePackageFacets',
@@ -16,12 +17,20 @@
16 ]17 ]
1718
18from apt_pkg import ParseSrcDepends19from apt_pkg import ParseSrcDepends
20from cgi import escape
19from zope.component import getUtility, getMultiAdapter21from zope.component import getUtility, getMultiAdapter
20from zope.app.form.interfaces import IInputWidget22from zope.app.form.interfaces import IInputWidget
21from zope.formlib.form import FormFields23from zope.formlib.form import Fields, FormFields
24from zope.interface import Interface
25from zope.schema import Choice
26from zope.schema.vocabulary import (
27 getVocabularyRegistry, SimpleVocabulary, SimpleTerm)
2228
23from lazr.restful.interface import copy_field29from lazr.restful.interface import copy_field
2430
31from canonical.cachedproperty import cachedproperty
32from canonical.widgets import LaunchpadRadioWidget
33
25from canonical.launchpad import helpers34from canonical.launchpad import helpers
26from lp.bugs.browser.bugtask import BugTargetTraversalMixin35from lp.bugs.browser.bugtask import BugTargetTraversalMixin
27from canonical.launchpad.browser.packagerelationship import (36from canonical.launchpad.browser.packagerelationship import (
@@ -35,8 +44,9 @@
35from lp.translations.interfaces.potemplate import IPOTemplateSet44from lp.translations.interfaces.potemplate import IPOTemplateSet
36from canonical.launchpad import _45from canonical.launchpad import _
37from canonical.launchpad.webapp import (46from canonical.launchpad.webapp import (
38 action, ApplicationMenu, GetitemNavigation, LaunchpadEditFormView, Link,47 action, ApplicationMenu, custom_widget, GetitemNavigation,
39 redirection, StandardLaunchpadFacets, stepto)48 LaunchpadEditFormView, LaunchpadFormView, Link, redirection,
49 StandardLaunchpadFacets, stepto)
40from canonical.launchpad.webapp import canonical_url50from canonical.launchpad.webapp import canonical_url
41from canonical.launchpad.webapp.authorization import check_permission51from canonical.launchpad.webapp.authorization import check_permission
42from canonical.launchpad.webapp.breadcrumb import Breadcrumb52from canonical.launchpad.webapp.breadcrumb import Breadcrumb
@@ -294,3 +304,48 @@
294 """A View to show Answers help."""304 """A View to show Answers help."""
295305
296 page_title = 'Help and support options'306 page_title = 'Help and support options'
307
308
309class SourcePackageAssociationPortletView(LaunchpadFormView):
310 """A view for linking to an upstream package."""
311
312 schema = Interface
313 custom_widget(
314 'upstream', LaunchpadRadioWidget, orientation='vertical')
315 product_suggestions = None
316
317 def setUpFields(self):
318 """See `LaunchpadFormView`."""
319 super(SourcePackageAssociationPortletView, self).setUpFields()
320 # Find registered products that are similarly named to the source
321 # package.
322 product_vocab = getVocabularyRegistry().get(None, 'Product')
323 matches = product_vocab.searchForTerms(self.context.name)
324 # Based upon the matching products, create a new vocabulary with
325 # term descriptions that include a link to the product.
326 self.product_suggestions = []
327 vocab_terms = []
328 for item in matches:
329 product = item.value
330 self.product_suggestions.append(product)
331 item_url = canonical_url(product)
332 description = """<a href="%s">%s</a>""" % (
333 item_url, escape(product.displayname))
334 vocab_terms.append(SimpleTerm(product, product.name, description))
335 upstream_vocabulary = SimpleVocabulary(vocab_terms)
336
337 self.form_fields = Fields(
338 Choice(__name__='upstream',
339 title=_('Registered upstream project'),
340 default=None,
341 vocabulary=upstream_vocabulary,
342 required=True))
343
344 @action('Link to Upstream Project', name='link')
345 def link(self, action, data):
346 upstream = data.get('upstream')
347 self.context.setPackaging(upstream.development_focus, self.user)
348 self.request.response.addInfoNotification(
349 'The project %s was linked to this source package.' %
350 upstream.displayname)
351 self.next_url = self.request.getURL()
297352
=== modified file 'lib/lp/registry/browser/tests/packaging-views.txt'
--- lib/lp/registry/browser/tests/packaging-views.txt 2010-01-22 16:52:37 +0000
+++ lib/lp/registry/browser/tests/packaging-views.txt 2010-01-30 22:41:18 +0000
@@ -353,7 +353,7 @@
353 Mapping series packages to upstream project series353 Mapping series packages to upstream project series
354354
355 >>> print view.page_title355 >>> print view.page_title
356 Upstream packaging links356 All upstream links
357357
358The view provides a property to get the source packages that have358The view provides a property to get the source packages that have
359translations, but are not linked to an upstream project. The view filters359translations, but are not linked to an upstream project. The view filters
@@ -376,6 +376,9 @@
376 >>> batch_navigator.default_size376 >>> batch_navigator.default_size
377 200377 200
378378
379 >>> print batch_navigator.heading
380 packagings
381
379 >>> for packaging in batch_navigator.batch:382 >>> for packaging in batch_navigator.batch:
380 ... print packaging.sourcepackagename.name383 ... print packaging.sourcepackagename.name
381 evolution384 evolution
@@ -389,3 +392,37 @@
389 ... hoary, name='+packaging', query_string='start=2')392 ... hoary, name='+packaging', query_string='start=2')
390 >>> view.show_unlinked_translatables393 >>> view.show_unlinked_translatables
391 False394 False
395
396
397Distro series +needs-packaging view
398-----------------------------------
399
400The +needs-packaging view lists the source packages that needs packaging
401links to an upstream project.
402
403 >>> view = create_initialized_view(hoary, name='+needs-packaging')
404 >>> print view.label
405 Packages that need upstream packaging links
406
407 >>> print view.page_title
408 Needs upstream links
409
410The view provides the cached_unlinked_packages property to access a
411`BatchNavigator` of `ISourcePackages`.
412
413 >>> batch_navigator = view.cached_unlinked_packages
414 >>> batch_navigator.default_size
415 100
416
417 >>> print batch_navigator.heading
418 packages
419
420 >>> for summary in batch_navigator.batch:
421 ... print summary['package'].name
422 pmount
423 alsa-utils
424 cnews
425 libstdc++
426 linux-source-2.6.15
427 thunderbird
428 hot
392429
=== modified file 'lib/lp/registry/browser/tests/sourcepackage-views.txt'
--- lib/lp/registry/browser/tests/sourcepackage-views.txt 2009-10-27 04:04:55 +0000
+++ lib/lp/registry/browser/tests/sourcepackage-views.txt 2010-01-30 22:41:18 +0000
@@ -1,6 +1,8 @@
1SourcePackage views1SourcePackage views
2===================2===================
33
4Edit packaging view
5-------------------
46
5 >>> product = factory.makeProduct(name='bonkers', displayname='Bonkers')7 >>> product = factory.makeProduct(name='bonkers', displayname='Bonkers')
6 >>> productseries = factory.makeProductSeries(8 >>> productseries = factory.makeProductSeries(
@@ -96,3 +98,65 @@
9698
97 >>> print view.request.response.notifications99 >>> print view.request.response.notifications
98 []100 []
101
102Upstream associations portlet
103-----------------------------
104
105The upstreams associations portlet either displays the upstream
106information if it is already set or gives the user the opportunity to
107suggest the association. The suggestion is based on a
108ProductVocabulary query using the source package name.
109
110Since the bonkers source project was associated previously with the
111bonkers project, the portlet will display that information.
112
113 >>> view = create_initialized_view(package, name='+portlet-associations')
114 >>> for product in view.product_suggestions:
115 ... print product.name
116 bonkers
117
118 >>> from canonical.launchpad.testing.pages import (
119 ... extract_text, find_tag_by_id)
120 >>> content = extract_text(find_tag_by_id(view.render(), 'upstreams'))
121 >>> print content
122 Project:...Bonkers...
123 Series:...crazy...
124
125A new source project that is not linked to an upstream will result in
126the portlet showing the suggested project.
127
128 >>> product = factory.makeProduct(name='lernid', displayname='Lernid')
129 >>> sourcepackagename = factory.makeSourcePackageName(name='lernid')
130 >>> package = factory.makeSourcePackage(
131 ... sourcepackagename=sourcepackagename, distroseries=distroseries)
132
133 >>> view = create_initialized_view(package, name='+portlet-associations')
134 >>> for product in view.product_suggestions:
135 ... print product.name
136 lernid
137
138 >>> content = extract_text(find_tag_by_id(view.render(), 'no-upstreams'))
139 >>> print content
140 Launchpad doesn&#8217;t know which project and series this
141 package belongs to. ...
142 Is the following project the upstream for this source package?
143 Registered upstream project:
144 Lernid...
145
146If there are multiple potential matches they are all shown.
147
148 >>> product = factory.makeProduct(name='lernid-dev', displayname='Lernid Dev')
149 >>> view = create_initialized_view(package, name='+portlet-associations')
150 >>> for product in view.product_suggestions:
151 ... print product.name
152 lernid
153 lernid-dev
154
155 >>> content = extract_text(find_tag_by_id(view.render(), 'no-upstreams'))
156 >>> print content
157 Launchpad doesn&#8217;t know which project and series this
158 package belongs to. ...
159 Is one of these projects the upstream for this source package?
160 Registered upstream project:
161 Lernid...
162 Lernid Dev...
99163
=== modified file 'lib/lp/registry/stories/distroseries/xx-show-distroseries-packaging.txt'
--- lib/lp/registry/stories/distroseries/xx-show-distroseries-packaging.txt 2009-12-10 19:58:31 +0000
+++ lib/lp/registry/stories/distroseries/xx-show-distroseries-packaging.txt 2010-01-30 22:41:18 +0000
@@ -5,9 +5,9 @@
5series +index page.5series +index page.
66
7 >>> anon_browser.open('http://launchpad.dev/ubuntu/hoary')7 >>> anon_browser.open('http://launchpad.dev/ubuntu/hoary')
8 >>> anon_browser.getLink('Upstream links').click()8 >>> anon_browser.getLink('All upstream links').click()
9 >>> print anon_browser.title9 >>> print anon_browser.title
10 Upstream packaging links : ...10 All upstream links : ...
1111
12The page lists the the source packages that have translations, but are12The page lists the the source packages that have translations, but are
13not linked to an upstream project to sync them to.13not linked to an upstream project to sync them to.
@@ -46,3 +46,61 @@
4646
47 >>> print find_tag_by_id(content, 'unlinked_translatables')47 >>> print find_tag_by_id(content, 'unlinked_translatables')
48 None48 None
49
50
51Source packages that need packaging links
52-----------------------------------------
53
54The "Packages that need upstream packaging links" lists the source packages
55that need upstream packaging links. The list is prioritized so that the
56packages with the greatest need are listed first.
57
58 >>> # XXX sinzui 2010-01-21 bug=487793: Enable this when the portlet
59 >>> # is added.
60 >>> #anon_browser.open('http://launchpad.dev/ubuntu/hoary')
61 >>> #anon_browser.getLink('Needs upstream links').click()
62 >>> anon_browser.open(
63 ... 'http://launchpad.dev/ubuntu/hoary/+needs-packaging')
64 >>> print anon_browser.title
65 Needs upstream links : ...
66
67 >>> content = find_main_content(anon_browser.contents)
68 >>> print extract_text(find_tag_by_id(content, 'packages'))
69 Source Package Bugs Translations
70 pmount No bugs 64 strings
71 alsa-utils No bugs No strings
72 cnews No bugs No strings
73 libstdc++ No bugs No strings
74 linux-source-2.6.15 1 bug No strings
75
76The counts in the listing link to their respect bugs and translations
77pages.
78
79 >>> anon_browser.getLink('64 strings')
80 <Link text='64 strings'
81 url='http://translations.launchpad.dev/ubuntu/hoary/+source/pmount'>
82
83 >>> anon_browser.getLink('1 bug')
84 <Link text='1 bug'
85 url='http://bugs.launchpad.dev/ubuntu/+source/linux-source-2.6.15'>
86
87
88The listing is batched so that the user can visit the next page listings.
89
90 >>> print extract_text(find_tag_by_id(content, 'listing-navigation'))
91 1 ... 5 of 5 packages First ... Previous ... Next ... Last
92
93Any use can see that this page is related to the packaging report. It is
94linked, but the link to this page is not enabled.
95
96 >>> print extract_text(find_tag_by_id(content, 'related-pages'))
97 Needs upstream links All upstream links
98
99 >>> anon_browser.getLink('All upstream links')
100 <Link text='All upstream links'
101 url='http://launchpad.dev/ubuntu/hoary/+packaging'>
102
103 >>> anon_browser.getLink('Needs upstream links')
104 Traceback (most recent call last):
105 ...
106 LinkNotFoundError
49107
=== modified file 'lib/lp/registry/stories/packaging/xx-sourcepackage-packaging.txt'
--- lib/lp/registry/stories/packaging/xx-sourcepackage-packaging.txt 2009-12-08 05:02:32 +0000
+++ lib/lp/registry/stories/packaging/xx-sourcepackage-packaging.txt 2010-01-30 22:41:18 +0000
@@ -15,13 +15,14 @@
15 >>> user_browser.getLink('pmount').click()15 >>> user_browser.getLink('pmount').click()
16 >>> print extract_text(find_tag_by_id(16 >>> print extract_text(find_tag_by_id(
17 ... user_browser.contents, 'no-upstreams'))17 ... user_browser.contents, 'no-upstreams'))
18 Launchpad doesn&#8217;t know which project and series this package18 There are no projects registered in Launchpad that are a potential
19 belongs to. ... Can you set the upstream project in Launchpad?19 match for this source package. Can you help us find one?
20 Set upstream link
2021
21No Privileges Person knows that the pmount package comes from the thunderbird22No Privileges Person knows that the pmount package comes from the thunderbird
22project. He sets the upstream packaging link and sees that it is set.23project. He sets the upstream packaging link and sees that it is set.
2324
24 >>> user_browser.getLink('set the upstream project in Launchpad').click()25 >>> user_browser.getLink('Set upstream link').click()
25 >>> user_browser.getControl(26 >>> user_browser.getControl(
26 ... name="field.productseries").value = 'thunderbird/trunk'27 ... name="field.productseries").value = 'thunderbird/trunk'
27 >>> user_browser.getControl("Change").click()28 >>> user_browser.getControl("Change").click()
2829
=== modified file 'lib/lp/registry/stories/person/xx-admin-person-review.txt'
--- lib/lp/registry/stories/person/xx-admin-person-review.txt 2010-01-04 23:07:32 +0000
+++ lib/lp/registry/stories/person/xx-admin-person-review.txt 2010-01-30 22:41:18 +0000
@@ -47,7 +47,7 @@
4747
48The page also contains a link back to the +review page.48The page also contains a link back to the +review page.
4949
50 >>> link = admin_browser.getLink(url='+review', index=1)50 >>> link = admin_browser.getLink(url='+review')
51 >>> print link.text51 >>> print link.text
52 edit[IMG] Review the user's Launchpad information52 edit[IMG] Review the user's Launchpad information
5353
5454
=== added file 'lib/lp/registry/templates/distroseries-needs-packaging.pt'
--- lib/lp/registry/templates/distroseries-needs-packaging.pt 1970-01-01 00:00:00 +0000
+++ lib/lp/registry/templates/distroseries-needs-packaging.pt 2010-01-30 22:41:18 +0000
@@ -0,0 +1,91 @@
1<html
2 xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 metal:use-macro="view/macro:page/main_only"
7 i18n:domain="launchpad">
8 <body>
9 <div metal:fill-slot="main">
10 <div class="top-portlet">
11 <p>
12 Links from distribution packages to upstream project series let
13 distribution and upstream maintainers share bugs, patches, and
14 translations efficiently.
15 </p>
16
17 <p>
18 The packages are listed by priority. Packages that greatest need to
19 forward bugs, sync translations, or need the latest development
20 branch are listed first. Can you help link these packages to
21 registered Launchpad projects?
22 </p>
23
24 <ul id="related-pages" class="horizontal">
25 <li>
26 <a tal:replace="structure context/menu:overview/needs_packaging/fmt:link" />
27 </li>
28 <li>
29 <a tal:replace="structure context/menu:overview/packaging/fmt:link" />
30 </li>
31 </ul>
32 </div>
33
34 <div class="narrow"
35 tal:define="summaries view/cached_unlinked_packages;"
36 tal:condition="summaries/batch">
37 <div id="listing-navigation"
38 tal:content="structure summaries/@@+navigation-links-upper" />
39
40 <table id="packages" class="listing">
41 <thead>
42 <tr>
43 <th>Source Package</th>
44 <th>Bugs</th>
45 <th>Translations</th>
46 </tr>
47 </thead>
48
49 <tbody>
50 <tr tal:repeat="summary summaries/batch">
51 <td>
52 <a class="sprite package-source"
53 tal:attributes="href summary/package/fmt:url"
54 tal:content="summary/package/name">evolution</a>
55 </td>
56 <td tal:define="count summary/total_bugs;
57 singular string:bug;
58 plural string:bugs;">
59 <tal:no-bugs condition="not: count">
60 No bugs
61 </tal:no-bugs>
62 <tal:has-bugs condition="count">
63 <a tal:attributes="href summary/package/distribution_sourcepackage/fmt:url:bugs"
64 ><tal:total-bugs replace="count" />
65 <tal:plural
66 metal:use-macro="context/@@+base-layout-macros/plural-message"/></a>
67 </tal:has-bugs>
68 </td>
69 <td tal:define="count summary/total_messages;
70 singular string:string;
71 plural string:strings;">
72 <tal:no-translations condition="not:count">
73 No strings
74 </tal:no-translations>
75 <tal:has-translations condition="count">
76 <a tal:attributes="href summary/package/fmt:url:translations"
77 ><tal:total-messages replace="count" />
78 <tal:plural
79 metal:use-macro="context/@@+base-layout-macros/plural-message"/></a>
80 </tal:has-translations>
81 </td>
82 </tr>
83 </tbody>
84 </table>
85
86 <div class="results"
87 tal:content="structure summaries/@@+navigation-links-lower" />
88 </div>
89 </div>
90 </body>
91</html>
092
=== modified file 'lib/lp/registry/templates/distroseries-packaging.pt'
--- lib/lp/registry/templates/distroseries-packaging.pt 2009-12-04 00:24:03 +0000
+++ lib/lp/registry/templates/distroseries-packaging.pt 2010-01-30 22:41:18 +0000
@@ -40,7 +40,7 @@
40 </div>40 </div>
4141
42 <tal:known_links condition="packagings/batch">42 <tal:known_links condition="packagings/batch">
43 <h2>Upstream links</h2>43 <h2>All upstream links</h2>
4444
45 <div class="results"45 <div class="results"
46 tal:content="structure packagings/@@+navigation-links-upper" />46 tal:content="structure packagings/@@+navigation-links-upper" />
4747
=== modified file 'lib/lp/registry/templates/sourcepackage-index.pt'
--- lib/lp/registry/templates/sourcepackage-index.pt 2009-12-03 16:54:29 +0000
+++ lib/lp/registry/templates/sourcepackage-index.pt 2010-01-30 22:41:18 +0000
@@ -55,61 +55,7 @@
55 </div>55 </div>
5656
57 <div class="yui-u">57 <div class="yui-u">
58 <div class="portlet"58 <div class="portlet" tal:content="structure context/@@+portlet-associations" />
59 tal:define="series context/productseries">
60 <h2>Upstream associations</h2>
61
62 <tal:has_series condition="series">
63 <div id="upstreams" class="two-column-list">
64 <dl
65 tal:define="project series/product/project"
66 tal:condition="project">
67 <dt>Project Group:</dt>
68 <dd>
69 <a tal:replace="structure project/fmt:link" />
70 </dd>
71 </dl>
72
73 <dl>
74 <dt>Project:</dt>
75 <dd>
76 <a tal:replace="structure series/product/fmt:link" />
77 </dd>
78 </dl>
79
80 <dl>
81 <dt>Series:</dt>
82 <dd>
83 <a
84 tal:content="series/name"
85 tal:attributes="href series/fmt:url">Series</a>
86 <a tal:replace="structure context/menu:overview/edit_packaging/fmt:icon" />
87 </dd>
88 </dl>
89 </div>
90
91 <ul class="horizontal">
92 <li>
93 <a
94 tal:attributes="href series/product/menu:overview/packages/fmt:url"
95 >Show upstream links</a>
96 </li>
97 </ul>
98 </tal:has_series>
99
100 <tal:has_no_series condition="not: series">
101 <p id="no-upstreams">
102 Launchpad doesn&#8217;t know which project and series this
103 package belongs to. Links from distribution packages to
104 upstream project let distribution and upstream
105 maintainers share bugs, patches, and translations
106 efficiently. Can you
107 <a tal:attributes="
108 href context/menu:overview/edit_packaging/url">set
109 the upstream project in Launchpad</a>?
110 </p>
111 </tal:has_no_series>
112 </div>
113 </div>59 </div>
114 </div>60 </div>
11561
11662
=== added file 'lib/lp/registry/templates/sourcepackage-portlet-associations.pt'
--- lib/lp/registry/templates/sourcepackage-portlet-associations.pt 1970-01-01 00:00:00 +0000
+++ lib/lp/registry/templates/sourcepackage-portlet-associations.pt 2010-01-30 22:41:18 +0000
@@ -0,0 +1,97 @@
1<tal:root
2 xmlns:tal="http://xml.zope.org/namespaces/tal"
3 xmlns:metal="http://xml.zope.org/namespaces/metal"
4 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
5 omit-tag="">
6
7 <div id="portlet-associations">
8 <h2>Upstream associations</h2>
9
10 <div class="portletBody portletContent"
11 tal:define="series context/productseries">
12 <tal:has_series condition="series">
13 <div id="upstreams" class="two-column-list">
14 <dl
15 tal:define="project series/product/project"
16 tal:condition="project">
17 <dt>Project Group:</dt>
18 <dd>
19 <a tal:replace="structure project/fmt:link" />
20 </dd>
21 </dl>
22
23 <dl>
24 <dt>Project:</dt>
25 <dd>
26 <a tal:replace="structure series/product/fmt:link" />
27 </dd>
28 </dl>
29
30 <dl>
31 <dt>Series:</dt>
32 <dd>
33 <a
34 tal:content="series/name"
35 tal:attributes="href series/fmt:url">Series</a>
36 <a tal:replace="structure context/menu:overview/edit_packaging/fmt:icon" />
37 </dd>
38 </dl>
39 </div>
40
41 <ul class="horizontal">
42 <li>
43 <a
44 tal:attributes="href series/product/menu:overview/packages/fmt:url"
45 >Show upstream links</a>
46 </li>
47 </ul>
48 </tal:has_series>
49
50 <tal:has_no_series condition="not: series">
51 <div id="no-upstreams" tal:condition="view/product_suggestions">
52 <p>
53 Launchpad doesn&#8217;t know which project and series this
54 package belongs to. Links from distribution packages to
55 upstream project let distribution and upstream
56 maintainers share bugs, patches, and translations
57 efficiently.
58 </p>
59
60 <tal:message
61 define="count python:len(view.product_suggestions);
62 singular string:Is the following project the upstream for this source package?;
63 plural string:Is one of these projects the upstream for this source package?"
64 >
65 <b>
66 <metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
67 </b>
68 </tal:message>
69
70 <div tal:condition="python: len(view.product_suggestions) > 1">
71 <b>Is one of these projects the upstream for this source
72 package?</b>
73 </div>
74 <div tal:condition="python: len(view.product_suggestions) == 1">
75 <b>Is the following project the upstream for this source package?</b>
76 </div>
77 <div metal:use-macro="context/@@launchpad_form/form">
78 <div class="actions" metal:fill-slot="buttons">
79 <input tal:replace="structure view/link/render"/>
80 &nbsp;or&nbsp;
81 <a tal:replace="structure
82 context/menu:overview/set_upstream/fmt:link" />
83 </div>
84 </div>
85 </div>
86 <div id="no-upstreams" tal:condition="not: view/product_suggestions">
87 <p>
88 There are no projects registered in Launchpad that are a potential
89 match for this source package. Can you help us find one?
90 </p>
91 <a tal:replace="structure
92 context/menu:overview/set_upstream/fmt:link" />
93 </div>
94 </tal:has_no_series>
95 </div>
96 </div>
97</tal:root>

Subscribers

People subscribed via source and target branches

to status/vote changes: