← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wallyworld/launchpad/bug-disclosure-terminology-cleanup into lp:launchpad

 

Ian Booth has proposed merging lp:~wallyworld/launchpad/bug-disclosure-terminology-cleanup into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #993575 in Launchpad itself: "What is "artefact" in Bug information type"
  https://bugs.launchpad.net/launchpad/+bug/993575
  Bug #997129 in Launchpad itself: "bug privacy portlet does not explain the information type"
  https://bugs.launchpad.net/launchpad/+bug/997129
  Bug #997637 in Launchpad itself: "Bug status and importance descriptions are too wordy"
  https://bugs.launchpad.net/launchpad/+bug/997637

For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/bug-disclosure-terminology-cleanup/+merge/105918

== Implementation ==

This branch does some polishing of the disclosure UI on the bug page:
1. InformationType, BugTaskStatus, BugTaskImportance descriptions are re-worded.
2. InformationType description is displayed in the privacy portlet.
3. Choice source popup overlay is correctly sized (no longer too wide)
4. Fix styling of description text for bug information type popup

== Demo and QA ==

Some screenshots
http://people.canonical.com/~ianb/change-info-type-popup.png 
http://people.canonical.com/~ianb/privacy-portlet.png

== Tests ==

I updated the yui test for the information type choice popup. It needed a little love. There was a fair bit of lint plus the test didn't setup/teardown properly and there were missing dependencies.

The change in enum wording might cause some doc tests for fail. ec2 will catch those.

== Lint ==

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/app/javascript/choiceedit/assets/choiceedit-core.css
  lib/lp/app/javascript/overlay/assets/skins/sam/pretty-overlay-skin.css
  lib/lp/bugs/browser/bug.py
  lib/lp/bugs/interfaces/bugtask.py
  lib/lp/bugs/javascript/information_type_choice.js
  lib/lp/bugs/javascript/tests/test_information_type_choice.html
  lib/lp/bugs/javascript/tests/test_information_type_choice.js
  lib/lp/bugs/templates/bug-portlet-privacy.pt
  lib/lp/registry/enums.py
-- 
https://code.launchpad.net/~wallyworld/launchpad/bug-disclosure-terminology-cleanup/+merge/105918
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wallyworld/launchpad/bug-disclosure-terminology-cleanup into lp:launchpad.
=== modified file 'lib/lp/app/javascript/choiceedit/assets/choiceedit-core.css'
--- lib/lp/app/javascript/choiceedit/assets/choiceedit-core.css	2012-02-15 11:41:30 +0000
+++ lib/lp/app/javascript/choiceedit/assets/choiceedit-core.css	2012-05-16 02:29:19 +0000
@@ -1,3 +1,6 @@
+.yui3-ichoicelist {
+   min-width: 15%;
+}
 .yui3-ichoicelist span.disabled {
   color: #ccc;
 }
@@ -26,6 +29,7 @@
 .yui3-ichoicelist li a, .yui3-ichoicelist li span{
   padding: 6px 3px;
   display: block;
+  white-space: nowrap;
 }
 .yui3-ichoicelist li a:hover {
   background-color: #eee;

=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py	2012-05-14 07:03:49 +0000
+++ lib/lp/bugs/browser/bug.py	2012-05-16 02:29:19 +0000
@@ -540,7 +540,9 @@
         cache = IJSONRequestCache(self.request)
         cache.objects['information_types'] = [
             {'value': term.value, 'description': term.description,
-            'name': term.title} for term in InformationTypeVocabulary()]
+            'name': term.title,
+            'description_css_class': 'choice-description'}
+            for term in InformationTypeVocabulary()]
         cache.objects['private_types'] = [
             type.title for type in PRIVATE_INFORMATION_TYPES]
         cache.objects['show_information_type_in_ui'] = (
@@ -840,7 +842,7 @@
         self.updateBugFromData(data)
 
 
-# XXX: This can move to using LaunchpadEditFormView when 
+# XXX: This can move to using LaunchpadEditFormView when
 # show_information_type_in_ui is removed.
 class BugSecrecyEditView(LaunchpadFormView, BugSubscriptionPortletDetails):
     """Form for marking a bug as a private/public."""

=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
--- lib/lp/bugs/interfaces/bugtask.py	2012-05-10 13:13:05 +0000
+++ lib/lp/bugs/interfaces/bugtask.py	2012-05-16 02:29:19 +0000
@@ -144,40 +144,37 @@
     CRITICAL = DBItem(50, """
         Critical
 
-        This bug must be fixed as soon as possible.
+        Fix now or as soon as possible.
         """)
 
     HIGH = DBItem(40, """
         High
 
-        This bug is important, but doesn't need to be done immediately. It
-        should be scheduled for work soon.
+        Schedule to be fixed soon.
         """)
 
     MEDIUM = DBItem(30, """
         Medium
 
-        This bug should be fixed, but can wait until more serious bugs have
-        been dealt with.
+        Fix when convenient, or schedule to fix later.
         """)
 
     LOW = DBItem(20, """
         Low
 
-        This is a minor bug and can be fixed when it's convenient. For
-        example, it might be a typo.
+        Fix when convenient.
         """)
 
     WISHLIST = DBItem(10, """
         Wishlist
 
-        This is not a bug. It's a request for an enhancement or new feature.
+        Not a bug. It's an enhancement/new feature.
         """)
 
     UNDECIDED = DBItem(5, """
         Undecided
 
-        This bug's importance has not yet been decided.
+        Not decided yet. Maybe needs more discussion.
         """)
 
 
@@ -190,7 +187,7 @@
     NEW = DBItem(10, """
         New
 
-        This is a new bug. It hasn't been looked at yet.
+        Not looked at yet.
         """)
 
     # INCOMPLETE is never actually stored now: INCOMPLETE_WITH_RESPONSE and
@@ -201,28 +198,25 @@
     INCOMPLETE = DBItem(15, """
         Incomplete
 
-        The reporter of this bug needs to provide more information before it
-        can be confirmed.
+        Cannot be verified, the reporter needs to give more info.
         """)
 
     OPINION = DBItem(16, """
         Opinion
 
-        The bug remains open for discussion only; there is disagreement over
-        whether the bug is relevant and whether it should be fixed.
+        Doesn't fit with the project, but can be discussed.
         """)
 
     INVALID = DBItem(17, """
         Invalid
 
-        This is not a bug. It might be a support request or spam.
+        Not a bug. May be a support request or spam.
         """)
 
     WONTFIX = DBItem(18, """
         Won't Fix
 
-        This bug will not be fixed. It doesn't mean the bug isn't valid, it
-        just doesn't fit with the project's plans.
+        Doesn't fit with the project plans, sorry.
         """)
 
     EXPIRED = DBItem(19, """
@@ -234,34 +228,31 @@
     CONFIRMED = DBItem(20, """
         Confirmed
 
-        This bug has been reviewed and verified by someone other than the
-        reporter.
+        Verified by someone other than the reporter.
         """)
 
     TRIAGED = DBItem(21, """
         Triaged
 
-        This bug has been reviewed and verified by a bug supervisor.
+        Verified by the bug supervisor.
         """)
 
     INPROGRESS = DBItem(22, """
         In Progress
 
-        The person assigned to fix this bug is working on it.
+        The assigned person is working on it.
         """)
 
     FIXCOMMITTED = DBItem(25, """
         Fix Committed
 
-        A fix for this bug has been created but is not yet available in a
-        released or deployed version of the affected software.
+        Fixed, but not available until next release.
         """)
 
     FIXRELEASED = DBItem(30, """
         Fix Released
 
-        The fix for this bug is available in a released or deployed version of
-        the affected software.
+        The fix was released.
         """)
 
     UNKNOWN = DBItem(999, """

=== modified file 'lib/lp/bugs/javascript/information_type_choice.js'
--- lib/lp/bugs/javascript/information_type_choice.js	2012-05-14 19:22:58 +0000
+++ lib/lp/bugs/javascript/information_type_choice.js	2012-05-16 02:29:19 +0000
@@ -7,6 +7,7 @@
 YUI.add('lp.bugs.information_type_choice', function(Y) {
 
 var namespace = Y.namespace('lp.bugs.information_type_choice');
+var information_type_descriptions = {};
 
 namespace.save_information_type = function(value, lp_client) {
     var error_handler = new Y.lp.client.ErrorHandler();
@@ -25,12 +26,21 @@
         LP.cache.bug.self_link, 'transitionToInformationType', config);
 };
 
+var update_information_type_description = function(value) {
+    var description = information_type_descriptions[value];
+    var desc_node = Y.one('#information-type-description');
+    if (Y.Lang.isValue(desc_node)) {
+        desc_node.set('text', description);
+    }
+};
+
 namespace.information_type_save_success = function(value) {
     var body = Y.one('body');
     var private_type = (Y.Array.indexOf(LP.cache.private_types, value) >= 0);
     var subscription_ns = Y.lp.bugs.bugtask_index.portlets.subscription;
     var privacy_banner = Y.lp.app.banner.privacy.getPrivacyBanner();
     subscription_ns.update_subscription_status();
+    update_information_type_description(value);
     if (private_type) {
         body.replaceClass('public', 'private');
         privacy_banner.show();
@@ -41,6 +51,9 @@
 };
 
 namespace.setup_information_type_choice = function(privacy_link, lp_client) {
+    Y.Array.each(LP.cache.information_types, function(info_type) {
+        information_type_descriptions[info_type.value] = info_type.description;
+    });
     var information_type = Y.one('#information-type');
     var information_type_edit = new Y.ChoiceSource({
         editicon: privacy_link,
@@ -52,6 +65,7 @@
         backgroundColor: '#FFFF99'
     });
     information_type_edit.render();
+    update_information_type_description(information_type_edit.get('value'));
     information_type_edit.on("save", function(e) {
         var value = information_type_edit.get('value');
         // This is required due to the display_userdata_as_private feature

=== modified file 'lib/lp/bugs/javascript/tests/test_information_type_choice.html'
--- lib/lp/bugs/javascript/tests/test_information_type_choice.html	2012-05-15 14:37:57 +0000
+++ lib/lp/bugs/javascript/tests/test_information_type_choice.html	2012-05-16 02:29:19 +0000
@@ -26,22 +26,38 @@
 
       <!-- Dependencies -->
       <script type="text/javascript"
+          src="../../../../../build/js/lp/app/lp.js"></script>
+      <script type="text/javascript"
           src="../../../../../build/js/lp/app/testing/mockio.js"></script>
       <script type="text/javascript"
           src="../../../../../build/js/lp/app/client.js"></script>
       <script type="text/javascript"
           src="../../../../../build/js/lp/app/extras/extras.js"></script>
       <script type="text/javascript"
+          src="../../../../../build/js/lp/app/activator/activator.js"></script>
+      <script type="text/javascript"
           src="../../../../../build/js/lp/app/anim/anim.js"></script>
       <script type="text/javascript"
           src="../../../../../build/js/lp/app/effects/effects.js"></script>
       <script type="text/javascript"
+          src="../../../../../build/js/lp/app/indicator/indicator.js"></script>
+      <script type="text/javascript"
+          src="../../../../../build/js/lp/app/inlineedit/editor.js"></script>
+      <script type="text/javascript"
           src="../../../../../build/js/lp/app/lazr/lazr.js"></script>
       <script type="text/javascript"
+          src="../../../../../build/js/lp/app/mustache.js"></script>
+      <script type="text/javascript"
           src="../../../../../build/js/lp/app/choiceedit/choiceedit.js"></script>
       <script type="text/javascript"
+          src="../../../../../build/js/lp/app/confirmationoverlay/confirmationoverlay.js"></script>
+      <script type="text/javascript"
+          src="../../../../../build/js/lp/app/formoverlay/formoverlay.js"></script>
+      <script type="text/javascript"
           src="../../../../../build/js/lp/app/overlay/overlay.js"></script>
       <script type="text/javascript"
+          src="../../../../../build/js/lp/app/picker/picker.js"></script>
+      <script type="text/javascript"
           src="../../../../../build/js/lp/app/expander.js"></script>
       <script type="text/javascript"
           src="../../../../../build/js/lp/app/errors.js"></script>
@@ -68,15 +84,20 @@
         <ul id="suites">
             <li>lp.bugs.information_type_choice.test</li>
         </ul>
-        <div id="privacy">
-            <div id="privacy-text">
-                This report contains <strong id="information-type">Public</strong> information <a class="sprite edit" id="privacy-link" href="#">edit</a>
-            </div>
-        </div>
-        <div id="current_user_subscription">
-            <span></span>
-            <a href="#" text="" class="menu-link-mute_subscription unmute"></a>
-            <a href="#" text="" class="menu-link-mute_subscription mute"></a>
-        </div>
+        <div id="fixture"></div>
+        <script type="text/x-template" id="portlet-template">
+            <div id="privacy">
+                <div id="privacy-text">
+                    This report contains <strong id="information-type">Public</strong> information
+                    <a class="sprite edit" id="privacy-link" href="#">edit</a>
+                    <div id='information-type-description'>Everyone can see this information.</div>
+                </div>
+            </div>
+            <div id="current_user_subscription">
+                <span></span>
+                <a href="#" text="" class="menu-link-mute_subscription unmute"></a>
+                <a href="#" text="" class="menu-link-mute_subscription mute"></a>
+            </div>
+        </script>
     </body>
 </html>

=== modified file 'lib/lp/bugs/javascript/tests/test_information_type_choice.js'
--- lib/lp/bugs/javascript/tests/test_information_type_choice.js	2012-05-15 14:54:06 +0000
+++ lib/lp/bugs/javascript/tests/test_information_type_choice.js	2012-05-16 02:29:19 +0000
@@ -32,17 +32,31 @@
                     ]
                 }
             };
-        },
-        tearDown: function () {},
+            this.fixture = Y.one('#fixture');
+            var portlet = Y.Node.create(
+                    Y.one('#portlet-template').getContent());
+            this.fixture.appendChild(portlet);
+
+            var lp_client = new Y.lp.client.Launchpad();
+            var privacy_link = Y.one('#privacy-link');
+            ns.setup_information_type_choice(privacy_link, lp_client);
+        },
+        tearDown: function () {
+            if (this.fixture !== null) {
+                this.fixture.empty(true);
+            }
+            delete this.fixture;
+            delete window.LP;
+        },
 
         _shim_privacy_banner: function () {
-            old_func = Y.lp.app.banner.privacy.getPrivacyBanner; 
+            var old_func = Y.lp.app.banner.privacy.getPrivacyBanner;
             Y.lp.app.banner.privacy.getPrivacyBanner = function () {
                 return {
-                    show: function () { Y.fire('test:banner:show') },
-                    hide: function () { Y.fire('test:banner:hide') }
-                } 
-            }
+                    show: function () { Y.fire('test:banner:show'); },
+                    hide: function () { Y.fire('test:banner:hide'); }
+                };
+            };
             return old_func;
         },
 
@@ -69,16 +83,19 @@
         },
 
         test_information_type_save_success_private: function() {
+            var description_node = Y.one('#information-type-description');
+            Y.Assert.areEqual('Public', description_node.get('text'));
             var old_func = this._shim_privacy_banner();
             var flag = false;
             Y.on('test:banner:show', function() {
-                flag = true; 
+                flag = true;
             });
 
             ns.information_type_save_success('Private');
             var body = Y.one('body');
             Y.Assert.isTrue(body.hasClass('private'));
             Y.Assert.isTrue(flag);
+            Y.Assert.areEqual('Private', description_node.get('text'));
             this._unshim_privacy_banner(old_func);
         },
 
@@ -86,28 +103,28 @@
             var old_func = this._shim_privacy_banner();
             var flag = false;
             Y.on('test:banner:hide', function() {
-                flag = true; 
+                flag = true;
             });
 
             ns.information_type_save_success('Public');
             var body = Y.one('body');
             Y.Assert.isTrue(body.hasClass('public'));
             Y.Assert.isTrue(flag);
+            var description_node = Y.one('#information-type-description');
+            Y.Assert.areEqual('Public', description_node.get('text'));
             this._unshim_privacy_banner(old_func);
         },
 
         test_perform_update_information_type: function() {
-            var lp_client = new Y.lp.client.Launchpad();
             var privacy_link = Y.one('#privacy-link');
-            var information_type = Y.one('#information-type');
-            ns.setup_information_type_choice(privacy_link, lp_client);
             privacy_link.simulate('click');
             var private_choice = Y.one(
                 '.yui3-ichoicelist-content a[href=#Private]');
             var orig_save_information_type = ns.save_information_type;
             var function_called = false;
             ns.save_information_type = function(value, lp_client) {
-                Y.Assert.areEqual('User Data', value); function_called = true; };
+                Y.Assert.areEqual(
+                    'User Data', value); function_called = true; };
             private_choice.simulate('click');
             Y.Assert.isTrue(function_called);
             ns.save_information_type = orig_save_information_type;

=== modified file 'lib/lp/bugs/templates/bug-portlet-privacy.pt'
--- lib/lp/bugs/templates/bug-portlet-privacy.pt	2012-04-26 09:52:17 +0000
+++ lib/lp/bugs/templates/bug-portlet-privacy.pt	2012-05-16 02:29:19 +0000
@@ -10,7 +10,9 @@
 >
   <div id="privacy-text">
     <tal:information_type tal:condition="view/show_information_type_in_ui">
-      This report contains <strong id="information-type" tal:content="view/information_type"></strong> information&nbsp;<a class="sprite edit" id="privacy-link" tal:attributes="href link/path" tal:condition="link/enabled"></a>
+      This report contains <strong id="information-type" tal:content="view/information_type"></strong> information&nbsp;
+        <a class="sprite edit" id="privacy-link" tal:attributes="href link/path" tal:condition="link/enabled"></a>
+        <div id='information-type-description' style='padding-top: 5px'>Everyone can see this information.</div>
     </tal:information_type>
     <tal:privacy tal:condition="not:view/show_information_type_in_ui">
       <div tal:condition="not:context/private" id="privacy-text">

=== modified file 'lib/lp/registry/enums.py'
--- lib/lp/registry/enums.py	2012-03-29 00:48:21 +0000
+++ lib/lp/registry/enums.py	2012-05-16 02:29:19 +0000
@@ -45,22 +45,22 @@
     EMBARGOEDSECURITY = DBItem(3, """
         Embargoed Security
 
-        Only users with permission to see the project's security related
-        artifacts can see this information.
+        Visible only to users with whom the project has shared embargoed
+        security information.
         """)
 
     USERDATA = DBItem(4, """
         User Data
 
-        Only users with permission to see the project's artifacts containing
-        user data can see this information.
+        Visible only to users with whom the project has shared information
+        containing user data.
         """)
 
     PROPRIETARY = DBItem(5, """
         Proprietary
 
-        Only users with permission to see the project's artifacts containing
-        proprietary data can see this information.
+        Visible only to users with whom the project has shared proprietary
+        information.
         """)
 
 


Follow ups