← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~sinzui/launchpad/contact-launchpad-1 into lp:launchpad/devel

 

Curtis Hovey has proposed merging lp:~sinzui/launchpad/contact-launchpad-1 into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


This is my branch to dissuade users from using feedback@xxxxxxxxxxxxx.

    lp:~sinzui/launchpad/contact-launchpad-1
    Diff size: 322
    Launchpad bug:
          https://bugs.launchpad.net/bugs/634082
    Test command: ./bin/test -vv \
          -t question-compatibility -t base-layout -t test_base_layout \
          -t test_launchpadroot -t archivesubscriber \
          -t ppa-subscription-cancelled -t ppa-subscription-new 
    Pre-implementation: Edwin
    Target release: 10.10


dissuade users from using feedback@xxxxxxxxxxxxx
------------------------------------------------

While doing CHR, most of the feedback emails were about issues that are best
resolved using Launchpad Answers. Many of the questions had been stuck in the
moderation queue for several days, where as answers can be seen immediately.
The only cases where the user cannot use Lp Answers is when they are anonymous
possibly because they cannot login.


Rules
-----

There is already a /feedback url that redirects to the help site. The page
need an update to encourage users to use answers and to direct users with
registration/login/reset issues to visit
https://forms.canonical.com/lp-login-support/ for help.

    * Co-opt the existing redirect of /support to go to launchpad answers.
    * Update templates that use feedback@ to include a link to /support
      with the user is logged in, otherwise use /feedback

Do not change the email about private PPAs because directing users to use
answers may encourage users to leak private information.

Do not change the suspended account messages. feedback@ is the only way for
a suspended user to contact us in writing.


QA
--

    * View the Contact Launchpad Support link while logged in
    * Verify that the link it too /support
    * Follow the link.
    * Verify you are redirected to answers.launchpad.net/launchpad

    * View the Contact Launchpad Support link while anonymous
    * Verify that the link it too /feedback
    * Follow the link.
    * Verify you are redirected to https://help.launchpad.net/Feedback


Lint
----

Linting changed files:
  lib/canonical/launchpad/blocked.html
  lib/canonical/launchpad/browser/launchpad.py
  lib/canonical/launchpad/emailtemplates/help.txt
  lib/canonical/launchpad/templates/launchpad-gone.pt
  lib/canonical/launchpad/templates/launchpad-notfound.pt
  lib/lp/answers/stories/question-compatibility-urls.txt
  lib/lp/app/browser/tests/base-layout.txt
  lib/lp/app/browser/tests/test_base_layout.py
  lib/lp/app/browser/tests/test_launchpadroot.py
  lib/lp/app/templates/base-layout-macros.pt
  lib/lp/bugs/templates/bugtarget-macros-filebug.pt
  lib/lp/bugs/templates/bugwatch-error-help.pt


Test
----

Removed the test for the old /support redirect
    * lib/lp/answers/stories/question-compatibility-urls.txt

Added tests to verify the Contact Support links (/support or /feedback)
    * lib/lp/app/browser/tests/base-layout.txt
    * lib/lp/app/browser/tests/test_base_layout.py
    * lib/lp/app/browser/tests/test_launchpadroot.py


Implementation
--------------

Replaced feedback@ with link to /support, or if the user can be anonymous
/feedback.
    * lib/canonical/launchpad/blocked.html
    * lib/canonical/launchpad/emailtemplates/help.txt
    * lib/canonical/launchpad/templates/launchpad-gone.pt
    * lib/canonical/launchpad/templates/launchpad-notfound.pt
    * lib/lp/app/templates/base-layout-macros.pt
    * lib/lp/bugs/templates/bugtarget-macros-filebug.pt
    * lib/lp/bugs/templates/bugwatch-error-help.pt

Updated /support to redirect to the answers page for the launchpad project.
    * lib/canonical/launchpad/browser/launchpad.py
-- 
https://code.launchpad.net/~sinzui/launchpad/contact-launchpad-1/+merge/36987
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~sinzui/launchpad/contact-launchpad-1 into lp:launchpad/devel.
=== modified file 'lib/canonical/launchpad/blocked.html'
--- lib/canonical/launchpad/blocked.html	2010-01-20 09:19:28 +0000
+++ lib/canonical/launchpad/blocked.html	2010-09-29 14:06:47 +0000
@@ -13,12 +13,12 @@
 
         <h1>You have been blocked</h1>
         <p>
-          Due to what we suspect to be inappropriate usage 
+          Due to what we suspect to be inappropriate usage
           of Launchpad, your access has been blocked.
         </p>
         <p>
           If you believe this to be in error, please contact
-          us at feedback@xxxxxxxxxxxxx.
+          us at <a href="/support">Launchpad Support</a>.
         </p>
 
     </div>

=== modified file 'lib/canonical/launchpad/browser/launchpad.py'
--- lib/canonical/launchpad/browser/launchpad.py	2010-09-29 00:49:50 +0000
+++ lib/canonical/launchpad/browser/launchpad.py	2010-09-29 14:06:47 +0000
@@ -483,10 +483,10 @@
 
     @stepto('support')
     def redirect_support(self):
-        """Redirect /support to Answers root site."""
+        """Redirect /support to launchpad Answers site."""
         target_url = canonical_url(
-            getUtility(ILaunchpadRoot), rootsite='answers')
-        return self.redirectSubTree(target_url + 'questions', status=301)
+            getUtility(ILaunchpadCelebrities).launchpad, rootsite='answers')
+        return self.redirectSubTree(target_url, status=301)
 
     @stepto('legal')
     def redirect_legal(self):

=== modified file 'lib/canonical/launchpad/emailtemplates/help.txt'
--- lib/canonical/launchpad/emailtemplates/help.txt	2010-03-12 15:52:45 +0000
+++ lib/canonical/launchpad/emailtemplates/help.txt	2010-09-29 14:06:47 +0000
@@ -271,8 +271,8 @@
 https://wiki.launchpad.canonical.com/Bugs/EmailInterface
 
 If you've waited several minutes and still not received either a
-change notification or an error message, please email
-feedback@xxxxxxxxxxxxx
+change notification or an error message, ask a question at
+https://launchpad.net/support
 
 
 Filtering bug mail

=== modified file 'lib/canonical/launchpad/templates/launchpad-gone.pt'
--- lib/canonical/launchpad/templates/launchpad-gone.pt	2009-12-23 16:17:12 +0000
+++ lib/canonical/launchpad/templates/launchpad-gone.pt	2010-09-29 14:06:47 +0000
@@ -12,8 +12,11 @@
       <p>There&#8217;s no page with this address in Launchpad.</p>
 
       <p tal:condition="view/referrer">
-        If this is blocking your work, let us know by sending an message to
-        <a href="mailto:feedback@xxxxxxxxxxxxx";>feedback@xxxxxxxxxxxxx</a>.
+        If this is blocking your work, let us know by asking a question at
+        <a tal:condition="not: view/user|nothing"
+            href="/feedback">Launchpad Support</a>
+        <a tal:condition="view/user|nothing"
+          href="/support">Launchpad Support</a>.
         Otherwise, complain to the maintainers of the page that linked here.
       </p>
 

=== modified file 'lib/canonical/launchpad/templates/launchpad-notfound.pt'
--- lib/canonical/launchpad/templates/launchpad-notfound.pt	2009-07-17 17:59:07 +0000
+++ lib/canonical/launchpad/templates/launchpad-notfound.pt	2010-09-29 14:06:47 +0000
@@ -21,9 +21,11 @@
           Otherwise, complain to the maintainers of the page that linked here.
         </p>
         <p>
-          If this is blocking your work, let us know by sending an message to
-          <a href="mailto:feedback@xxxxxxxxxxxxx";
-             >feedback@xxxxxxxxxxxxx</a>.
+          If this is blocking your work, let us know by asking a question at
+          <a tal:condition="not: view/user|nothing"
+            href="/feedback">Launchpad Support</a>
+          <a tal:condition="view/user|nothing"
+            href="/support">Launchpad Support</a>.
           Include the error <abbr>ID</abbr>
           <code class="oopsid" tal:content="request/oopsid">OOPS-A1234</code>
           in your message.

=== modified file 'lib/lp/answers/stories/question-compatibility-urls.txt'
--- lib/lp/answers/stories/question-compatibility-urls.txt	2009-09-23 14:40:53 +0000
+++ lib/lp/answers/stories/question-compatibility-urls.txt	2010-09-29 14:06:47 +0000
@@ -4,17 +4,6 @@
 As part of that rename many URLs were changed to reflect the new
 terminology. We provide redirect from the old names to the new ones.
 
-
-== Main application ==
-
-    >>> browser.open('http://launchpad.dev/support')
-    >>> print browser.url
-    http://answers.launchpad.dev/questions
-
-    >>> browser.open('http://launchpad.dev/support/+tickets')
-    >>> print browser.url
-    http://answers.launchpad.dev/questions/+questions
-
 == Answer Contact Page ==
 
     >>> user_browser.open('http://launchpad.dev/firefox/+support-contact')

=== modified file 'lib/lp/app/browser/tests/base-layout.txt'
--- lib/lp/app/browser/tests/base-layout.txt	2010-09-03 19:44:29 +0000
+++ lib/lp/app/browser/tests/base-layout.txt	2010-09-29 14:06:47 +0000
@@ -170,7 +170,7 @@
     Read the guide https://help.launchpad.net/
     Canonical&nbsp;Ltd. http://canonical.com/
     Terms of use http://launchpad.dev/legal
-    Contact Launchpad Support https://help.launchpad.net/Feedback
+    Contact Launchpad Support /feedback
     System status http://identi.ca/launchpadstatus
 
 

=== modified file 'lib/lp/app/browser/tests/test_base_layout.py'
--- lib/lp/app/browser/tests/test_base_layout.py	2010-08-20 20:31:18 +0000
+++ lib/lp/app/browser/tests/test_base_layout.py	2010-09-29 14:06:47 +0000
@@ -159,3 +159,21 @@
         self.assertEqual(None, document.find(True, id='watermark'))
         self.assertEqual(None, document.find(True, id='side-portlets'))
         self.assertEqual(None, document.find(True, id='globalsearch'))
+
+    def test_contact_support_logged_in(self):
+        # The support link points to /support when the user is logged in.
+        view = self.makeTemplateView('main_only')
+        view._user = self.user
+        content = BeautifulSoup(view())
+        footer = find_tag_by_id(content, 'footer')
+        link = footer.find('a', text='Contact Launchpad Support').parent
+        self.assertEqual('/support', link['href'])
+
+    def test_contact_support_anonymous(self):
+        # The support link points to /feedback when the user is anonymous.
+        view = self.makeTemplateView('main_only')
+        view._user = None
+        content = BeautifulSoup(view())
+        footer = find_tag_by_id(content, 'footer')
+        link = footer.find('a', text='Contact Launchpad Support').parent
+        self.assertEqual('/feedback', link['href'])

=== modified file 'lib/lp/app/browser/tests/test_launchpadroot.py'
--- lib/lp/app/browser/tests/test_launchpadroot.py	2010-08-20 20:31:18 +0000
+++ lib/lp/app/browser/tests/test_launchpadroot.py	2010-09-29 14:06:47 +0000
@@ -22,6 +22,7 @@
     login_person,
     TestCaseWithFactory,
     )
+from lp.testing.publication import test_traverse
 from lp.testing.views import (
     create_initialized_view,
     create_view,
@@ -81,3 +82,29 @@
         self.failUnless(
             content.find('a', href='+featuredprojects'),
             "Cannot find the +featuredprojects link on the first page")
+
+
+class TestLaunchpadRootNavigation(TestCaseWithFactory):
+    """Test for the LaunchpadRootNavigation."""
+
+    layer = DatabaseFunctionalLayer
+
+    def test_support(self):
+        # The /support link redirects to answers.
+        context, view, request = test_traverse(
+            'http://launchpad.dev/support')
+        view()
+        self.assertEqual(301, request.response.getStatus())
+        self.assertEqual(
+            'http://answers.launchpad.dev/launchpad',
+            request.response.getHeader('location'))
+
+    def test_feedback(self):
+        # The /feedback link redirects to the help site.
+        context, view, request = test_traverse(
+            'http://launchpad.dev/feedback')
+        view()
+        self.assertEqual(301, request.response.getStatus())
+        self.assertEqual(
+            'https://help.launchpad.net/Feedback',
+            request.response.getHeader('location'))

=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt	2010-09-21 04:21:16 +0000
+++ lib/lp/app/templates/base-layout-macros.pt	2010-09-29 14:06:47 +0000
@@ -415,8 +415,10 @@
       &nbsp;&bull;&nbsp;
       <a tal:attributes="href string:${rooturl}legal">Terms of use</a>
       &nbsp;&bull;&nbsp;
-      <a href="https://help.launchpad.net/Feedback";
-        >Contact Launchpad Support</a>
+      <a tal:condition="not: view/user|nothing"
+        href="/feedback">Contact Launchpad Support</a>
+      <a tal:condition="view/user|nothing"
+        href="/support">Contact Launchpad Support</a>
       &nbsp;&bull;&nbsp;
       <a href="http://identi.ca/launchpadstatus";
         >System status</a>

=== modified file 'lib/lp/bugs/templates/bugtarget-macros-filebug.pt'
--- lib/lp/bugs/templates/bugtarget-macros-filebug.pt	2010-08-24 20:11:37 +0000
+++ lib/lp/bugs/templates/bugtarget-macros-filebug.pt	2010-09-29 14:06:47 +0000
@@ -219,7 +219,7 @@
           </tal:has-bugtracker>
           <tal:XXX condition="nothing">
             XXX: Gavin Panella 2009-09-14 bug=429354:
-            Asking people to use feedback@xxxxxxxxxxxxx is not
+            Asking people to use answers is not
             ideal. We could instead link project owners to the +edit
             page and provide the +contactuser form for everyone else
             to contact the owner.
@@ -228,8 +228,8 @@
             <p class="warning message">
               Launchpad doesn't know what bug tracker <span
               tal:replace="product_or_distro/displayname">Alsa
-              Utils</span> uses. Do you know? <a href="mailto:
-              feedback@xxxxxxxxxxxxx">Tell us about it.</a>
+              Utils</span> uses. Do you know?
+              <a href="/support">Tell us about it.</a>
             </p>
           </tal:not-has-bugtracker>
         </tal:defines>

=== modified file 'lib/lp/bugs/templates/bugwatch-error-help.pt'
--- lib/lp/bugs/templates/bugwatch-error-help.pt	2010-07-15 08:21:40 +0000
+++ lib/lp/bugs/templates/bugwatch-error-help.pt	2010-09-29 14:06:47 +0000
@@ -1,4 +1,5 @@
-<html>
+<html
+  xmlns:tal="http://xml.zope.org/namespaces/tal";>
   <head>
     <title>Bug watch errors</title>
     <link rel="stylesheet" type="text/css"
@@ -23,7 +24,7 @@
     </p>
     <h3>How can I help fix it?</h3>
     <p>
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>Contact us</a> and let us
+      <a href="/support">Contact us</a> and let us
       know about the problem.
     </p>
     <a name="BUG_NOT_FOUND"></a>
@@ -51,8 +52,8 @@
     <p>
       Check that the remote bug tracker
       (<a tal:replace="structure watch/bugtracker/fmt:external-link" />)
-      is on-line. If it is, you should 
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>contact us</a> and let us
+      is on-line. If it is, you should
+      <a href="/support">contact us</a> and let us
       know about the problem.
     </p>
     <a name="INVALID_BUG_ID"></a>
@@ -64,7 +65,7 @@
     </p>
     <h3>How can I help fix it?</h3>
     <p>
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>Contact us</a> and let us
+      <a href="/support">Contact us</a> and let us
       know about the problem.
     </p>
     <a name="TIMEOUT"></a>
@@ -76,14 +77,14 @@
     </p>
     <h3>How can I help fix it?</h3>
     <p>
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>Contact us</a> and let us
+      <a href="/support">Contact us</a> and let us
       know about the problem.
     </p>
     <p>
       Check that the remote bug tracker
       (<a tal:replace="structure watch/bugtracker/fmt:external-link" />)
       is on-line. If it is, you should
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>contact us</a> and let us
+      <a href="/support">contact us</a> and let us
       know about the problem.
     </p>
     <a name="UNPARSABLE_BUG"></a>
@@ -101,7 +102,7 @@
     </p>
     <p>
       If the error has occurred more than once, you should
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>contact us</a> and let us
+      <a href="/support">contact us</a> and let us
       know about the problem.
     </p>
     <a name="UNPARSABLE_BUG_TRACKER"></a>
@@ -113,7 +114,7 @@
     </p>
     <h3>How can I help fix it?</h3>
     <p>
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>Contact us</a> and let us
+      <a href="/support">Contact us</a> and let us
       know about the problem.
     </p>
     <a name="UNSUPPORTED_BUG_TRACKER"></a>
@@ -152,7 +153,7 @@
     </p>
     <h3>How can I help fix it?</h3>
     <p>
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>Contact us</a> and let us
+      <a href="/support">Contact us</a> and let us
       know about the problem.
     </p>
     <a name="COMMENT_PUSH_FAILED"></a>
@@ -165,7 +166,7 @@
     </p>
     <h3>How can I help fix it?</h3>
     <p>
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>Contact us</a> and let us
+      <a href="/support">Contact us</a> and let us
       know about the problem.
     </p>
     <a name="BACKLINK_FAILED"></a>
@@ -178,7 +179,7 @@
     </p>
     <h3>How can I help fix it?</h3>
     <p>
-      <a href="mailto:feedback@xxxxxxxxxxxxx";>Contact us</a> and let us
+      <a href="/support">Contact us</a> and let us
       know about the problem.
     </p>
   </body>