Merge lp:~jcsackett/launchpad/unlink-321675 into lp:launchpad

Proposed by j.c.sackett on 2010-12-21
Status: Merged
Approved by: j.c.sackett on 2010-12-21
Approved revision: no longer in the source branch.
Merged at revision: 12136
Proposed branch: lp:~jcsackett/launchpad/unlink-321675
Merge into: lp:launchpad
Diff against target: 38 lines (+4/-4)
2 files modified
lib/lp/bugs/browser/bugbranch.py (+3/-3)
lib/lp/bugs/stories/bugs/xx-link-bug-to-branch.txt (+1/-1)
To merge this branch: bzr merge lp:~jcsackett/launchpad/unlink-321675
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code 2010-12-21 Approve on 2010-12-21
Review via email: mp+44388@code.launchpad.net

Commit Message

[r=bac][ui=none][bug=321675] Changes the 'Delete' button when unlinking a bug and a branch to "Remove link"

Description of the Change

Summary
=======

When a bug is unlinked from a branch, the button to confirm the action is "Delete." This is both confusing and scary for a user, because it's not clear if you're deleting the branch or deleting the link. A first step in fixing this ui is to rename the button to Remove link, which matches the language used in the page.

Implementation
==============

lib/lp/bugs/browser/bugbranch.py
--------------------------------
Update the action name to "Remove link" instead of "Delete"

There are also some drive by lint fixes; changes to wrap length and line spacing.

lib/lp/bugs/stories/bugs/xx-link-bug-to-branch.txt
--------------------------------------------------
Updated to match the new action name.

QA
==

1) Create a link between a bug and a branch on launchpad.dev
2) Remove the link from the bug's page
3) The button should say Remove link, not Delete. Clicking it should remove the link

Lint
====

To post a comment you must log in.
Brad Crittenden (bac) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/browser/bugbranch.py'
2--- lib/lp/bugs/browser/bugbranch.py 2010-11-23 23:22:27 +0000
3+++ lib/lp/bugs/browser/bugbranch.py 2010-12-21 20:08:37 +0000
4@@ -96,7 +96,7 @@
5
6 cancel_url = next_url
7
8- @action('Delete', name='delete')
9+ @action('Remove link', name='delete')
10 def delete_action(self, action, data):
11 self.context.bug.unlinkBranch(self.context.branch, self.user)
12
13@@ -115,8 +115,9 @@
14 @property
15 def show_branch_status(self):
16 """Show the branch status if merged and there are no proposals."""
17+ lifecycle_status = self.context.branch.lifecycle_status
18 return (len(self.merge_proposals) == 0 and
19- self.context.branch.lifecycle_status == BranchLifecycleStatus.MERGED)
20+ lifecycle_status == BranchLifecycleStatus.MERGED)
21
22
23 class BranchLinkToBugView(LaunchpadFormView):
24@@ -163,4 +164,3 @@
25 branch_view = getMultiAdapter(
26 (self.branch, self.request), name="+bug-branch")
27 return branch_view()
28-
29
30=== modified file 'lib/lp/bugs/stories/bugs/xx-link-bug-to-branch.txt'
31--- lib/lp/bugs/stories/bugs/xx-link-bug-to-branch.txt 2009-11-17 09:08:17 +0000
32+++ lib/lp/bugs/stories/bugs/xx-link-bug-to-branch.txt 2010-12-21 20:08:37 +0000
33@@ -49,4 +49,4 @@
34 not support SVG and the branch lp://dev/~name12/firefox/main?
35 ...
36
37- >>> user_browser.getControl('Delete').click()
38+ >>> user_browser.getControl('Remove link').click()