Merge lp:~adeuring/launchpad/bug-435556 into lp:launchpad

Proposed by Abel Deuring
Status: Merged
Merged at revision: not available
Proposed branch: lp:~adeuring/launchpad/bug-435556
Merge into: lp:launchpad
Diff against target: 142 lines (+78/-12)
2 files modified
lib/lp/bugs/stories/bugtask-management/xx-bugtask-edit-forms.txt (+55/-0)
lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt (+23/-12)
To merge this branch: bzr merge lp:~adeuring/launchpad/bug-435556
Reviewer Review Type Date Requested Status
Graham Binns (community) Approve
Review via email: mp+14370@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) wrote :

This branch fixes bug 435556: Non-AJAX bugtask edit links always point to the context task.

This cause is trivial: The links were simply "static" links <a href="+editstatus">, so they all pointed to the edit page of the "current" bug task. The fix is trivial: Set the link target via a TAL expression. Note that when the template is rendered, the context is not the bug task as given by the URL of the page: The context is set in BugTasksAndNominationsView._getTableRowView(), which is called by BugTasksAndNominationsView.getBugTaskAndNominationViews(), and the latter method sets the context to the "right" bugtask.

test: ./bin/test --test=xx-bugtask-edit-forms.txt

Lots of tests mention the +editstatus URL; without checking the relevance of them, a test run covering all of these tests is:

./bin/test -vv -f lp stories.bug-release-management
./bin/test -vv -f lp stories.upstream-bugprivacy
./bin/test -vv -f lp stories.bug-also-affects
./bin/test -vv -t xx-edit-package-bug-task-authenticated.txt \
-t xx-bugtask-bugwatch-linkage.txt \
-t xx-bug-privileged-statuses.txt \
-t xx-bug-importance-change.txt \
-t xx-view-editable-bug-task.txt \
-t xx-edit-email-address-bugtask.txt \
-t xx-subscribe-while-editing.txt \
-t xx-switch-to-malone.txt \
-t xx-bugtask-assignee-widget.txt \
-t xx-bug-create-question.txt \
-t xx-incomplete-bugs.txt \
-t xx-bug-activity.txt \
-t xx-deactivate-account.txt \
-t object-milestones.txt \
-t xx-create-milestone-on-distribution.txt \
-t xx-product-reassignment-and-milestones.txt \

= Launchpad lint =

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

Linting changed files:
  lib/lp/bugs/stories/bugtask-management/xx-bugtask-edit-forms.txt
  lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt

Revision history for this message
Graham Binns (gmb) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'lib/lp/bugs/stories/bugtask-management/xx-bugtask-edit-forms.txt'
--- lib/lp/bugs/stories/bugtask-management/xx-bugtask-edit-forms.txt 1970-01-01 00:00:00 +0000
+++ lib/lp/bugs/stories/bugtask-management/xx-bugtask-edit-forms.txt 2009-11-09 13:06:14 +0000
@@ -0,0 +1,55 @@
1Bug task edit forms
2===================
3
4Aside from the options to edit the status of a bugtask vie Ajax
5and via inline forms of the main bug page (which are by default
6hidden via CSS), the details of a bug task status can be edited
7on dedicated pages.
8
9If a user visits a bug page with a browser that does not have
10Javascript, the links shown in the columns "Status" and "Importance"
11of the bug task table lead him to the bug task edit forms of the
12respective bug task.
13
14>>> admin_browser.open('http://bugs.launchpad.dev/firefox/+bug/1')
15>>> print extract_text(
16... find_tag_by_id(admin_browser.contents, 'affected-software'))
17Affects Status Importance Assigned to...
18Mozilla Firefox... New Low Mark Shuttleworth...
19mozilla-firefox (Debian)... Confirmed Low debbugs #304014...
20mozilla-firefox (Ubuntu)... New Medium Unassigned
21...
22
23>>> print admin_browser.getLink('New', index=0).url
24http://bugs.launchpad.dev/firefox/+bug/1/+editstatus
25>>> print admin_browser.getLink('Low', index=0).url
26http://bugs.launchpad.dev/firefox/+bug/1/+editstatus
27
28>>> print admin_browser.getLink('Confirmed').url
29http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+bug/1/+editstatus
30>>> print admin_browser.getLink('Low', index=1).url
31http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+bug/1/+editstatus
32
33>>> print admin_browser.getLink('New', index=1).url
34http://bugs.launchpad.dev/ubuntu/+source/mozilla-firefox/+bug/1/+editstatus
35>>> print admin_browser.getLink('Medium').url
36http://bugs.launchpad.dev/ubuntu/+source/mozilla-firefox/+bug/1/+editstatus
37
38>>> admin_browser.getLink('New').click()
39>>> print extract_text(admin_browser.contents)
40Bug #1 in Mozilla Firefox...
41...
42Affecting: Mozilla Firefox
43Filed here by: Sample Person
44When: 2004-01-02
45Assigned: 2005-01-02
46Project (Find&hellip;)
47Status Importance Milestone
48New... Low... (no value)...
49Assigned to... Mark Shuttleworth (mark)
50...
51Comment on this change (optional)
52...
53
54For more details of the +editstatus page, see xx-bug-privileged-statuses.txt,
55xx-view-editable-bug-task.txt.
056
=== modified file 'lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt'
--- lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt 2009-09-20 17:15:31 +0000
+++ lib/lp/bugs/templates/bugtask-tasks-and-nominations-table-row.pt 2009-11-09 13:06:14 +0000
@@ -7,7 +7,8 @@
7 tasklink view/taskLink;7 tasklink view/taskLink;
8 row_id string:tasksummary${context/id};8 row_id string:tasksummary${context/id};
9 form_row_id string:task${context/id}">9 form_row_id string:task${context/id}">
10 <tr tal:attributes="class view/getTaskRowCSSClass; id row_id">10 <tr tal:define="editstatus_url string:${context/fmt:url}/+editstatus"
11 tal:attributes="class view/getTaskRowCSSClass; id row_id">
11 <td class="icon left right">12 <td class="icon left right">
12 <metal:expander13 <metal:expander
13 metal:define-macro="expander"14 metal:define-macro="expander"
@@ -68,10 +69,12 @@
68 <div class="status-content"69 <div class="status-content"
69 style="width: 100%; float: left">70 style="width: 100%; float: left">
70 <a href="+editstatus"71 <a href="+editstatus"
71 tal:attributes="class string:value status${context/status/name}"72 tal:attributes="class string:value status${context/status/name};
73 href editstatus_url"
72 style="float: left"74 style="float: left"
73 tal:content="context/status/title" />75 tal:content="context/status/title" />
74 <a href="+editstatus" style="margin-left: 3px">76 <a href="+editstatus" style="margin-left: 3px"
77 tal:attributes="href editstatus_url">
75 <img class="editicon" src="/@@/edit" />78 <img class="editicon" src="/@@/edit" />
76 </a>79 </a>
77 </div>80 </div>
@@ -82,10 +85,12 @@
82 <div class="importance-content"85 <div class="importance-content"
83 style="width: 100%; float: left">86 style="width: 100%; float: left">
84 <a href="+editstatus"87 <a href="+editstatus"
85 tal:attributes="class string:value importance${context/importance/name}"88 tal:attributes="class string:value importance${context/importance/name};
89 href editstatus_url"
86 style="float: left"90 style="float: left"
87 tal:content="context/importance/title" />91 tal:content="context/importance/title" />
88 <a href="+editstatus" style="margin-left: 3px">92 <a href="+editstatus" style="margin-left: 3px"
93 tal:attributes="href editstatus_url">
89 <img class="editicon" src="/@@/edit" />94 <img class="editicon" src="/@@/edit" />
90 </a>95 </a>
91 </div>96 </div>
@@ -143,25 +148,31 @@
143 style="width: 100%; float: left">148 style="width: 100%; float: left">
144 <tal:not-milestoned condition="python: not context.milestone and149 <tal:not-milestoned condition="python: not context.milestone and
145 view.user_can_edit_milestone">150 view.user_can_edit_milestone">
146 <a href="+editstatus"> 151 <a href="+editstatus" tal:attributes="href editstatus_url">
147 <img class="addicon" src="/@@/add" />152 <img class="addicon" src="/@@/add" />
148 </a>153 </a>
149 <a href="+editstatus" class="nulltext js-action">Target to milestone</a>154 <a href="+editstatus" class="nulltext js-action"
150 <a href="+editstatus" class="value" style="display:none" />155 tal:attributes="href editstatus_url">Target to milestone</a>
151 <a href="+editstatus">156 <a href="+editstatus" class="value" style="display:none"
157 tal:attributes="href editstatus_url" />
158 <a href="+editstatus"
159 tal:attributes="href editstatus_url">
152 <img class="editicon" style="display:none" src="/@@/edit" />160 <img class="editicon" style="display:none" src="/@@/edit" />
153 </a>161 </a>
154 </tal:not-milestoned>162 </tal:not-milestoned>
155 <tal:milestoned condition="context/milestone">163 <tal:milestoned condition="context/milestone">
156 <a href="+editstatus">164 <a href="+editstatus"
165 tal:attributes="href editstatus_url">
157 <img class="addicon" style="display:none" src="/@@/add" />166 <img class="addicon" style="display:none" src="/@@/add" />
158 </a>167 </a>
159 <a href="+editstatus" style="display:none" class="nulltext js-sction">168 <a href="+editstatus" style="display:none" class="nulltext js-sction"
169 tal:attributes="href editstatus_url">
160 Target to milestone170 Target to milestone
161 </a>171 </a>
162 <a tal:attributes="href context/milestone/fmt:url" class="value"172 <a tal:attributes="href context/milestone/fmt:url" class="value"
163 tal:content="context/milestone/title" />173 tal:content="context/milestone/title" />
164 <a href="+editstatus" tal:condition="view/user_can_edit_milestone">174 <a href="+editstatus" tal:condition="view/user_can_edit_milestone"
175 tal:attributes="href editstatus_url">
165 <img class="editicon" src="/@@/edit" />176 <img class="editicon" src="/@@/edit" />
166 </a>177 </a>
167 </tal:milestoned>178 </tal:milestoned>