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
=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py 2010-01-06 12:05:32 +0000
+++ lib/lp/bugs/browser/bug.py 2010-01-19 21:36:19 +0000
@@ -621,8 +621,7 @@
621 confirm_action.label, confirm_action.__name__))621 confirm_action.label, confirm_action.__name__))
622 for new_tag in newly_defined_tags:622 for new_tag in newly_defined_tags:
623 self.notifications.append(623 self.notifications.append(
624 'The tag "%s" hasn\'t yet been used by %s before.'624 'The tag "%s" hasn\'t been used by %s before. %s' % (
625 ' Is this a new tag? %s' % (
626 new_tag, bugtarget.bugtargetdisplayname, confirm_button))625 new_tag, bugtarget.bugtargetdisplayname, confirm_button))
627 self._confirm_new_tags = True626 self._confirm_new_tags = True
628627
@@ -633,7 +632,7 @@
633 self.updateBugFromData(data)632 self.updateBugFromData(data)
634 self.next_url = canonical_url(self.context)633 self.next_url = canonical_url(self.context)
635634
636 @action('Yes, define new tag', name='confirm_tag')635 @action('Create the new tag', name='confirm_tag')
637 def confirm_tag_action(self, action, data):636 def confirm_tag_action(self, action, data):
638 """Define a new tag."""637 """Define a new tag."""
639 self.actions['field.actions.change'].success(data)638 self.actions['field.actions.change'].success(data)
640639
=== 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:36:19 +0000
@@ -615,8 +615,8 @@
615 False615 False
616 >>> for message in bug_edit.view.notifications:616 >>> for message in bug_edit.view.notifications:
617 ... print message617 ... print message
618 The tag "new-tag" hasn't yet been used by Mozilla Firefox before.618 The tag "new-tag" hasn't been used by Mozilla Firefox before.
619 Is this a new tag?...<input ...Yes, define new tag...>619 <input ...Create the new tag...>
620620
621 >>> bug_edit.wasRedirected()621 >>> bug_edit.wasRedirected()
622 False622 False
@@ -629,7 +629,7 @@
629 >>> [action.label for action in bug_edit.view.actions]629 >>> [action.label for action in bug_edit.view.actions]
630 ['Change']630 ['Change']
631631
632If we click on the 'Yes, define new tag' button, we'll get redirected to632If we click on the 'Create the new tag' button, we'll get redirected to
633the bug page, and the bug will have the new tag.633the bug page, and the bug will have the new tag.
634634
635 >>> bug_edit.submit('confirm_tag', edit_values)635 >>> bug_edit.submit('confirm_tag', edit_values)
636636
=== 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:36:19 +0000
@@ -37,7 +37,7 @@
3737
38 >>> user_browser.url38 >>> user_browser.url
39 'http://bugs.launchpad.dev/firefox/+bug/1/+edit'39 'http://bugs.launchpad.dev/firefox/+bug/1/+edit'
40 >>> user_browser.getControl('Yes, define new tag', index=0).click()40 >>> user_browser.getControl('Create the new tag', index=0).click()
41 >>> user_browser.url41 >>> user_browser.url
42 'http://bugs.launchpad.dev/firefox/+bug/1'42 'http://bugs.launchpad.dev/firefox/+bug/1'
4343
@@ -106,9 +106,9 @@
106 >>> user_browser.open('http://bugs.launchpad.dev/firefox/+bug/1/+edit')106 >>> user_browser.open('http://bugs.launchpad.dev/firefox/+bug/1/+edit')
107 >>> user_browser.getControl('Tags').value = 'an-official-tag'107 >>> user_browser.getControl('Tags').value = 'an-official-tag'
108 >>> user_browser.getControl('Change').click()108 >>> user_browser.getControl('Change').click()
109 >>> user_browser.getControl('Yes, define new tag')109 >>> user_browser.getControl('Create the new tag')
110 Traceback (most recent call last):110 Traceback (most recent call last):
111 ...111 ...
112 LookupError: label 'Yes, define new tag'112 LookupError: label 'Create the new tag'
113 >>> print user_browser.url113 >>> print user_browser.url
114 http://bugs.launchpad.dev/firefox/+bug/1114 http://bugs.launchpad.dev/firefox/+bug/1
115115
=== 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:36:19 +0000
@@ -173,7 +173,7 @@
173 ... 'http://bugs.launchpad.dev/redfish/+bug/15/+edit')173 ... 'http://bugs.launchpad.dev/redfish/+bug/15/+edit')
174 >>> admin_browser.getControl("Tags").value = "tag1 tag2 tag3"174 >>> admin_browser.getControl("Tags").value = "tag1 tag2 tag3"
175 >>> admin_browser.getControl("Change").click()175 >>> admin_browser.getControl("Change").click()
176 >>> admin_browser.getControl('Yes, define new tag', index=0).click()176 >>> admin_browser.getControl('Create the new tag', index=0).click()
177177
178 >>> admin_browser.open('http://launchpad.dev/bugs/15')178 >>> admin_browser.open('http://launchpad.dev/bugs/15')
179 >>> print_comments(admin_browser.contents)179 >>> print_comments(admin_browser.contents)
@@ -188,7 +188,7 @@
188 ... 'http://bugs.launchpad.dev/redfish/+bug/15/+edit')188 ... 'http://bugs.launchpad.dev/redfish/+bug/15/+edit')
189 >>> admin_browser.getControl("Tags").value = "tag1 tag2 tag4"189 >>> admin_browser.getControl("Tags").value = "tag1 tag2 tag4"
190 >>> admin_browser.getControl("Change").click()190 >>> admin_browser.getControl("Change").click()
191 >>> admin_browser.getControl('Yes, define new tag', index=0).click()191 >>> admin_browser.getControl('Create the new tag', index=0).click()
192192
193 >>> admin_browser.open('http://launchpad.dev/bugs/15')193 >>> admin_browser.open('http://launchpad.dev/bugs/15')
194 >>> print_comments(admin_browser.contents)194 >>> print_comments(admin_browser.contents)
195195
=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-edit.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-edit.txt 2009-10-30 15:33:43 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-edit.txt 2010-01-19 21:36:19 +0000
@@ -83,13 +83,12 @@
83 >>> user_browser.url83 >>> user_browser.url
84 'http://bugs.launchpad.dev/firefox/+bug/1/+edit'84 'http://bugs.launchpad.dev/firefox/+bug/1/+edit'
85 >>> print user_browser.contents85 >>> print user_browser.contents
86 <...The tag "new-tag" hasn't yet been used by Mozilla Firefox before.86 <...The tag "new-tag" hasn't been used by Mozilla Firefox before...
87 Is this a new tag?...
8887
89Here we can confirm that we want to add the tag, or change the tag name88Here we can confirm that we want to add the tag, or change the tag name
90and submit the form again.89and submit the form again.
9190
92 >>> user_browser.getControl('Yes, define new tag') is not None91 >>> user_browser.getControl('Create the new tag') is not None
93 True92 True
94 >>> user_browser.getControl('Change') is not None93 >>> user_browser.getControl('Change') is not None
95 True94 True
@@ -114,7 +113,7 @@
114 >>> user_browser.getControl('Tags').value = 'new-tag'113 >>> user_browser.getControl('Tags').value = 'new-tag'
115 >>> user_browser.getControl('Change').click()114 >>> user_browser.getControl('Change').click()
116115
117 >>> user_browser.getControl('Yes, define new tag').click()116 >>> user_browser.getControl('Create the new tag').click()
118 >>> user_browser.url117 >>> user_browser.url
119 'http://bugs.launchpad.dev/firefox/+bug/1'118 'http://bugs.launchpad.dev/firefox/+bug/1'
120119