Merge lp:~jamalta/launchpad/newtag-statement-redundancy into lp:launchpad

Proposed by Jamal Fanaian
Status: Merged
Approved by: Brad Crittenden
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~jamalta/launchpad/newtag-statement-redundancy
Merge into: lp:launchpad
Diff against target: 121 lines (+13/-15)
5 files modified
lib/lp/bugs/browser/bug.py (+2/-3)
lib/lp/bugs/browser/tests/bug-views.txt (+3/-3)
lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt (+3/-3)
lib/lp/bugs/stories/bugs/xx-bug-activity.txt (+2/-2)
lib/lp/bugs/stories/bugs/xx-bug-edit.txt (+3/-4)
To merge this branch: bzr merge lp:~jamalta/launchpad/newtag-statement-redundancy
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Curtis Hovey (community) ui Approve
Review via email: mp+17670@code.launchpad.net

Commit message

Changed the confirmation message when defining a new bug tag to 'The tag "[tagname]" hasn't been used by [targetname] before. (Create the new tag)'. to remove redundancy.

To post a comment you must log in.
Revision history for this message
Jamal Fanaian (jamalta) wrote :

= Summary =

The message 'The tag "[tagname]" hasn't yet been used by [targetname] before. Is this a new tag?' is redundant and misleading. "Yet" and "before" should not are redundant in the statement. From bug 106924 and bug 87058.

== Proposed fix ==

Replace statement with 'The tag "[tagname]" hasn't been used by [targetname] before. (Create the new tag)'

== Pre-implementation notes ==

Spoke with bac to confirm the language that should be used to fix the issue.

== Tests ==

% bin/test -vvct xx-bug-edit

== Demo and Q/A ==

* https://bugs.launchpad.dev/firefox/+bug/1/+edit
  Enter "new-tag" as a tag and click Change

== 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/browser/bug.py
  lib/lp/bugs/stories/bugs/xx-bug-edit.txt

== Pylint notices ==

lib/lp/bugs/browser/bug.py
    28: [F0401] Unable to import 'email.MIMEMultipart' (No module named MIMEMultipart)
    29: [F0401] Unable to import 'email.MIMEText' (No module named MIMEText)
    43: [F0401] Unable to import 'lazr.enum' (No module named enum)
    44: [F0401] Unable to import 'lazr.lifecycle.event' (No module named lifecycle)
    45: [F0401] Unable to import 'lazr.lifecycle.snapshot' (No module named lifecycle)
    46: [F0401] Unable to import 'lazr.restful.interfaces' (No module named restful)

Confirmed that the lint notices are not related to my branch by gary_poster in #launchpad-dev

Revision history for this message
Brad Crittenden (bac) wrote :

Hi Jamal,

Thanks for the quick fix. As I pointed out on IRC you missed fixing a few tests.

These need updating:

...me/bac/canonical/lp-branches/reviewer> bzr ls -VR --kind=file --null | xargs -0 grep -In define\ new\ tag
lib/lp/bugs/browser/tests/bug-views.txt:619: Is this a new tag?...<input ...Yes, define new tag...>
lib/lp/bugs/browser/tests/bug-views.txt:632:If we click on the 'Yes, define new tag' button, we'll get redirected to
lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt:40: >>> user_browser.getControl('Yes, define new tag', index=0).click()
lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt:109: >>> user_browser.getControl('Yes, define new tag')
lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt:112: LookupError: label 'Yes, define new tag'
lib/lp/bugs/stories/bugs/xx-bug-activity.txt:176: >>> admin_browser.getControl('Yes, define new tag', index=0).click()
lib/lp/bugs/stories/bugs/xx-bug-activity.txt:191: >>> admin_browser.getControl('Yes, define new tag', index=0).click()

Otherwise it looks really good. Just some rote test fixing and it'll be ready to land.

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

I like the wording change. It is very direct.

review: Approve (ui)
Revision history for this message
Jamal Fanaian (jamalta) wrote :
Download full text (3.2 KiB)

Updated tests that referenced changed language.

=== modified file 'lib/lp/bugs/browser/tests/bug-views.txt'
--- lib/lp/bugs/browser/tests/bug-views.txt 2009-12-24 01:41:54 +0000
+++ lib/lp/bugs/browser/tests/bug-views.txt 2010-01-19 21:33:16 +0000
@@ -615,8 +615,8 @@
     False
     >>> for message in bug_edit.view.notifications:
     ... print message
- The tag "new-tag" hasn't yet been used by Mozilla Firefox before.
- Is this a new tag?...<input ...Yes, define new tag...>
+ The tag "new-tag" hasn't been used by Mozilla Firefox before.
+ <input ...Create the new tag...>

     >>> bug_edit.wasRedirected()
     False
@@ -629,7 +629,7 @@
     >>> [action.label for action in bug_edit.view.actions]
     ['Change']

-If we click on the 'Yes, define new tag' button, we'll get redirected to
+If we click on the 'Create the new tag' button, we'll get redirected to
 the bug page, and the bug will have the new tag.

     >>> bug_edit.submit('confirm_tag', edit_values)

=== modified file 'lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt'
--- lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt 2009-06-12 16:36:02 +0000
+++ lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt 2010-01-19 21:33:16 +0000
@@ -37,7 +37,7 @@

     >>> user_browser.url
     'http://bugs.launchpad.dev/firefox/+bug/1/+edit'
- >>> user_browser.getControl('Yes, define new tag', index=0).click()
+ >>> user_browser.getControl('Create the new tag', index=0).click()
     >>> user_browser.url
     'http://bugs.launchpad.dev/firefox/+bug/1'

@@ -106,9 +106,9 @@
     >>> user_browser.open('http://bugs.launchpad.dev/firefox/+bug/1/+edit')
     >>> user_browser.getControl('Tags').value = 'an-official-tag'
     >>> user_browser.getControl('Change').click()
- >>> user_browser.getControl('Yes, define new tag')
+ >>> user_browser.getControl('Create the new tag')
     Traceback (most recent call last):
     ...
- LookupError: label 'Yes, define new tag'
+ LookupError: label 'Create the new tag'
     >>> print user_browser.url
     http://bugs.launchpad.dev/firefox/+bug/1

=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-activity.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2009-12-16 21:26:57 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2010-01-19 21:33:16 +0000
@@ -173,7 +173,7 @@
     ... 'http://bugs.launchpad.dev/redfish/+bug/15/+edit')
     >>> admin_browser.getControl("Tags").value = "tag1 tag2 tag3"
     >>> admin_browser.getControl("Change").click()
- >>> admin_browser.getControl('Yes, define new tag', index=0).click()
+ >>> admin_browser.getControl('Create the new tag', index=0).click()

     >>> admin_browser.open('http://launchpad.dev/bugs/15')
     >>> print_comments(admin_browser.contents)
@@ -188,7 +188,7 @@
     ... 'http://bugs.launchpad.dev/redfish/+bug/15/+edit')
     >>> admin_browser.getControl("Tags").value = "tag1 tag2 tag4"
     >>> admin_browser.getControl("Change").click()
- >>> admin_browser.getControl('Yes, define new tag', index=0).click()
+ >>> admin_browser.getControl('Create the new tag', index=0).click()

     >>> admin_browser.open('http://l...

Read more...

Revision history for this message
Brad Crittenden (bac) wrote :

Thanks for fixing the additional tests, Jamal. It looks great now.

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/bug.py'
2--- lib/lp/bugs/browser/bug.py 2010-01-06 12:05:32 +0000
3+++ lib/lp/bugs/browser/bug.py 2010-01-19 21:36:19 +0000
4@@ -621,8 +621,7 @@
5 confirm_action.label, confirm_action.__name__))
6 for new_tag in newly_defined_tags:
7 self.notifications.append(
8- 'The tag "%s" hasn\'t yet been used by %s before.'
9- ' Is this a new tag? %s' % (
10+ 'The tag "%s" hasn\'t been used by %s before. %s' % (
11 new_tag, bugtarget.bugtargetdisplayname, confirm_button))
12 self._confirm_new_tags = True
13
14@@ -633,7 +632,7 @@
15 self.updateBugFromData(data)
16 self.next_url = canonical_url(self.context)
17
18- @action('Yes, define new tag', name='confirm_tag')
19+ @action('Create the new tag', name='confirm_tag')
20 def confirm_tag_action(self, action, data):
21 """Define a new tag."""
22 self.actions['field.actions.change'].success(data)
23
24=== modified file 'lib/lp/bugs/browser/tests/bug-views.txt'
25--- lib/lp/bugs/browser/tests/bug-views.txt 2009-12-24 01:41:54 +0000
26+++ lib/lp/bugs/browser/tests/bug-views.txt 2010-01-19 21:36:19 +0000
27@@ -615,8 +615,8 @@
28 False
29 >>> for message in bug_edit.view.notifications:
30 ... print message
31- The tag "new-tag" hasn't yet been used by Mozilla Firefox before.
32- Is this a new tag?...<input ...Yes, define new tag...>
33+ The tag "new-tag" hasn't been used by Mozilla Firefox before.
34+ <input ...Create the new tag...>
35
36 >>> bug_edit.wasRedirected()
37 False
38@@ -629,7 +629,7 @@
39 >>> [action.label for action in bug_edit.view.actions]
40 ['Change']
41
42-If we click on the 'Yes, define new tag' button, we'll get redirected to
43+If we click on the 'Create the new tag' button, we'll get redirected to
44 the bug page, and the bug will have the new tag.
45
46 >>> bug_edit.submit('confirm_tag', edit_values)
47
48=== modified file 'lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt'
49--- lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt 2009-06-12 16:36:02 +0000
50+++ lib/lp/bugs/stories/bug-tags/xx-tags-on-bug-page.txt 2010-01-19 21:36:19 +0000
51@@ -37,7 +37,7 @@
52
53 >>> user_browser.url
54 'http://bugs.launchpad.dev/firefox/+bug/1/+edit'
55- >>> user_browser.getControl('Yes, define new tag', index=0).click()
56+ >>> user_browser.getControl('Create the new tag', index=0).click()
57 >>> user_browser.url
58 'http://bugs.launchpad.dev/firefox/+bug/1'
59
60@@ -106,9 +106,9 @@
61 >>> user_browser.open('http://bugs.launchpad.dev/firefox/+bug/1/+edit')
62 >>> user_browser.getControl('Tags').value = 'an-official-tag'
63 >>> user_browser.getControl('Change').click()
64- >>> user_browser.getControl('Yes, define new tag')
65+ >>> user_browser.getControl('Create the new tag')
66 Traceback (most recent call last):
67 ...
68- LookupError: label 'Yes, define new tag'
69+ LookupError: label 'Create the new tag'
70 >>> print user_browser.url
71 http://bugs.launchpad.dev/firefox/+bug/1
72
73=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-activity.txt'
74--- lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2009-12-16 21:26:57 +0000
75+++ lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2010-01-19 21:36:19 +0000
76@@ -173,7 +173,7 @@
77 ... 'http://bugs.launchpad.dev/redfish/+bug/15/+edit')
78 >>> admin_browser.getControl("Tags").value = "tag1 tag2 tag3"
79 >>> admin_browser.getControl("Change").click()
80- >>> admin_browser.getControl('Yes, define new tag', index=0).click()
81+ >>> admin_browser.getControl('Create the new tag', index=0).click()
82
83 >>> admin_browser.open('http://launchpad.dev/bugs/15')
84 >>> print_comments(admin_browser.contents)
85@@ -188,7 +188,7 @@
86 ... 'http://bugs.launchpad.dev/redfish/+bug/15/+edit')
87 >>> admin_browser.getControl("Tags").value = "tag1 tag2 tag4"
88 >>> admin_browser.getControl("Change").click()
89- >>> admin_browser.getControl('Yes, define new tag', index=0).click()
90+ >>> admin_browser.getControl('Create the new tag', index=0).click()
91
92 >>> admin_browser.open('http://launchpad.dev/bugs/15')
93 >>> print_comments(admin_browser.contents)
94
95=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-edit.txt'
96--- lib/lp/bugs/stories/bugs/xx-bug-edit.txt 2009-10-30 15:33:43 +0000
97+++ lib/lp/bugs/stories/bugs/xx-bug-edit.txt 2010-01-19 21:36:19 +0000
98@@ -83,13 +83,12 @@
99 >>> user_browser.url
100 'http://bugs.launchpad.dev/firefox/+bug/1/+edit'
101 >>> print user_browser.contents
102- <...The tag "new-tag" hasn't yet been used by Mozilla Firefox before.
103- Is this a new tag?...
104+ <...The tag "new-tag" hasn't been used by Mozilla Firefox before...
105
106 Here we can confirm that we want to add the tag, or change the tag name
107 and submit the form again.
108
109- >>> user_browser.getControl('Yes, define new tag') is not None
110+ >>> user_browser.getControl('Create the new tag') is not None
111 True
112 >>> user_browser.getControl('Change') is not None
113 True
114@@ -114,7 +113,7 @@
115 >>> user_browser.getControl('Tags').value = 'new-tag'
116 >>> user_browser.getControl('Change').click()
117
118- >>> user_browser.getControl('Yes, define new tag').click()
119+ >>> user_browser.getControl('Create the new tag').click()
120 >>> user_browser.url
121 'http://bugs.launchpad.dev/firefox/+bug/1'
122