← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jcsackett/launchpad/kill-lazr-2 into lp:launchpad

 

j.c.sackett has proposed merging lp:~jcsackett/launchpad/kill-lazr-2 into lp:launchpad with lp:~jcsackett/launchpad/kill-lazr-1 as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jcsackett/launchpad/kill-lazr-2/+merge/121490

Summary
=======
This beings moving js modules that extend from lazr to now live in the new
lp.ui namespace. It is one in a continuing series of branches to kill lazr.

Preimp
======
Spoke with Richard Harding, Curtis Hovey.

Implementation
============== 
This moves lazr.picker and lazr.personpicker into lp.ui.picker-base and
lp.ui.picker-person; the namespace for both is lp.ui.picker.

Tests
=====
bin/test -vvc picker --layer=YUI

QA
==
Make sure all the pickers still work.

LoC
===
This is effectively LoC neutral branch--it's just a very careful find/replace.

Lint
====

The linter is not aware of pipes; the lint file list is huge, but the only
lint is in CSS. As our CSS is not remotely conforming to the linter's rules,
I'm electing to not touch the many many errors.
-- 
https://code.launchpad.net/~jcsackett/launchpad/kill-lazr-2/+merge/121490
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/kill-lazr-2 into lp:launchpad.
=== modified file 'lib/lp/answers/javascript/tests/test_answercontacts.js'
--- lib/lp/answers/javascript/tests/test_answercontacts.js	2011-08-15 03:42:02 +0000
+++ lib/lp/answers/javascript/tests/test_answercontacts.js	2012-08-27 20:21:23 +0000
@@ -1,4 +1,4 @@
-YUI().use('lp.testing.runner', 'test', 'console', 'node', 'lazr.picker',
+YUI().use('lp.testing.runner', 'test', 'console', 'node', 'lp.ui.picker-base',
            'lp.answers.answercontacts',
            'event', 'node-event-simulate', 'dump', function(Y) {
 

=== modified file 'lib/lp/answers/javascript/tests/test_subscribers.js'
--- lib/lp/answers/javascript/tests/test_subscribers.js	2012-07-23 17:19:26 +0000
+++ lib/lp/answers/javascript/tests/test_subscribers.js	2012-08-27 20:21:23 +0000
@@ -1,4 +1,4 @@
-YUI().use('lp.testing.runner', 'test', 'console', 'node', 'lazr.picker',
+YUI().use('lp.testing.runner', 'test', 'console', 'node', 'lp.ui.picker-base',
            'lp.answers.subscribers',
            'event', 'node-event-simulate', 'dump', function(Y) {
 

=== modified file 'lib/lp/app/javascript/picker/person_picker.js'
--- lib/lp/app/javascript/picker/person_picker.js	2012-07-02 01:43:01 +0000
+++ lib/lp/app/javascript/picker/person_picker.js	2012-08-27 20:21:23 +0000
@@ -1,17 +1,17 @@
 /* Copyright 2011 Canonical Ltd.  This software is licensed under the
  * GNU Affero General Public License version 3 (see the file LICENSE).
  *
- * @namespace Y.lazr.person-picker
- * @requires lazr.picker
+ * @namespace Y.lp.app.picker
+ * @requires lp.ui.picker-base
  */
-YUI.add('lazr.person-picker', function(Y) {
+YUI.add('lp.ui.picker-person', function(Y) {
 
-var ns = Y.namespace('lazr.picker');
+var ns = Y.namespace('lp.ui.picker');
 /*
  * Extend the picker into the PersonPicker
  */
 
-ns.PersonPicker = Y.Base.create('picker', Y.lazr.picker.Picker, [], {
+ns.PersonPicker = Y.Base.create('picker', Y.lp.ui.picker.Picker, [], {
 
     initializer: function(cfg) {
         // If the user isn't logged in, override the show_assign_me value.
@@ -45,12 +45,12 @@
                 this.new_team_widget.get('container'), false);
         }
 
-        Y.lazr.picker.Picker.prototype.hide.call(this);
+        Y.lp.ui.picker.Picker.prototype.hide.call(this);
     },
 
     show: function() {
         this.get('boundingBox').setStyle('display', 'block');
-        Y.lazr.picker.Picker.prototype.show.call(this);
+        Y.lp.ui.picker.Picker.prototype.show.call(this);
     },
 
     _update_button_text: function() {
@@ -139,7 +139,7 @@
             '</a>'].join('');
     },
     renderUI: function() {
-        Y.lazr.picker.Picker.prototype.renderUI.apply(this, arguments);
+        Y.lp.ui.picker.Picker.prototype.renderUI.apply(this, arguments);
         var extra_buttons = this.get('extra_buttons');
         var remove_button, assign_me_button, new_team_button;
 
@@ -185,4 +185,4 @@
     }
 });
 }, "0.1", {"requires": [
-    "base", "node", "lazr.picker", "lp.app.picker.team"]});
+    "base", "node", "lp.ui.picker-base", "lp.app.picker.team"]});

=== modified file 'lib/lp/app/javascript/picker/picker.js'
--- lib/lp/app/javascript/picker/picker.js	2012-08-27 20:21:23 +0000
+++ lib/lp/app/javascript/picker/picker.js	2012-08-27 20:21:23 +0000
@@ -1,13 +1,13 @@
 /* Copyright (c) 2009, Canonical Ltd. All rights reserved. */
 
-YUI.add('lazr.picker', function(Y) {
-var ns = Y.namespace('lazr.picker');
+YUI.add('lp.ui.picker-base', function(Y) {
+var ns = Y.namespace('lp.ui.picker');
 
 /**
  * Module containing the Lazr searchable picker.
  *
- * @module lazr.picker
- * @namespace lazr.picker
+ * @module lp.picker-base
+ * @namespace lp.ui.picker
  */
 
 

=== modified file 'lib/lp/app/javascript/picker/picker_patcher.js'
--- lib/lp/app/javascript/picker/picker_patcher.js	2012-07-07 14:00:30 +0000
+++ lib/lp/app/javascript/picker/picker_patcher.js	2012-08-27 20:21:23 +0000
@@ -419,9 +419,9 @@
 
     var picker = null;
     if (picker_type === 'person') {
-        picker = new Y.lazr.picker.PersonPicker(new_config);
+        picker = new Y.lp.ui.picker.PersonPicker(new_config);
     } else {
-        picker = new Y.lazr.picker.Picker(new_config);
+        picker = new Y.lp.ui.picker.Picker(new_config);
     }
     namespace.setup_vocab_picker(picker, vocabulary, config);
     return picker;
@@ -452,7 +452,7 @@
 
     picker.subscribe('validate', function(e) {
         e.preventDefault();
-        var picker_result = e.details[Y.lazr.picker.Picker.SAVE_RESULT];
+        var picker_result = e.details[Y.lp.ui.picker.Picker.SAVE_RESULT];
         // We run any validators. There may be more than one specified, in
         // which case they are chained. The picker result is only saved if all
         // validators pass. Validators are run in this order (if defined):
@@ -491,7 +491,7 @@
 
     var save_handler = function(e) {
         Y.log('Got save event.');
-        var picker_result = e.details[Y.lazr.picker.Picker.SAVE_RESULT];
+        var picker_result = e.details[Y.lp.ui.picker.Picker.SAVE_RESULT];
         user_has_searched = false;
         reset_form(picker);
         picker.hide();
@@ -655,5 +655,5 @@
 
 }, "0.1", {"requires": [
     "io", "dom", "dump", "event", "json-parse",
-    "lp.client", "lazr.activator", "lazr.picker", "lazr.person-picker"
+    "lp.client", "lazr.activator", "lp.ui.picker-base", "lp.ui.picker-person"
     ]});

=== modified file 'lib/lp/app/javascript/picker/team.js'
--- lib/lp/app/javascript/picker/team.js	2012-08-13 20:03:00 +0000
+++ lib/lp/app/javascript/picker/team.js	2012-08-27 20:21:23 +0000
@@ -1,8 +1,12 @@
 /* Copyright 2012 Canonical Ltd.  This software is licensed under the
  * GNU Affero General Public License version 3 (see the file LICENSE).
  *
- * @namespace Y.app.picker.team
- * @requires lazr.picker, lazr.person-picker
+ * @namespace Y.lp.app.picker.team
+ */
+
+/*XXX jcsackett 08-27-2012 This module and namespace should probably be
+ * renamed--it's not actually using the picker at all. It's just an overlay
+ * that I think gets used in a picker in one circumstance.
  */
 YUI.add('lp.app.picker.team', function(Y) {
 

=== modified file 'lib/lp/app/javascript/picker/tests/test_personpicker.js'
--- lib/lp/app/javascript/picker/tests/test_personpicker.js	2012-07-02 02:10:59 +0000
+++ lib/lp/app/javascript/picker/tests/test_personpicker.js	2012-08-27 20:21:23 +0000
@@ -3,7 +3,7 @@
  */
 
 YUI().use('test', 'console', 'plugin', 'node-event-simulate',
-           'lazr.picker', 'lazr.person-picker', 'lp.app.picker',
+           'lp.ui.picker-base', 'lp.ui.picker-pseron', 'lp.app.picker',
            'lp.app.picker.team', 'lp.testing.mockio', function(Y) {
 
     var Assert = Y.Assert;
@@ -408,7 +408,7 @@
             var result_published = false;
             this.picker.subscribe('save', function(e) {
                 var saved_value =
-                    e.details[Y.lazr.picker.Picker.SAVE_RESULT];
+                    e.details[Y.lp.ui.picker.Picker.SAVE_RESULT];
                 Y.Assert.areEqual('/~fred', saved_value.api_uri);
                 Y.Assert.areEqual('fred', saved_value.value);
                 result_published = true;

=== modified file 'lib/lp/app/javascript/picker/tests/test_picker.js'
--- lib/lp/app/javascript/picker/tests/test_picker.js	2012-08-27 20:21:23 +0000
+++ lib/lp/app/javascript/picker/tests/test_picker.js	2012-08-27 20:21:23 +0000
@@ -32,7 +32,7 @@
         name: 'picker_tests',
 
         setUp: function() {
-            this.picker = new Y.lazr.picker.Picker({
+            this.picker = new Y.lp.ui.picker.Picker({
                 "selected_value": 'foo',
                 "selected_value_metadata": 'foobar'
             });
@@ -43,13 +43,13 @@
         },
 
         test_library_exists: function () {
-            Y.Assert.isObject(Y.lazr.picker,
-                "Could not locate the lazr.picker module");
+            Y.Assert.isObject(Y.lp.ui.picker,
+                "Could not locate the lp.ui.picker-base module");
         },
 
         test_picker_can_be_instantiated: function() {
             Assert.isInstanceOf(
-                Y.lazr.picker.Picker, this.picker,
+                Y.lp.ui.picker.Picker, this.picker,
                 "Picker failed to be instantiated");
         },
 
@@ -288,7 +288,7 @@
             this.picker.render();
             this.picker.set('results', results);
 
-            var another_picker = new Y.lazr.picker.Picker();
+            var another_picker = new Y.lp.ui.picker.Picker();
             another_picker.render();
             another_picker.set('results', results);
 
@@ -768,7 +768,7 @@
         },
 
         test_save_does_not_clear_widget_when_clear_on_save_is_false: function () {
-            picker = new Y.lazr.picker.Picker({clear_on_save: false});
+            picker = new Y.lp.ui.picker.Picker({clear_on_save: false});
             picker.render();
 
             picker._search_input.set('value', 'foo');
@@ -789,7 +789,7 @@
         },
 
         test_cancel_event_clears_widget_when_clear_on_cancel_true: function () {
-            picker = new Y.lazr.picker.Picker({clear_on_cancel: true});
+            picker = new Y.lp.ui.picker.Picker({clear_on_cancel: true});
             picker.render();
 
             picker._search_input.set('value', 'foo');
@@ -1208,7 +1208,7 @@
         name: 'picker_with_filter',
 
         setUp: function() {
-            this.picker = new Y.lazr.picker.Picker({
+            this.picker = new Y.lp.ui.picker.Picker({
                 "selected_value": 'foo',
                 "selected_value_metadata": 'foobar',
                 "filter_options": [
@@ -1401,7 +1401,7 @@
             this.search_input = Y.Node.create(
                     '<input id="field.initval" value="foo"/>');
             Y.one(document.body).appendChild(this.search_input);
-            this.picker = new Y.lazr.picker.Picker({
+            this.picker = new Y.lp.ui.picker.Picker({
                 associated_field_id: 'field.initval'
             });
         },
@@ -1443,6 +1443,6 @@
     }));
 
 }, '0.1', {
-    'requires': ['test', 'console', 'lazr.picker', 'event',
+    'requires': ['test', 'console', 'lp.ui.picker-base', 'event',
         'node-event-simulate', 'dump']
 });

=== modified file 'lib/lp/app/javascript/picker/tests/test_picker_patcher.js'
--- lib/lp/app/javascript/picker/tests/test_picker_patcher.js	2012-06-22 05:39:58 +0000
+++ lib/lp/app/javascript/picker/tests/test_picker_patcher.js	2012-08-27 20:21:23 +0000
@@ -90,7 +90,7 @@
             var self = this;
             this.picker.subscribe('save', function(e) {
                 self.saved_picker_value =
-                     e.details[Y.lazr.picker.Picker.SAVE_RESULT].api_uri;
+                     e.details[Y.lp.ui.picker.Picker.SAVE_RESULT].api_uri;
             });
         },
 
@@ -102,7 +102,7 @@
             var self = this;
             this.picker.subscribe('save', function(e) {
                  self.saved_picker_value =
-                     e.details[Y.lazr.picker.Picker.SAVE_RESULT].api_uri;
+                     e.details[Y.lp.ui.picker.Picker.SAVE_RESULT].api_uri;
             });
         },
 
@@ -110,7 +110,7 @@
             // The picker can be instantiated.
             this.create_picker();
             Assert.isInstanceOf(
-                Y.lazr.picker.Picker, this.picker,
+                Y.lp.ui.picker.Picker, this.picker,
                 "Picker failed to be instantiated");
         },
 
@@ -641,6 +641,6 @@
     }));
 
 }, '0.1', {'requires': ['test', 'console', 'lp.app.picker', 'node',
-        'event-focus', 'event-simulate', 'lazr.picker', 'lazr.person-picker',
-        'lp.app.picker', 'node-event-simulate', 'escape', 'event',
-        'lp.testing.mockio', 'lp', 'lp.client']});
+        'event-focus', 'event-simulate', 'lp.ui.picker-base',
+        'lp.ui.picker-person', 'lp.app.picker', 'node-event-simulate',
+        'escape', 'event', 'lp.testing.mockio', 'lp', 'lp.client']});

=== modified file 'lib/lp/blueprints/javascript/tests/test_workitems.js'
--- lib/lp/blueprints/javascript/tests/test_workitems.js	2012-07-07 14:00:30 +0000
+++ lib/lp/blueprints/javascript/tests/test_workitems.js	2012-08-27 20:21:23 +0000
@@ -1,4 +1,4 @@
-YUI().use('lp.testing.runner', 'test', 'console', 'node', 'lazr.picker',
+YUI().use('lp.testing.runner', 'test', 'console', 'node', 'lp.ui.picker-base',
           'lp.workitems.expanders',
           'event', 'node-event-simulate', 'dump', function(Y) {
 

=== modified file 'lib/lp/bugs/javascript/bug_picker.js'
--- lib/lp/bugs/javascript/bug_picker.js	2012-08-14 16:19:27 +0000
+++ lib/lp/bugs/javascript/bug_picker.js	2012-08-27 20:21:23 +0000
@@ -15,7 +15,7 @@
  * This widget does no rendering itself; it is used to enhance existing HTML.
  */
 namespace.BugPicker = Y.Base.create(
-        "bugPickerWidget", Y.lazr.picker.Picker, [], {
+        "bugPickerWidget", Y.lp.ui.picker.Picker, [], {
     initializer: function(cfg) {
         this.io_provider = Y.lp.client.get_configured_io_provider(cfg);
         var that = this;
@@ -43,12 +43,12 @@
 
     hide: function() {
         this.get('boundingBox').setStyle('display', 'none');
-        Y.lazr.picker.Picker.prototype.hide.call(this);
+        Y.lp.ui.picker.Picker.prototype.hide.call(this);
     },
 
     show: function() {
         this.get('boundingBox').setStyle('display', 'block');
-        Y.lazr.picker.Picker.prototype.show.call(this);
+        Y.lp.ui.picker.Picker.prototype.show.call(this);
     },
 
     _bug_search_header: function() {
@@ -65,7 +65,7 @@
     },
 
     renderUI: function() {
-        Y.lazr.picker.Picker.prototype.renderUI.apply(this, arguments);
+        Y.lp.ui.picker.Picker.prototype.renderUI.apply(this, arguments);
         var search_header = Y.Node.create(this._bug_search_header());
         var search_node = this._search_input.get('parentNode');
         search_node.insert(search_header, 'before');
@@ -73,7 +73,7 @@
     },
 
     bindUI: function() {
-        Y.lazr.picker.Picker.prototype.bindUI.apply(this, arguments);
+        Y.lp.ui.picker.Picker.prototype.bindUI.apply(this, arguments);
         // Wire up the Remove link.
         var that = this;
         if (Y.Lang.isValue(this.remove_link)) {
@@ -378,4 +378,4 @@
 
 }, "0.1", {"requires": [
     "base", "io", "oop", "node", "event", "json",
-    "lazr.effects", "lp.mustache", "lazr.picker"]});
+    "lazr.effects", "lp.mustache", "lp.ui.picker-base"]});

=== modified file 'lib/lp/bugs/javascript/tests/test_bug_picker.js'
--- lib/lp/bugs/javascript/tests/test_bug_picker.js	2012-08-14 15:29:33 +0000
+++ lib/lp/bugs/javascript/tests/test_bug_picker.js	2012-08-27 20:21:23 +0000
@@ -246,5 +246,5 @@
     requires: [
         'test', 'lp.testing.helpers', 'event', 'node-event-simulate',
         'console', 'lp.client', 'lp.testing.mockio', 'lp.anim',
-        'lazr.picker', 'lp.bugs.bug_picker', 'lp.mustache']
+        'lp.ui.picker-base', 'lp.bugs.bug_picker', 'lp.mustache']
 });

=== modified file 'lib/lp/bugs/javascript/tests/test_subscribers.js'
--- lib/lp/bugs/javascript/tests/test_subscribers.js	2011-10-31 10:10:58 +0000
+++ lib/lp/bugs/javascript/tests/test_subscribers.js	2012-08-27 20:21:23 +0000
@@ -1,4 +1,4 @@
-YUI().use('lp.testing.runner', 'test', 'console', 'node', 'lazr.picker',
+YUI().use('lp.testing.runner', 'test', 'console', 'node', 'lp.ui.picker-base',
            'lp.bugs.subscribers',
            'event', 'node-event-simulate', 'dump', function(Y) {
 

=== modified file 'lib/lp/registry/javascript/sharing/granteepicker.js'
--- lib/lp/registry/javascript/sharing/granteepicker.js	2012-08-14 16:10:52 +0000
+++ lib/lp/registry/javascript/sharing/granteepicker.js	2012-08-27 20:21:23 +0000
@@ -33,7 +33,7 @@
 };
 
 
-Y.extend(GranteePicker, Y.lazr.picker.Picker, {
+Y.extend(GranteePicker, Y.lp.ui.picker.Picker, {
     initializer: function(config) {
         GranteePicker.superclass.initializer.apply(this, arguments);
         var information_types = [];
@@ -57,7 +57,7 @@
             if (!Y.Lang.isNumber(step_nr)) {
                 step_nr = 1;
             }
-            var data = e.details[Y.lazr.picker.Picker.SAVE_RESULT];
+            var data = e.details[Y.lp.ui.picker.Picker.SAVE_RESULT];
             switch(step_nr) {
                 case 1:
                     data.grantee_name = data.title;
@@ -369,5 +369,5 @@
 GranteePicker.NAME = 'grantee_picker';
 namespace.GranteePicker = GranteePicker;
 
-}, "0.1", { "requires": ['node', 'lp.mustache', 'lazr.picker'] });
+}, "0.1", { "requires": ['node', 'lp.mustache', 'lp.ui.picker-base'] });
 

=== modified file 'lib/lp/registry/javascript/sharing/pillarsharingview.js'
--- lib/lp/registry/javascript/sharing/pillarsharingview.js	2012-08-23 00:35:25 +0000
+++ lib/lp/registry/javascript/sharing/pillarsharingview.js	2012-08-27 20:21:23 +0000
@@ -648,7 +648,7 @@
 namespace.PillarSharingView = PillarSharingView;
 
 }, "0.1", { "requires": [
-    'node', 'selector-css3', 'lp.client', 'lp.mustache', 'lazr.picker',
+    'node', 'selector-css3', 'lp.client', 'lp.mustache', 'lp.ui.picker-base',
     'lp.app.picker', 'lp.mustache', 'lp.registry.sharing.granteepicker',
     'lp.registry.sharing.granteetable', 'lp.app.confirmationoverlay'
     ]});


Follow ups