Merge lp:~wgrant/launchpad/more-trivialities into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 17725
Proposed branch: lp:~wgrant/launchpad/more-trivialities
Merge into: lp:launchpad
Diff against target: 200 lines (+54/-15)
9 files modified
lib/canonical/launchpad/icing/css/colours.css (+2/-1)
lib/lp/app/browser/tales.py (+3/-0)
lib/lp/bugs/browser/bugmessage.py (+2/-4)
lib/lp/bugs/templates/bug-comment-add-form.pt (+1/-1)
lib/lp/code/browser/tests/test_branch.py (+4/-2)
lib/lp/code/templates/branch-macros.pt (+2/-2)
lib/lp/registry/browser/tests/test_distribution.py (+33/-0)
lib/lp/registry/templates/distribution-index.pt (+6/-5)
lib/lp/registry/templates/milestone-index.pt (+1/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/more-trivialities
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+270656@code.launchpad.net

Commit message

Fix a few trivial UI bugs: Distribution:+index hides disabled feature links, blueprints on Milestone:+index have icons again and are sortable, BugTask:+addcomment's title doesn't duplicate the bug number, the Opinion bug status has a colour, and Branch:+index links more sensibly to merge proposals.

Description of the change

Fix a few trivial UI bugs: Distribution:+index hides disabled feature links, blueprints on Milestone:+index have icons again and are sortable, BugTask:+addcomment's title doesn't duplicate the bug number, the Opinion bug status has a colour, and Branch:+index links more sensibly to merge proposals.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

I wonder if this will result in a weird empty portlet on Distribution:+index in the case where a distribution has none of the features tested there enabled (e.g. Debian)? Otherwise looks fine, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/icing/css/colours.css'
--- lib/canonical/launchpad/icing/css/colours.css 2012-10-26 04:42:32 +0000
+++ lib/canonical/launchpad/icing/css/colours.css 2015-09-10 12:52:58 +0000
@@ -106,7 +106,8 @@
106 color: green;106 color: green;
107 }107 }
108.statusINVALID, .statusINVALID a,108.statusINVALID, .statusINVALID a,
109.statusWONTFIX, .statusWONTFIX a {109.statusWONTFIX, .statusWONTFIX a,
110.statusOPINION, .statusOPINION a {
110 color: #555;111 color: #555;
111 }112 }
112.importanceCRITICAL, .importanceCRITICAL a {113.importanceCRITICAL, .importanceCRITICAL a {
113114
=== modified file 'lib/lp/app/browser/tales.py'
--- lib/lp/app/browser/tales.py 2015-07-23 14:32:50 +0000
+++ lib/lp/app/browser/tales.py 2015-09-10 12:52:58 +0000
@@ -1047,6 +1047,9 @@
10471047
1048 return sprite_str1048 return sprite_str
10491049
1050 def icon(self):
1051 return '<span class="%s"></span>' % self.sprite_css()
1052
1050 def badges(self):1053 def badges(self):
10511054
1052 badges = ''1055 badges = ''
10531056
=== modified file 'lib/lp/bugs/browser/bugmessage.py'
--- lib/lp/bugs/browser/bugmessage.py 2012-01-01 02:58:52 +0000
+++ lib/lp/bugs/browser/bugmessage.py 2015-09-10 12:52:58 +0000
@@ -28,15 +28,13 @@
28 schema = IBugMessageAddForm28 schema = IBugMessageAddForm
29 initial_focus_widget = None29 initial_focus_widget = None
3030
31 page_title = "Add a comment or attachment"
32
31 @property33 @property
32 def label(self):34 def label(self):
33 return 'Add a comment or attachment to bug #%d' % self.context.bug.id35 return 'Add a comment or attachment to bug #%d' % self.context.bug.id
3436
35 @property37 @property
36 def page_title(self):
37 return self.label
38
39 @property
40 def initial_values(self):38 def initial_values(self):
41 return dict(subject=self.context.bug.followup_subject())39 return dict(subject=self.context.bug.followup_subject())
4240
4341
=== modified file 'lib/lp/bugs/templates/bug-comment-add-form.pt'
--- lib/lp/bugs/templates/bug-comment-add-form.pt 2012-09-21 02:51:51 +0000
+++ lib/lp/bugs/templates/bug-comment-add-form.pt 2015-09-10 12:52:58 +0000
@@ -10,7 +10,7 @@
10 >10 >
11 Remember, this bug report is a duplicate of11 Remember, this bug report is a duplicate of
12 <a href="#" tal:attributes="href context/bug/duplicateof/fmt:url">bug12 <a href="#" tal:attributes="href context/bug/duplicateof/fmt:url">bug
13 #<span tal:replace="context/bug/duplicateof/id">42</span></a><br/>.13 #<span tal:replace="context/bug/duplicateof/id">42</span></a>.<br/>
14 Comment here only if you think the duplicate status is wrong.14 Comment here only if you think the duplicate status is wrong.
15 </div>15 </div>
16 <input16 <input
1717
=== modified file 'lib/lp/code/browser/tests/test_branch.py'
--- lib/lp/code/browser/tests/test_branch.py 2015-05-07 13:57:33 +0000
+++ lib/lp/code/browser/tests/test_branch.py 2015-09-10 12:52:58 +0000
@@ -466,6 +466,7 @@
466 # These values are extracted here and used below.466 # These values are extracted here and used below.
467 linked_bug_rendered_text = "\n".join(linked_bug_text)467 linked_bug_rendered_text = "\n".join(linked_bug_text)
468 mp_url = canonical_url(mp, force_local_path=True)468 mp_url = canonical_url(mp, force_local_path=True)
469 branch_url = canonical_url(mp.source_branch, force_local_path=True)
469 branch_display_name = mp.source_branch.displayname470 branch_display_name = mp.source_branch.displayname
470471
471 browser = self.getUserBrowser(canonical_url(branch))472 browser = self.getUserBrowser(canonical_url(branch))
@@ -493,8 +494,9 @@
493494
494 links = revision_content.findAll('a')495 links = revision_content.findAll('a')
495 self.assertEqual(mp_url, links[2]['href'])496 self.assertEqual(mp_url, links[2]['href'])
496 self.assertEqual(linked_bug_urls[0], links[3]['href'])497 self.assertEqual(branch_url, links[3]['href'])
497 self.assertEqual(linked_bug_urls[1], links[4]['href'])498 self.assertEqual(linked_bug_urls[0], links[4]['href'])
499 self.assertEqual(linked_bug_urls[1], links[5]['href'])
498500
499 def test_view_for_user_with_artifact_grant(self):501 def test_view_for_user_with_artifact_grant(self):
500 # Users with an artifact grant for a branch related to a private502 # Users with an artifact grant for a branch related to a private
501503
=== modified file 'lib/lp/code/templates/branch-macros.pt'
--- lib/lp/code/templates/branch-macros.pt 2015-06-10 10:25:28 +0000
+++ lib/lp/code/templates/branch-macros.pt 2015-09-10 12:52:58 +0000
@@ -274,8 +274,8 @@
274 <div tal:define="merge_proposal python:rev_info['merge_proposal']"274 <div tal:define="merge_proposal python:rev_info['merge_proposal']"
275 tal:condition="merge_proposal">275 tal:condition="merge_proposal">
276 <dd class="subordinate revision-comment">276 <dd class="subordinate revision-comment">
277 Merged branch <a tal:attributes="href merge_proposal/fmt:url"277 <a tal:attributes="href merge_proposal/fmt:url">Merged</a> branch
278 tal:content="merge_proposal/source_branch/displayname">source branch</a>278 <a tal:replace="structure merge_proposal/source_branch/fmt:link">source branch</a>
279 <tal:linkedbugs279 <tal:linkedbugs
280 define="linked_bugtasks python:rev_info['linked_bugtasks']"280 define="linked_bugtasks python:rev_info['linked_bugtasks']"
281 condition="linked_bugtasks">281 condition="linked_bugtasks">
282282
=== modified file 'lib/lp/registry/browser/tests/test_distribution.py'
--- lib/lp/registry/browser/tests/test_distribution.py 2012-08-13 21:04:17 +0000
+++ lib/lp/registry/browser/tests/test_distribution.py 2015-09-10 12:52:58 +0000
@@ -9,6 +9,7 @@
9from lazr.restful.interfaces import IJSONRequestCache9from lazr.restful.interfaces import IJSONRequestCache
10import soupmatchers10import soupmatchers
11from testtools.matchers import (11from testtools.matchers import (
12 MatchesAll,
12 MatchesAny,13 MatchesAny,
13 Not,14 Not,
14 )15 )
@@ -19,6 +20,7 @@
19from lp.registry.interfaces.series import SeriesStatus20from lp.registry.interfaces.series import SeriesStatus
20from lp.services.webapp import canonical_url21from lp.services.webapp import canonical_url
21from lp.testing import (22from lp.testing import (
23 admin_logged_in,
22 login_celebrity,24 login_celebrity,
23 login_person,25 login_person,
24 TestCaseWithFactory,26 TestCaseWithFactory,
@@ -98,6 +100,37 @@
98 self.assertThat(view.render(), series_header_match)100 self.assertThat(view.render(), series_header_match)
99 self.assertThat(view.render(), Not(add_series_match))101 self.assertThat(view.render(), Not(add_series_match))
100102
103 def test_mirrors_links(self):
104 view = create_initialized_view(self.distro, "+index")
105 cd_mirrors_link = soupmatchers.HTMLContains(soupmatchers.Tag(
106 "CD mirrors link", "a", text="CD mirrors"))
107 archive_mirrors_link = soupmatchers.HTMLContains(soupmatchers.Tag(
108 "Archive mirrors link", "a", text="Archive mirrors"))
109 self.assertThat(
110 view(), Not(MatchesAny(cd_mirrors_link, archive_mirrors_link)))
111 with admin_logged_in():
112 self.distro.supports_mirrors = True
113 self.assertThat(
114 view(), MatchesAll(cd_mirrors_link, archive_mirrors_link))
115
116 def test_ppas_link(self):
117 view = create_initialized_view(self.distro, "+index")
118 ppas_link = soupmatchers.HTMLContains(soupmatchers.Tag(
119 "PPAs link", "a", text="Personal Package Archives"))
120 self.assertThat(view(), Not(ppas_link))
121 with admin_logged_in():
122 self.distro.supports_ppas = True
123 self.assertThat(view(), ppas_link)
124
125 def test_builds_link(self):
126 view = create_initialized_view(self.distro, "+index")
127 builds_link = soupmatchers.HTMLContains(soupmatchers.Tag(
128 "Builds link", "a", text="Builds"))
129 self.assertThat(view(), Not(builds_link))
130 with admin_logged_in():
131 self.distro.official_packages = True
132 self.assertThat(view(), builds_link)
133
101134
102class TestDistributionView(TestCaseWithFactory):135class TestDistributionView(TestCaseWithFactory):
103 """Tests the DistributionView."""136 """Tests the DistributionView."""
104137
=== modified file 'lib/lp/registry/templates/distribution-index.pt'
--- lib/lp/registry/templates/distribution-index.pt 2014-07-07 03:32:50 +0000
+++ lib/lp/registry/templates/distribution-index.pt 2015-09-10 12:52:58 +0000
@@ -95,18 +95,19 @@
95 define="overview_menu context/menu:overview">95 define="overview_menu context/menu:overview">
96 <tal:menu replace="structure context/@@+global-actions" />96 <tal:menu replace="structure context/@@+global-actions" />
9797
98 <div id="packages-archives" class="portlet">98 <div id="packages-archives" class="portlet"
99 tal:condition="python: context.supports_mirrors or context.supports_ppas or context.official_packages">
99 <ul>100 <ul>
100 <li>101 <li tal:condition="context/supports_mirrors">
101 <a tal:replace="structure overview_menu/cdimage_mirrors/fmt:link" />102 <a tal:replace="structure overview_menu/cdimage_mirrors/fmt:link" />
102 </li>103 </li>
103 <li>104 <li tal:condition="context/supports_mirrors">
104 <a tal:replace="structure overview_menu/archive_mirrors/fmt:link" />105 <a tal:replace="structure overview_menu/archive_mirrors/fmt:link" />
105 </li>106 </li>
106 <li>107 <li tal:condition="context/supports_ppas">
107 <a tal:replace="structure overview_menu/ppas/fmt:link" />108 <a tal:replace="structure overview_menu/ppas/fmt:link" />
108 </li>109 </li>
109 <li>110 <li tal:condition="context/official_packages">
110 <a tal:replace="structure overview_menu/builds/fmt:link" />111 <a tal:replace="structure overview_menu/builds/fmt:link" />
111 </li>112 </li>
112 </ul>113 </ul>
113114
=== modified file 'lib/lp/registry/templates/milestone-index.pt'
--- lib/lp/registry/templates/milestone-index.pt 2015-01-29 18:48:37 +0000
+++ lib/lp/registry/templates/milestone-index.pt 2015-09-10 12:52:58 +0000
@@ -243,6 +243,7 @@
243 <tbody>243 <tbody>
244 <tr tal:repeat="spec specs">244 <tr tal:repeat="spec specs">
245 <td class="icon left">245 <td class="icon left">
246 <span class="sortkey" tal:content="spec/title" />
246 <span tal:content="structure spec/image:icon" />247 <span tal:content="structure spec/image:icon" />
247 </td>248 </td>
248 <td>249 <td>