Merge lp:~cjwatson/launchpad/eslint-remove-dead-code into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18429
Proposed branch: lp:~cjwatson/launchpad/eslint-remove-dead-code
Merge into: lp:launchpad
Diff against target: 1003 lines (+18/-186)
49 files modified
lib/lp/app/javascript/autocomplete/autocomplete.js (+0/-1)
lib/lp/app/javascript/choiceedit/choiceedit.js (+0/-1)
lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js (+2/-10)
lib/lp/app/javascript/client.js (+0/-2)
lib/lp/app/javascript/expander.js (+0/-1)
lib/lp/app/javascript/formoverlay/formoverlay.js (+0/-2)
lib/lp/app/javascript/formoverlay/tests/test_formoverlay.js (+0/-3)
lib/lp/app/javascript/indicator/tests/test_indicator.js (+0/-1)
lib/lp/app/javascript/inlineedit/editor.js (+1/-6)
lib/lp/app/javascript/inlineedit/tests/test_inline_edit.js (+0/-15)
lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js (+0/-1)
lib/lp/app/javascript/listing_navigator.js (+0/-2)
lib/lp/app/javascript/overlay/overlay.js (+1/-2)
lib/lp/app/javascript/overlay/tests/test_overlay.js (+2/-3)
lib/lp/app/javascript/picker/tests/test_picker.js (+0/-5)
lib/lp/app/javascript/subscribers/tests/test_subscribers_list.js (+0/-5)
lib/lp/app/javascript/testing/tests/test_mockio.js (+1/-2)
lib/lp/app/javascript/tests/test_comment.js (+1/-5)
lib/lp/app/javascript/tests/test_information_type.js (+0/-4)
lib/lp/app/javascript/tests/test_listing_navigator.js (+0/-1)
lib/lp/app/javascript/tests/test_longpoll.js (+0/-1)
lib/lp/blueprints/javascript/tests/test_workitems.js (+0/-2)
lib/lp/bugs/javascript/bugtask_index.js (+0/-3)
lib/lp/bugs/javascript/bugtracker_overlay.js (+0/-1)
lib/lp/bugs/javascript/duplicates.js (+0/-1)
lib/lp/bugs/javascript/filebug_dupefinder.js (+0/-22)
lib/lp/bugs/javascript/tests/test_async_comment_loading.js (+1/-3)
lib/lp/bugs/javascript/tests/test_duplicates.js (+0/-1)
lib/lp/bugs/javascript/tests/test_me_too.js (+2/-3)
lib/lp/bugs/javascript/tests/test_official_bug_tags.js (+0/-1)
lib/lp/bugs/javascript/tests/test_subscription.js (+0/-16)
lib/lp/code/javascript/branch.information_type_choice.js (+0/-1)
lib/lp/code/javascript/productseries-setbranch.js (+0/-1)
lib/lp/code/javascript/tests/test_bugspeclinks.js (+0/-4)
lib/lp/registry/javascript/distroseries/differences.js (+1/-2)
lib/lp/registry/javascript/distroseries/tests/test_initseries.js (+0/-1)
lib/lp/registry/javascript/product_views.js (+0/-1)
lib/lp/registry/javascript/sharing/granteetable.js (+0/-1)
lib/lp/registry/javascript/sharing/tests/test_pillarsharingview.js (+0/-1)
lib/lp/registry/javascript/sharing/tests/test_sharingdetailsview.js (+0/-3)
lib/lp/registry/javascript/structural-subscription.js (+0/-3)
lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js (+0/-5)
lib/lp/registry/javascript/tests/test_milestone_creation.js (+1/-4)
lib/lp/registry/javascript/tests/test_structural_subscription.js (+0/-18)
lib/lp/registry/javascript/tests/test_team_mailinglists.js (+2/-4)
lib/lp/registry/javascript/timeline.js (+0/-2)
lib/lp/soyuz/javascript/tests/test_archive-packages.html (+1/-1)
lib/lp/soyuz/javascript/tests/test_archive-packages.js (+2/-4)
lib/lp/translations/javascript/sourcepackage_sharing_details.js (+0/-4)
To merge this branch: bzr merge lp:~cjwatson/launchpad/eslint-remove-dead-code
Reviewer Review Type Date Requested Status
William Grant Approve
Review via email: mp+327892@code.launchpad.net

Commit message

Remove lots of dead JavaScript code spotted by ESLint.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/app/javascript/autocomplete/autocomplete.js'
--- lib/lp/app/javascript/autocomplete/autocomplete.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/autocomplete/autocomplete.js 2017-07-21 16:50:14 +0000
@@ -428,7 +428,6 @@
428 // is indexed by the start of the match.428 // is indexed by the start of the match.
429429
430 var midx;430 var midx;
431 var match_key;
432 var match_string;431 var match_string;
433 var start_indicies = [];432 var start_indicies = [];
434433
435434
=== modified file 'lib/lp/app/javascript/choiceedit/choiceedit.js'
--- lib/lp/app/javascript/choiceedit/choiceedit.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/choiceedit/choiceedit.js 2017-07-21 16:50:14 +0000
@@ -20,7 +20,6 @@
20 C_NULLTEXTLOCATION = 'nulltext',20 C_NULLTEXTLOCATION = 'nulltext',
21 C_ADDICON = 'addicon',21 C_ADDICON = 'addicon',
22 SAVE = 'save',22 SAVE = 'save',
23 LEFT_MOUSE_BUTTON = 1,
24 RENDERUI = "renderUI",23 RENDERUI = "renderUI",
25 BINDUI = "bindUI",24 BINDUI = "bindUI",
26 SYNCUI = "syncUI",25 SYNCUI = "syncUI",
2726
=== modified file 'lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js'
--- lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js 2013-04-09 07:20:39 +0000
+++ lib/lp/app/javascript/choiceedit/tests/test_choiceedit.js 2017-07-21 16:50:14 +0000
@@ -5,9 +5,8 @@
5 var tests = Y.namespace('lp.choiceedit.test');5 var tests = Y.namespace('lp.choiceedit.test');
6 tests.suite = new Y.Test.Suite('choiceedit tests');6 tests.suite = new Y.Test.Suite('choiceedit tests');
77
8 // Local aliases8 // Local alias.
9 var Assert = Y.Assert,9 var Assert = Y.Assert;
10 ArrayAssert = Y.ArrayAssert;
1110
12 /*11 /*
13 * A wrapper for the Y.Event.simulate() function. The wrapper accepts12 * A wrapper for the Y.Event.simulate() function. The wrapper accepts
@@ -172,7 +171,6 @@
172171
173 test_choicelist_html_has_disabled: function() {172 test_choicelist_html_has_disabled: function() {
174 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');173 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
175 var configcount = this.config.items.length;
176 var choicelist_lis = Y.one(document).all(".yui3-ichoicelist li");174 var choicelist_lis = Y.one(document).all(".yui3-ichoicelist li");
177 // confirm that disabled LIs are disabled175 // confirm that disabled LIs are disabled
178 var that = this;176 var that = this;
@@ -193,7 +191,6 @@
193191
194 test_choicelist_html_has_current: function() {192 test_choicelist_html_has_current: function() {
195 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');193 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
196 var configcount = this.config.items.length;
197 var choicelist_lis = Y.one(document).all(".yui3-ichoicelist li");194 var choicelist_lis = Y.one(document).all(".yui3-ichoicelist li");
198 // confirm that current value has an LI with current style195 // confirm that current value has an LI with current style
199 var that = this;196 var that = this;
@@ -221,7 +218,6 @@
221218
222 test_clicking_choicelist_item_fires_signal: function() {219 test_clicking_choicelist_item_fires_signal: function() {
223 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');220 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
224 var that = this;
225 var fired = false;221 var fired = false;
226 this.choice_edit._choice_list.on("valueChosen", function() {222 this.choice_edit._choice_list.on("valueChosen", function() {
227 fired = true;223 fired = true;
@@ -236,7 +232,6 @@
236232
237 test_clicking_choicelist_item_does_green_flash: function() {233 test_clicking_choicelist_item_does_green_flash: function() {
238 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');234 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
239 var that = this;
240 var green_flash = Y.lp.anim.green_flash;235 var green_flash = Y.lp.anim.green_flash;
241 var flashed = false;236 var flashed = false;
242 Y.lp.anim.green_flash = function() {237 Y.lp.anim.green_flash = function() {
@@ -381,7 +376,6 @@
381376
382 test_choicelist_html_has_current: function() {377 test_choicelist_html_has_current: function() {
383 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');378 simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
384 var configcount = this.config.items.length;
385 var choicelist_lis = Y.one(document)379 var choicelist_lis = Y.one(document)
386 .all(".yui3-ichoicelist li");380 .all(".yui3-ichoicelist li");
387381
@@ -481,8 +475,6 @@
481 },475 },
482476
483 test_action_icon: function() {477 test_action_icon: function() {
484 var that = this;
485
486 Assert.areEqual(478 Assert.areEqual(
487 this.null_choice_edit.get('actionicon'),479 this.null_choice_edit.get('actionicon'),
488 this.null_choice_edit.get('addicon'),480 this.null_choice_edit.get('addicon'),
489481
=== modified file 'lib/lp/app/javascript/client.js'
--- lib/lp/app/javascript/client.js 2017-07-20 13:29:41 +0000
+++ lib/lp/app/javascript/client.js 2017-07-21 16:50:14 +0000
@@ -610,7 +610,6 @@
610 this.lp_client = client;610 this.lp_client = client;
611 this.uri = uri;611 this.uri = uri;
612 this.dirty_attributes = [];612 this.dirty_attributes = [];
613 var entry = this;
614613
615 // Copy the representation keys into our own set of attributes, and add614 // Copy the representation keys into our own set of attributes, and add
616 // an attribute-change event listener for caching purposes.615 // an attribute-change event listener for caching purposes.
@@ -1106,7 +1105,6 @@
1106 // widget in a clean state.1105 // widget in a clean state.
1107 this.doBefore("_saveData", this.doPATCH);1106 this.doBefore("_saveData", this.doPATCH);
11081107
1109 var self = this;
1110 this.error_handler = new Y.lp.client.ErrorHandler();1108 this.error_handler = new Y.lp.client.ErrorHandler();
1111 this.error_handler.clearProgressUI = function () {1109 this.error_handler.clearProgressUI = function () {
1112 config.host._uiClearWaiting();1110 config.host._uiClearWaiting();
11131111
=== modified file 'lib/lp/app/javascript/expander.js'
--- lib/lp/app/javascript/expander.js 2017-07-20 13:29:41 +0000
+++ lib/lp/app/javascript/expander.js 2017-07-21 16:50:14 +0000
@@ -255,7 +255,6 @@
255 */255 */
256 foldContentNode: function(expand, no_animation) {256 foldContentNode: function(expand, no_animation) {
257 var expander = this;257 var expander = this;
258 var has_paused = false;
259 if (no_animation === true || Y.Lang.isUndefined(this._animation)) {258 if (no_animation === true || Y.Lang.isUndefined(this._animation)) {
260 // Make the animation have the proper direction set from259 // Make the animation have the proper direction set from
261 // the start.260 // the start.
262261
=== modified file 'lib/lp/app/javascript/formoverlay/formoverlay.js'
--- lib/lp/app/javascript/formoverlay/formoverlay.js 2014-01-30 15:04:06 +0000
+++ lib/lp/app/javascript/formoverlay/formoverlay.js 2017-07-21 16:50:14 +0000
@@ -18,7 +18,6 @@
18var ns = Y.namespace("lp.ui");18var ns = Y.namespace("lp.ui");
19var getCN = Y.ClassNameManager.getClassName,19var getCN = Y.ClassNameManager.getClassName,
20 NAME = 'lazr-formoverlay',20 NAME = 'lazr-formoverlay',
21 CONTENT_BOX = 'contentBox',
22 RENDERUI = "renderUI",21 RENDERUI = "renderUI",
23 BINDUI = "bindUI";22 BINDUI = "bindUI";
2423
@@ -470,7 +469,6 @@
470 var select_idx;469 var select_idx;
471 var num_options;470 var num_options;
472 var option;471 var option;
473 var option_value;
474472
475 // Iterate over the form elements collection to construct the473 // Iterate over the form elements collection to construct the
476 // label-value pairs.474 // label-value pairs.
477475
=== modified file 'lib/lp/app/javascript/formoverlay/tests/test_formoverlay.js'
--- lib/lp/app/javascript/formoverlay/tests/test_formoverlay.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/formoverlay/tests/test_formoverlay.js 2017-07-21 16:50:14 +0000
@@ -109,7 +109,6 @@
109 this.form_overlay.hide();109 this.form_overlay.hide();
110 first_input.blur();110 first_input.blur();
111111
112 var test = this;
113 var focused = false;112 var focused = false;
114113
115 var onFocus = function(e) {114 var onFocus = function(e) {
@@ -366,7 +365,6 @@
366 });365 });
367366
368 var event_was_propagated = false;367 var event_was_propagated = false;
369 var test = this;
370 var onSubmit = function(e) {368 var onSubmit = function(e) {
371 event_was_propagated = true;369 event_was_propagated = true;
372 e.preventDefault();370 e.preventDefault();
@@ -389,7 +387,6 @@
389 });387 });
390388
391 var event_was_propagated = false;389 var event_was_propagated = false;
392 var test = this;
393 var onSubmit = function(e) {390 var onSubmit = function(e) {
394 event_was_propagated = true;391 event_was_propagated = true;
395 e.preventDefault();392 e.preventDefault();
396393
=== modified file 'lib/lp/app/javascript/indicator/tests/test_indicator.js'
--- lib/lp/app/javascript/indicator/tests/test_indicator.js 2017-01-13 13:32:06 +0000
+++ lib/lp/app/javascript/indicator/tests/test_indicator.js 2017-07-21 16:50:14 +0000
@@ -66,7 +66,6 @@
66 });66 });
67 this.indicator.render();67 this.indicator.render();
68 var content = this.indicator.get('boundingBox');68 var content = this.indicator.get('boundingBox');
69 var test = content.getContent();
70 var img = content.one('img');69 var img = content.one('img');
71 Assert.areEqual('file:///@@/spinner-big', img.get('src'));70 Assert.areEqual('file:///@@/spinner-big', img.get('src'));
72 },71 },
7372
=== modified file 'lib/lp/app/javascript/inlineedit/editor.js'
--- lib/lp/app/javascript/inlineedit/editor.js 2013-12-12 04:47:30 +0000
+++ lib/lp/app/javascript/inlineedit/editor.js 2017-07-21 16:50:14 +0000
@@ -63,11 +63,7 @@
63 C_ERROR_HIDDEN = getCN(EDITOR, 'errors', HIDDEN),63 C_ERROR_HIDDEN = getCN(EDITOR, 'errors', HIDDEN),
6464
65 SAVE = 'save',65 SAVE = 'save',
66 CANCEL = 'cancel',66 CANCEL = 'cancel';
67 SHRINK = 'shrink';
68
69// To strip the 'px' unit suffix off widget sizes.
70var strip_px = /px$/;
7167
72var InlineEditor = function() {68var InlineEditor = function() {
73 InlineEditor.superclass.constructor.apply(this, arguments);69 InlineEditor.superclass.constructor.apply(this, arguments);
@@ -723,7 +719,6 @@
723719
724 // hook up the resizing textarea to handle those changes720 // hook up the resizing textarea to handle those changes
725 var cfg = this.cfg;721 var cfg = this.cfg;
726 var input = this.get(INPUT_EL);
727 var that = this;722 var that = this;
728723
729 if (!this.get(MULTILINE)) {724 if (!this.get(MULTILINE)) {
730725
=== modified file 'lib/lp/app/javascript/inlineedit/tests/test_inline_edit.js'
--- lib/lp/app/javascript/inlineedit/tests/test_inline_edit.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/inlineedit/tests/test_inline_edit.js 2017-07-21 16:50:14 +0000
@@ -26,19 +26,6 @@
26 ].join('');26 ].join('');
2727
2828
29 /* Helper to stamp a Node with an ID attribute. Needed for YUI 2.X
30 * testing, which is heavily ID-based.
31 *
32 * Returns the node's 'id' attribute.
33 */
34 function id_for(node) {
35 if (!node.getAttribute('id')) {
36 var id = Y.stamp(node);
37 node.setAttribute('id', id);
38 }
39 return node.getAttribute('id');
40 }
41
42 /*29 /*
43 * A wrapper for the Y.Event.simulate() function. The wrapper accepts30 * A wrapper for the Y.Event.simulate() function. The wrapper accepts
44 * CSS selectors and Node instances instead of raw nodes.31 * CSS selectors and Node instances instead of raw nodes.
@@ -290,7 +277,6 @@
290 this.editor.render();277 this.editor.render();
291278
292 var input = this.editor.get('input_field'),279 var input = this.editor.get('input_field'),
293 test = this,
294 focused = false;280 focused = false;
295281
296 Y.on('focus', function() {282 Y.on('focus', function() {
@@ -323,7 +309,6 @@
323 // empty string.309 // empty string.
324 input.set('value', '');310 input.set('value', '');
325311
326 var test = this;
327 // Add our focus event listener.312 // Add our focus event listener.
328 Y.on('focus', function() {313 Y.on('focus', function() {
329 got_focus = true;314 got_focus = true;
330315
=== modified file 'lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js'
--- lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/inlinehelp/tests/test_inlinehelp.js 2017-07-21 16:50:14 +0000
@@ -5,7 +5,6 @@
55
6 var tests = Y.namespace('lp.app.inlinehelp.test');6 var tests = Y.namespace('lp.app.inlinehelp.test');
7 tests.suite = new Y.Test.Suite('InlineHelp Tests');7 tests.suite = new Y.Test.Suite('InlineHelp Tests');
8 var Assert = Y.Assert;
9 tests.suite.add(new Y.Test.Case({8 tests.suite.add(new Y.Test.Case({
10 name: 'inlinehelp.init_help',9 name: 'inlinehelp.init_help',
1110
1211
=== modified file 'lib/lp/app/javascript/listing_navigator.js'
--- lib/lp/app/javascript/listing_navigator.js 2012-09-12 01:45:17 +0000
+++ lib/lp/app/javascript/listing_navigator.js 2017-07-21 16:50:14 +0000
@@ -181,8 +181,6 @@
181 */181 */
182 default_history_changed: function(e) {182 default_history_changed: function(e) {
183 if (e.newVal.hasOwnProperty('batch_key')) {183 if (e.newVal.hasOwnProperty('batch_key')) {
184 var batch_key = e.newVal.batch_key;
185 var batch = this.get('batches')[batch_key];
186 this.pre_fetch_batches();184 this.pre_fetch_batches();
187 this.render();185 this.render();
188 this._bindUI();186 this._bindUI();
189187
=== modified file 'lib/lp/app/javascript/overlay/overlay.js'
--- lib/lp/app/javascript/overlay/overlay.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/overlay/overlay.js 2017-07-21 16:50:14 +0000
@@ -11,8 +11,7 @@
1111
12var ns = Y.namespace('lp.ui');12var ns = Y.namespace('lp.ui');
1313
14var ESCAPE = 27,14var TAB = 9,
15 TAB = 9,
16 CANCEL = 'cancel',15 CANCEL = 'cancel',
17 BOUNDING_BOX = 'boundingBox',16 BOUNDING_BOX = 'boundingBox',
18 CONTENT_BOX = 'contentBox',17 CONTENT_BOX = 'contentBox',
1918
=== modified file 'lib/lp/app/javascript/overlay/tests/test_overlay.js'
--- lib/lp/app/javascript/overlay/tests/test_overlay.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/overlay/tests/test_overlay.js 2017-07-21 16:50:14 +0000
@@ -9,9 +9,8 @@
9 // KeyCode for escape9 // KeyCode for escape
10 var ESCAPE = 27;10 var ESCAPE = 27;
1111
12 // Local aliases12 // Local alias.
13 var Assert = Y.Assert,13 var Assert = Y.Assert;
14 ArrayAssert = Y.ArrayAssert;
1514
16 /*15 /*
17 * A wrapper for the Y.Event.simulate() function. The wrapper accepts16 * A wrapper for the Y.Event.simulate() function. The wrapper accepts
1817
=== modified file 'lib/lp/app/javascript/picker/tests/test_picker.js'
--- lib/lp/app/javascript/picker/tests/test_picker.js 2014-05-19 11:33:05 +0000
+++ lib/lp/app/javascript/picker/tests/test_picker.js 2017-07-21 16:50:14 +0000
@@ -456,7 +456,6 @@
456456
457 test_results_updates_display_with_missing_data: function () {457 test_results_updates_display_with_missing_data: function () {
458 this.picker.render();458 this.picker.render();
459 var image_url = '../../ui/assets/skins/sam/search.png';
460 this.picker.set('results', [459 this.picker.set('results', [
461 { value: 'jschmo', title: 'Joe Schmo' }460 { value: 'jschmo', title: 'Joe Schmo' }
462 ]);461 ]);
@@ -942,7 +941,6 @@
942 ]);941 ]);
943 this.picker.render();942 this.picker.render();
944943
945 var bb = this.picker.get('boundingBox');
946 var event_has_fired = false;944 var event_has_fired = false;
947 this.picker.subscribe('search', function(e) {945 this.picker.subscribe('search', function(e) {
948 event_has_fired = true;946 event_has_fired = true;
@@ -965,7 +963,6 @@
965 ]);963 ]);
966 this.picker.render();964 this.picker.render();
967965
968 var bb = this.picker.get('boundingBox');
969 Assert.areEqual(966 Assert.areEqual(
970 0, this.picker.get('selected_batch'),967 0, this.picker.get('selected_batch'),
971 "First batch should be selected.");968 "First batch should be selected.");
@@ -1065,7 +1062,6 @@
1065 this.picker.set('selected_batch', 1);1062 this.picker.set('selected_batch', 1);
1066 this.picker.render();1063 this.picker.render();
10671064
1068 var bb = this.picker.get('boundingBox');
1069 simulate(1065 simulate(
1070 this.picker.get('boundingBox'), '.lazr-next.lazr-btn', 'click');1066 this.picker.get('boundingBox'), '.lazr-next.lazr-btn', 'click');
1071 Assert.areEqual(1067 Assert.areEqual(
@@ -1104,7 +1100,6 @@
1104 this.picker.set('selected_batch', 1);1100 this.picker.set('selected_batch', 1);
1105 this.picker.render();1101 this.picker.render();
11061102
1107 var bb = this.picker.get('boundingBox');
1108 simulate(1103 simulate(
1109 this.picker.get('boundingBox'), '.lazr-prev.lazr-btn', 'click');1104 this.picker.get('boundingBox'), '.lazr-prev.lazr-btn', 'click');
1110 Assert.areEqual(1105 Assert.areEqual(
11111106
=== modified file 'lib/lp/app/javascript/subscribers/tests/test_subscribers_list.js'
--- lib/lp/app/javascript/subscribers/tests/test_subscribers_list.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/subscribers/tests/test_subscribers_list.js 2017-07-21 16:50:14 +0000
@@ -1799,11 +1799,6 @@
1799 test_loadSubscribers_failure: function() {1799 test_loadSubscribers_failure: function() {
1800 // On failure to load, activity indication is set to an error1800 // On failure to load, activity indication is set to an error
1801 // message received from the server.1801 // message received from the server.
1802 var details = [
1803 { subscriber: { name: "subscriber" },
1804 subscription_level: 'Level3' }
1805 ];
1806
1807 var loader = setUpLoader(this.root);1802 var loader = setUpLoader(this.root);
18081803
1809 // Mock lp_client for testing erroring out with 'BOOM'.1804 // Mock lp_client for testing erroring out with 'BOOM'.
18101805
=== modified file 'lib/lp/app/javascript/testing/tests/test_mockio.js'
--- lib/lp/app/javascript/testing/tests/test_mockio.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/testing/tests/test_mockio.js 2017-07-21 16:50:14 +0000
@@ -121,8 +121,7 @@
121 var mockio = this._make_mockio();121 var mockio = this._make_mockio();
122 var response = new Y.lp.testing.mockio.MockHttpResponse();122 var response = new Y.lp.testing.mockio.MockHttpResponse();
123 var expected_header_key = "X-My-Header",123 var expected_header_key = "X-My-Header",
124 expected_header_val = "MyHeaderValue",124 expected_header_val = "MyHeaderValue";
125 response_headers = {};
126 response.setResponseHeader(125 response.setResponseHeader(
127 expected_header_key,126 expected_header_key,
128 expected_header_val);127 expected_header_val);
129128
=== modified file 'lib/lp/app/javascript/tests/test_comment.js'
--- lib/lp/app/javascript/tests/test_comment.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/tests/test_comment.js 2017-07-21 16:50:14 +0000
@@ -52,17 +52,13 @@
52 var comment = this._get_mocked_comment();52 var comment = this._get_mocked_comment();
53 var progress_ui_called = false;53 var progress_ui_called = false;
54 var post_comment_called = false;54 var post_comment_called = false;
55 var extra_call_called = false;
56 comment.activateProgressUI = function () {55 comment.activateProgressUI = function () {
57 progress_ui_called = true;56 progress_ui_called = true;
58 };57 };
59 comment.post_comment = function () {58 comment.post_comment = function () {
60 post_comment_called = true;59 post_comment_called = true;
61 };60 };
62 comment._add_comment_success = function () {61 comment.validate = function () { return true; };
63 extra_call_called = true;
64 };
65 comment.validate = function () { return true };
66 var mock_event = { halt: function () {} };62 var mock_event = { halt: function () {} };
6763
68 comment.add_comment(mock_event);64 comment.add_comment(mock_event);
6965
=== modified file 'lib/lp/app/javascript/tests/test_information_type.js'
--- lib/lp/app/javascript/tests/test_information_type.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/tests/test_information_type.js 2017-07-21 16:50:14 +0000
@@ -130,10 +130,6 @@
130 // A successful save updates the subscribers portlet.130 // A successful save updates the subscribers portlet.
131 test_save_success_with_subscribers_data: function() {131 test_save_success_with_subscribers_data: function() {
132 this.makeWidget();132 this.makeWidget();
133 var flag = false;
134 Y.on('test:banner:hide', function() {
135 flag = true;
136 });
137 var summary = Y.one('#information-type-summary');133 var summary = Y.one('#information-type-summary');
138 summary.replaceClass('public', 'private');134 summary.replaceClass('public', 'private');
139135
140136
=== modified file 'lib/lp/app/javascript/tests/test_listing_navigator.js'
--- lib/lp/app/javascript/tests/test_listing_navigator.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/tests/test_listing_navigator.js 2017-07-21 16:50:14 +0000
@@ -723,7 +723,6 @@
723 * batch if Navigator.get('pre_fetch') is false.723 * batch if Navigator.get('pre_fetch') is false.
724 */724 */
725 test_pre_fetch_disabled: function() {725 test_pre_fetch_disabled: function() {
726 var last_url;
727 var navigator = this.get_pre_fetch_navigator({target: this.target});726 var navigator = this.get_pre_fetch_navigator({target: this.target});
728 navigator.pre_fetch_batches();727 navigator.pre_fetch_batches();
729 Y.Assert.areSame(null, navigator.get('io_provider').last_request);728 Y.Assert.areSame(null, navigator.get('io_provider').last_request);
730729
=== modified file 'lib/lp/app/javascript/tests/test_longpoll.js'
--- lib/lp/app/javascript/tests/test_longpoll.js 2013-03-20 03:41:40 +0000
+++ lib/lp/app/javascript/tests/test_longpoll.js 2017-07-21 16:50:14 +0000
@@ -3,7 +3,6 @@
3YUI.add('lp.longpoll.test', function (Y) {3YUI.add('lp.longpoll.test', function (Y) {
4 var longpoll = Y.lp.app.longpoll;4 var longpoll = Y.lp.app.longpoll;
55
6 var suite = new Y.Test.Suite("longpoll Tests");
7 var tests = Y.namespace('lp.longpoll.test');6 var tests = Y.namespace('lp.longpoll.test');
8 tests.suite = new Y.Test.Suite('longpoll Tests');7 tests.suite = new Y.Test.Suite('longpoll Tests');
98
109
=== modified file 'lib/lp/blueprints/javascript/tests/test_workitems.js'
--- lib/lp/blueprints/javascript/tests/test_workitems.js 2012-10-26 10:00:20 +0000
+++ lib/lp/blueprints/javascript/tests/test_workitems.js 2017-07-21 16:50:14 +0000
@@ -29,7 +29,6 @@
29 _all_expanders_are_closed: function(){29 _all_expanders_are_closed: function(){
30 var found_open = false;30 var found_open = false;
31 Y.all('.collapsible-body').each(function(e) {31 Y.all('.collapsible-body').each(function(e) {
32 found_collapsible_body = true;
33 if (!e.hasClass('hidden'))32 if (!e.hasClass('hidden'))
34 {33 {
35 found_open = true;34 found_open = true;
@@ -42,7 +41,6 @@
42 _all_expanders_are_open: function(){41 _all_expanders_are_open: function(){
43 var found_closed = false;42 var found_closed = false;
44 Y.all('.collapsible-body').each(function(e) {43 Y.all('.collapsible-body').each(function(e) {
45 found_collapsible_body = true;
46 if (e.hasClass('hidden'))44 if (e.hasClass('hidden'))
47 {45 {
48 found_closed = true;46 found_closed = true;
4947
=== modified file 'lib/lp/bugs/javascript/bugtask_index.js'
--- lib/lp/bugs/javascript/bugtask_index.js 2012-11-12 13:45:58 +0000
+++ lib/lp/bugs/javascript/bugtask_index.js 2017-07-21 16:50:14 +0000
@@ -1004,9 +1004,6 @@
1004namespace.load_more_comments = function(batched_comments_url,1004namespace.load_more_comments = function(batched_comments_url,
1005 comments_container,1005 comments_container,
1006 io_provider) {1006 io_provider) {
1007 var spinner = Y.Node.create(
1008 '<img src="/@@/spinner" style="text_align: center; ' +
1009 'display: none" />');
1010 var spinner_span = Y.one('#more-comments-spinner');1007 var spinner_span = Y.one('#more-comments-spinner');
1011 spinner_span.setStyle('display', 'inline');1008 spinner_span.setStyle('display', 'inline');
1012 var handlers = {1009 var handlers = {
10131010
=== modified file 'lib/lp/bugs/javascript/bugtracker_overlay.js'
--- lib/lp/bugs/javascript/bugtracker_overlay.js 2012-09-10 18:44:11 +0000
+++ lib/lp/bugs/javascript/bugtracker_overlay.js 2017-07-21 16:50:14 +0000
@@ -38,7 +38,6 @@
38 on: {38 on: {
39 success: finish_new_bugtracker,39 success: finish_new_bugtracker,
40 failure: function (ignore, response, args) {40 failure: function (ignore, response, args) {
41 var error_box = Y.one('#bugtracker-error');
42 var error_message = response.statusText + '\n\n' +41 var error_message = response.statusText + '\n\n' +
43 response.responseText;42 response.responseText;
44 bugtracker_form.showError(error_message);43 bugtracker_form.showError(error_message);
4544
=== modified file 'lib/lp/bugs/javascript/duplicates.js'
--- lib/lp/bugs/javascript/duplicates.js 2013-04-09 05:05:39 +0000
+++ lib/lp/bugs/javascript/duplicates.js 2017-07-21 16:50:14 +0000
@@ -322,7 +322,6 @@
322 * @private322 * @private
323 */323 */
324 _submit_bug: function(new_dup_id, new_dupe_title, widget) {324 _submit_bug: function(new_dup_id, new_dupe_title, widget) {
325 var dupe_span = this.get('dupe_span');
326 var new_dup_url = null;325 var new_dup_url = null;
327326
328 var qs;327 var qs;
329328
=== modified file 'lib/lp/bugs/javascript/filebug_dupefinder.js'
--- lib/lp/bugs/javascript/filebug_dupefinder.js 2012-09-10 20:52:27 +0000
+++ lib/lp/bugs/javascript/filebug_dupefinder.js 2017-07-21 16:50:14 +0000
@@ -10,11 +10,8 @@
1010
11var BLOCK = 'block',11var BLOCK = 'block',
12 DISPLAY = 'display',12 DISPLAY = 'display',
13 EXPANDER_COLLAPSED = '/@@/treeCollapsed',
14 EXPANDER_EXPANDED = '/@@/treeExpanded',
15 INNER_HTML = 'innerHTML',13 INNER_HTML = 'innerHTML',
16 NONE = 'none',14 NONE = 'none',
17 SRC = 'src',
18 HIDDEN = 'hidden';15 HIDDEN = 'hidden';
1916
20var namespace = Y.namespace('lp.bugs.filebug_dupefinder');17var namespace = Y.namespace('lp.bugs.filebug_dupefinder');
@@ -56,25 +53,6 @@
56 '<button type="button" name="field.actions.cancel">Choose Again</button>';53 '<button type="button" name="field.actions.cancel">Choose Again</button>';
5754
58/**55/**
59 * Return the relevant duplicate-details div for a bug-already-reported
60 * expander.
61 * @param expander The expander for which to return the relevant div.
62 */
63function get_details_div(expander) {
64 var details_div = expander.get(
65 'parentNode').get('parentNode').one('.duplicate-details');
66
67 // Check that the details_div actually exists and raise an error if
68 // we can't find it.
69 if (!Y.Lang.isValue(details_div)) {
70 Y.fail(
71 "Unable to find details div for expander " + expander.get('id'));
72 } else {
73 return details_div;
74 }
75}
76
77/**
78 * Show the bug reporting form and collapse all bug details forms.56 * Show the bug reporting form and collapse all bug details forms.
79 */57 */
80function show_bug_reporting_form() {58function show_bug_reporting_form() {
8159
=== modified file 'lib/lp/bugs/javascript/tests/test_async_comment_loading.js'
--- lib/lp/bugs/javascript/tests/test_async_comment_loading.js 2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_async_comment_loading.js 2017-07-21 16:50:14 +0000
@@ -4,10 +4,8 @@
4YUI.add('lp.bugs.async_comments.test', function (Y) {4YUI.add('lp.bugs.async_comments.test', function (Y) {
55
6 // Local aliases.6 // Local aliases.
7 var Assert = Y.Assert,7 var Assert = Y.Assert;
8 ArrayAssert = Y.ArrayAssert;
9 var module = Y.lp.bugs.bugtask_index;8 var module = Y.lp.bugs.bugtask_index;
10 var suite = new Y.Test.Suite("Async comment loading tests");
119
12 var comments_markup =10 var comments_markup =
13 "<div>This is a comment</div>" +11 "<div>This is a comment</div>" +
1412
=== modified file 'lib/lp/bugs/javascript/tests/test_duplicates.js'
--- lib/lp/bugs/javascript/tests/test_duplicates.js 2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_duplicates.js 2017-07-21 16:50:14 +0000
@@ -187,7 +187,6 @@
187 test_picker_form_submission_failure: function() {187 test_picker_form_submission_failure: function() {
188 this.widget = this._createWidget(false);188 this.widget = this._createWidget(false);
189 this._assert_dupe_submission(3);189 this._assert_dupe_submission(3);
190 var failure_called = false;
191 this.mockio.respond({190 this.mockio.respond({
192 status: 400,191 status: 400,
193 responseText:192 responseText:
194193
=== modified file 'lib/lp/bugs/javascript/tests/test_me_too.js'
--- lib/lp/bugs/javascript/tests/test_me_too.js 2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_me_too.js 2017-07-21 16:50:14 +0000
@@ -2,9 +2,8 @@
2 * GNU Affero General Public License version 3 (see the file LICENSE). */2 * GNU Affero General Public License version 3 (see the file LICENSE). */
33
4YUI.add('lp.bugs.bugtask_index.test_me_too', function (Y) {4YUI.add('lp.bugs.bugtask_index.test_me_too', function (Y) {
5 // Local aliases5 // Local alias.
6 var Assert = Y.Assert,6 var Assert = Y.Assert;
7 ArrayAssert = Y.ArrayAssert;
87
9 /*8 /*
10 * A wrapper for the Y.Event.simulate() function. The wrapper accepts9 * A wrapper for the Y.Event.simulate() function. The wrapper accepts
1110
=== modified file 'lib/lp/bugs/javascript/tests/test_official_bug_tags.js'
--- lib/lp/bugs/javascript/tests/test_official_bug_tags.js 2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_official_bug_tags.js 2017-07-21 16:50:14 +0000
@@ -42,7 +42,6 @@
42 new_tag_button.simulate('click');42 new_tag_button.simulate('click');
43 var message_overlay = Y.one('.official-tag-error-message');43 var message_overlay = Y.one('.official-tag-error-message');
44 Y.Assert.isNotNull(message_overlay);44 Y.Assert.isNotNull(message_overlay);
45 var tag = message_overlay.one(".official-tag-error-message-value");
46 Y.Assert.isTrue(message_overlay.get('text').indexOf('me!') !== -1);45 Y.Assert.isTrue(message_overlay.get('text').indexOf('me!') !== -1);
47 }46 }
48 }));47 }));
4948
=== modified file 'lib/lp/bugs/javascript/tests/test_subscription.js'
--- lib/lp/bugs/javascript/tests/test_subscription.js 2013-03-20 03:41:40 +0000
+++ lib/lp/bugs/javascript/tests/test_subscription.js 2017-07-21 16:50:14 +0000
@@ -2680,14 +2680,6 @@
2680 };2680 };
2681 module.show_subscription_description(this.config);2681 module.show_subscription_description(this.config);
2682 // Simulated return values from the named_post call.2682 // Simulated return values from the named_post call.
2683 var sub = {
2684 bug: {
2685 'private': false,
2686 security_related: false
2687 },
2688 principal_is_reporter: false,
2689 subscription: {bug_notification_level: 'Details'}
2690 };
2691 module._lp_client.named_post.args = [];2683 module._lp_client.named_post.args = [];
2692 // Before clicking on the link the direct2684 // Before clicking on the link the direct
2693 // subscription count is 3.2685 // subscription count is 3.
@@ -2713,14 +2705,6 @@
2713 };2705 };
2714 module.show_subscription_description(this.config);2706 module.show_subscription_description(this.config);
2715 // Simulated return values from the named_post call.2707 // Simulated return values from the named_post call.
2716 var sub = {
2717 bug: {
2718 'private': false,
2719 security_related: false
2720 },
2721 principal_is_reporter: false,
2722 subscription: {bug_notification_level: 'Details'}
2723 };
2724 module._lp_client.named_post.args = [];2708 module._lp_client.named_post.args = [];
2725 // Before clicking on the link the direct subscription count2709 // Before clicking on the link the direct subscription count
2726 // is 3.2710 // is 3.
27272711
=== modified file 'lib/lp/code/javascript/branch.information_type_choice.js'
--- lib/lp/code/javascript/branch.information_type_choice.js 2015-06-04 17:13:54 +0000
+++ lib/lp/code/javascript/branch.information_type_choice.js 2017-07-21 16:50:14 +0000
@@ -8,7 +8,6 @@
88
9var namespace = Y.namespace('lp.code.branch.information_type_choice');9var namespace = Y.namespace('lp.code.branch.information_type_choice');
10var information_type = Y.namespace('lp.app.information_type');10var information_type = Y.namespace('lp.app.information_type');
11var superclass = Y.Widget;
1211
13namespace.BranchInformationTypeWidget = Y.Base.create(12namespace.BranchInformationTypeWidget = Y.Base.create(
14 "branchInformationTypeWidget", Y.Widget, [], {13 "branchInformationTypeWidget", Y.Widget, [], {
1514
=== modified file 'lib/lp/code/javascript/productseries-setbranch.js'
--- lib/lp/code/javascript/productseries-setbranch.js 2016-11-11 14:22:40 +0000
+++ lib/lp/code/javascript/productseries-setbranch.js 2017-07-21 16:50:14 +0000
@@ -79,7 +79,6 @@
79 module.onclick_rcs_type = function(e) {79 module.onclick_rcs_type = function(e) {
80 /* Which rcs type radio button has been selected? */80 /* Which rcs type radio button has been selected? */
81 // CVS81 // CVS
82 var rcs_types = module._rcs_types();
83 var selectedRCS = module._get_selected_rcs();82 var selectedRCS = module._get_selected_rcs();
84 module.set_enabled('field.cvs_module', selectedRCS === 'CVS');83 module.set_enabled('field.cvs_module', selectedRCS === 'CVS');
85 };84 };
8685
=== modified file 'lib/lp/code/javascript/tests/test_bugspeclinks.js'
--- lib/lp/code/javascript/tests/test_bugspeclinks.js 2017-04-24 14:23:36 +0000
+++ lib/lp/code/javascript/tests/test_bugspeclinks.js 2017-07-21 16:50:14 +0000
@@ -224,10 +224,6 @@
224 // The link bug success function works as expected.224 // The link bug success function works as expected.
225 test_link_bug_success: function() {225 test_link_bug_success: function() {
226 this.widget = this._createWidget();226 this.widget = this._createWidget();
227 var data = {
228 self_link: 'api/devel/bugs/1'};
229 var new_bug_entry = new Y.lp.client.Entry(
230 this.lp_client, data, data.self_link);
231 var link_html = '<div id="buglink-3"></div>';227 var link_html = '<div id="buglink-3"></div>';
232 this.widget._link_bug_success(3, link_html);228 this.widget._link_bug_success(3, link_html);
233 Y.Assert.areEqual(229 Y.Assert.areEqual(
234230
=== modified file 'lib/lp/registry/javascript/distroseries/differences.js'
--- lib/lp/registry/javascript/distroseries/differences.js 2012-09-10 18:44:11 +0000
+++ lib/lp/registry/javascript/distroseries/differences.js 2017-07-21 16:50:14 +0000
@@ -14,7 +14,6 @@
1414
15var namespace = Y.namespace('lp.registry.distroseries.differences'),15var namespace = Y.namespace('lp.registry.distroseries.differences'),
16 testspace = Y.namespace('lp.registry.distroseries.differences.test'),16 testspace = Y.namespace('lp.registry.distroseries.differences.test'),
17 formwidgets = Y.lp.app.formwidgets,
18 widgets = Y.lp.registry.distroseries.widgets;17 widgets = Y.lp.registry.distroseries.widgets;
1918
20var PACKAGESET_FIELD = "field.packageset",19var PACKAGESET_FIELD = "field.packageset",
@@ -287,6 +286,6 @@
287286
288287
289}, "0.1", {"requires": [288}, "0.1", {"requires": [
290 "lp.ui.formoverlay", "lp.app.formwidgets",289 "lp.ui.formoverlay",
291 "lp.app.picker", "lp.registry.distroseries.widgets",290 "lp.app.picker", "lp.registry.distroseries.widgets",
292 "node", "querystring-parse"]});291 "node", "querystring-parse"]});
293292
=== modified file 'lib/lp/registry/javascript/distroseries/tests/test_initseries.js'
--- lib/lp/registry/javascript/distroseries/tests/test_initseries.js 2014-07-21 22:45:01 +0000
+++ lib/lp/registry/javascript/distroseries/tests/test_initseries.js 2017-07-21 16:50:14 +0000
@@ -18,7 +18,6 @@
1818
19 var suite = new Y.Test.Suite("distroseries.initseries Tests");19 var suite = new Y.Test.Suite("distroseries.initseries Tests");
20 var initseries = Y.lp.registry.distroseries.initseries;20 var initseries = Y.lp.registry.distroseries.initseries;
21 var widgets = Y.lp.registry.distroseries.widgets;
2221
23 var testDeriveDistroSeriesActionsWidget = {22 var testDeriveDistroSeriesActionsWidget = {
24 name: 'TestDeriveDistroSeriesActionsWidget',23 name: 'TestDeriveDistroSeriesActionsWidget',
2524
=== modified file 'lib/lp/registry/javascript/product_views.js'
--- lib/lp/registry/javascript/product_views.js 2015-10-01 17:32:41 +0000
+++ lib/lp/registry/javascript/product_views.js 2017-07-21 16:50:14 +0000
@@ -168,7 +168,6 @@
168 // Additional spice for the insanity stew is given by the168 // Additional spice for the insanity stew is given by the
169 // rhino book, page 428. This code is basically a rip and169 // rhino book, page 428. This code is basically a rip and
170 // remix of those two texts.170 // remix of those two texts.
171 var event = e || window.event;
172 var code = e.charCode || e.keyCode;171 var code = e.charCode || e.keyCode;
173172
174 if (/* Check for special characters. */173 if (/* Check for special characters. */
175174
=== modified file 'lib/lp/registry/javascript/sharing/granteetable.js'
--- lib/lp/registry/javascript/sharing/granteetable.js 2013-04-19 02:35:16 +0000
+++ lib/lp/registry/javascript/sharing/granteetable.js 2017-07-21 16:50:14 +0000
@@ -408,7 +408,6 @@
408 return false;408 return false;
409 }409 }
410 Y.some(right, function(sharing_value, info_type) {410 Y.some(right, function(sharing_value, info_type) {
411 var _value = left[info_type];
412 if (!Y.Lang.isValue(left[info_type])) {411 if (!Y.Lang.isValue(left[info_type])) {
413 result = false;412 result = false;
414 return true;413 return true;
415414
=== modified file 'lib/lp/registry/javascript/sharing/tests/test_pillarsharingview.js'
--- lib/lp/registry/javascript/sharing/tests/test_pillarsharingview.js 2015-10-22 00:13:43 +0000
+++ lib/lp/registry/javascript/sharing/tests/test_pillarsharingview.js 2017-07-21 16:50:14 +0000
@@ -252,7 +252,6 @@
252 this.view = this._create_Widget();252 this.view = this._create_Widget();
253 this.view.render();253 this.view.render();
254 var remove_grantee_success_called = false;254 var remove_grantee_success_called = false;
255 var self = this;
256 this.view.remove_grantee_success = function(person_uri) {255 this.view.remove_grantee_success = function(person_uri) {
257 Y.Assert.areEqual('~fred', person_uri);256 Y.Assert.areEqual('~fred', person_uri);
258 remove_grantee_success_called = true;257 remove_grantee_success_called = true;
259258
=== modified file 'lib/lp/registry/javascript/sharing/tests/test_sharingdetailsview.js'
--- lib/lp/registry/javascript/sharing/tests/test_sharingdetailsview.js 2015-10-22 00:13:43 +0000
+++ lib/lp/registry/javascript/sharing/tests/test_sharingdetailsview.js 2017-07-21 16:50:14 +0000
@@ -239,7 +239,6 @@
239 });239 });
240 this.view.render();240 this.view.render();
241 var remove_grant_success_called = false;241 var remove_grant_success_called = false;
242 var self = this;
243 this.view.remove_grant_success = function(artifact_uri) {242 this.view.remove_grant_success = function(artifact_uri) {
244 Y.Assert.areEqual('api/devel/bugs/2', artifact_uri);243 Y.Assert.areEqual('api/devel/bugs/2', artifact_uri);
245 remove_grant_success_called = true;244 remove_grant_success_called = true;
@@ -277,7 +276,6 @@
277 });276 });
278 this.view.render();277 this.view.render();
279 var remove_grant_success_called = false;278 var remove_grant_success_called = false;
280 var self = this;
281 this.view.remove_grant_success = function(artifact_uri) {279 this.view.remove_grant_success = function(artifact_uri) {
282 Y.Assert.areEqual(280 Y.Assert.areEqual(
283 'api/devel/~someone/+junk/somebranch', artifact_uri);281 'api/devel/~someone/+junk/somebranch', artifact_uri);
@@ -316,7 +314,6 @@
316 });314 });
317 this.view.render();315 this.view.render();
318 var remove_grant_success_called = false;316 var remove_grant_success_called = false;
319 var self = this;
320 this.view.remove_grant_success = function(artifact_uri) {317 this.view.remove_grant_success = function(artifact_uri) {
321 Y.Assert.areEqual(318 Y.Assert.areEqual(
322 'api/devel/~someone/+git/somerepo', artifact_uri);319 'api/devel/~someone/+git/somerepo', artifact_uri);
323320
=== modified file 'lib/lp/registry/javascript/structural-subscription.js'
--- lib/lp/registry/javascript/structural-subscription.js 2012-12-13 17:16:39 +0000
+++ lib/lp/registry/javascript/structural-subscription.js 2017-07-21 16:50:14 +0000
@@ -311,7 +311,6 @@
311function edit_subscription_handler(context, form_data) {311function edit_subscription_handler(context, form_data) {
312 var has_errors = check_for_errors_in_overlay(312 var has_errors = check_for_errors_in_overlay(
313 namespace._add_subscription_overlay);313 namespace._add_subscription_overlay);
314 var filter_id = '#filter-description-'+context.filter_id.toString();
315 var filter_node = Y.one(314 var filter_node = Y.one(
316 '#subscription-filter-'+context.filter_id.toString());315 '#subscription-filter-'+context.filter_id.toString());
317 var submit_button = namespace._add_subscription_overlay.bodyNode.one(316 var submit_button = namespace._add_subscription_overlay.bodyNode.one(
@@ -321,7 +320,6 @@
321 }320 }
322 var on = {success: function (new_data) {321 var on = {success: function (new_data) {
323 submit_button.replaceClass('spinner', 'lazr-pos');322 submit_button.replaceClass('spinner', 'lazr-pos');
324 var description_node = Y.one(filter_id);
325 var filter = new_data.getAttrs();323 var filter = new_data.getAttrs();
326 fill_filter_description(324 fill_filter_description(
327 filter_node, context.filter_info, filter);325 filter_node, context.filter_info, filter);
@@ -1336,7 +1334,6 @@
1336 * Attach activation (click) handlers to all of the edit links on the page.1334 * Attach activation (click) handlers to all of the edit links on the page.
1337 */1335 */
1338function wire_up_edit_links(config) {1336function wire_up_edit_links(config) {
1339 var listing = Y.one(config.content_box);
1340 var subscription_info = LP.cache.subscription_info;1337 var subscription_info = LP.cache.subscription_info;
1341 var filter_id = 0;1338 var filter_id = 0;
1342 var i;1339 var i;
13431340
=== modified file 'lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js'
--- lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js 2013-04-09 05:05:39 +0000
+++ lib/lp/registry/javascript/tests/test_distroseriesdifferences_details.js 2017-07-21 16:50:14 +0000
@@ -657,7 +657,6 @@
657 },657 },
658658
659 test_clean: function() {659 test_clean: function() {
660 var that = this;
661 var comment_text = 'Content';660 var comment_text = 'Content';
662 this.widget.get('srcNode').one('textarea').set('value', comment_text);661 this.widget.get('srcNode').one('textarea').set('value', comment_text);
663 var comment_entry = new Comment();662 var comment_entry = new Comment();
@@ -779,10 +778,8 @@
779778
780 test_add_comment_handler_empty: function() {779 test_add_comment_handler_empty: function() {
781 // An empty comment is treated as a mistake.780 // An empty comment is treated as a mistake.
782 var that = this;
783 var comment_text = '';781 var comment_text = '';
784 this.widget.get('srcNode').one('textarea').set('value', comment_text);782 this.widget.get('srcNode').one('textarea').set('value', comment_text);
785 var comment_entry = new Comment();
786 var post_called = false;783 var post_called = false;
787 module.lp_client.named_post = function(url, method, config) {784 module.lp_client.named_post = function(url, method, config) {
788 post_called = true;785 post_called = true;
@@ -840,9 +837,7 @@
840 .addClass('FAILED');837 .addClass('FAILED');
841 module.setup_packages_diff_states(838 module.setup_packages_diff_states(
842 placeholder.one('.diff-extra-container'), dsd_uri);839 placeholder.one('.diff-extra-container'), dsd_uri);
843 var func_req;
844 module.lp_client.named_post = function(url, func, config) {840 module.lp_client.named_post = function(url, func, config) {
845 func_req = func;
846 config.on.success();841 config.on.success();
847 };842 };
848 var wrong_button = placeholder.one('.package-diff-placeholder');843 var wrong_button = placeholder.one('.package-diff-placeholder');
849844
=== modified file 'lib/lp/registry/javascript/tests/test_milestone_creation.js'
--- lib/lp/registry/javascript/tests/test_milestone_creation.js 2013-04-08 08:06:09 +0000
+++ lib/lp/registry/javascript/tests/test_milestone_creation.js 2017-07-21 16:50:14 +0000
@@ -44,7 +44,6 @@
44 test_configure: function() {44 test_configure: function() {
45 // Ensure configuring the module works as it will be needed in45 // Ensure configuring the module works as it will be needed in
46 // subsequent tests.46 // subsequent tests.
47 var client = new Y.lp.client.Launchpad({sync: true});
48 var config = {47 var config = {
49 milestone_form_uri: 'a',48 milestone_form_uri: 'a',
50 series_uri: 'b',49 series_uri: 'b',
@@ -68,7 +67,6 @@
68 var data = serverfixture.setup(this, 'setup');67 var data = serverfixture.setup(this, 'setup');
6968
70 // Initialize the milestoneoverlay module.69 // Initialize the milestoneoverlay module.
71 var milestone_table = Y.lp.registry.milestonetable;
72 var client = new Y.lp.client.Launchpad({sync: true});70 var client = new Y.lp.client.Launchpad({sync: true});
73 var config = {71 var config = {
74 milestone_form_uri: data.milestone_form_uri,72 milestone_form_uri: data.milestone_form_uri,
@@ -119,7 +117,6 @@
119 var data = serverfixture.setup(this, 'setup');117 var data = serverfixture.setup(this, 'setup');
120118
121 // Initialize the milestoneoverlay module.119 // Initialize the milestoneoverlay module.
122 var milestone_table = Y.lp.registry.milestonetable;
123 var client = new Y.lp.client.Launchpad({sync: true});120 var client = new Y.lp.client.Launchpad({sync: true});
124 var config = {121 var config = {
125 milestone_form_uri: data.milestone_form_uri,122 milestone_form_uri: data.milestone_form_uri,
@@ -170,6 +167,6 @@
170}, '0.1', {167}, '0.1', {
171 requires: [168 requires: [
172 'test', 'lp.client', 'lp.testing.serverfixture',169 'test', 'lp.client', 'lp.testing.serverfixture',
173 'lp.registry.milestonetable', 'lp.registry.milestoneoverlay']170 'lp.registry.milestoneoverlay']
174});171});
175172
176173
=== modified file 'lib/lp/registry/javascript/tests/test_structural_subscription.js'
--- lib/lp/registry/javascript/tests/test_structural_subscription.js 2013-03-20 03:41:40 +0000
+++ lib/lp/registry/javascript/tests/test_structural_subscription.js 2017-07-21 16:50:14 +0000
@@ -17,23 +17,6 @@
17 var content_box_name = 'ss-content-box';17 var content_box_name = 'ss-content-box';
18 var content_box_id = '#' + content_box_name;18 var content_box_id = '#' + content_box_name;
1919
20 var target_link_class = '.menu-link-subscribe_to_bug_mail';
21
22 function array_compare(a,b) {
23 if (a.length !== b.length) {
24 return false;
25 }
26 a.sort();
27 b.sort();
28 var i;
29 for (i=0; i<a.length; i++) {
30 if (a[i] !== b[i]) {
31 return false;
32 }
33 }
34 return true;
35 }
36
37 function create_test_node() {20 function create_test_node() {
38 var test_node = Y.Node.create('<div id="test-content">')21 var test_node = Y.Node.create('<div id="test-content">')
39 .append(Y.Node.create('<div></div>')22 .append(Y.Node.create('<div></div>')
@@ -386,7 +369,6 @@
386 // Long titles are cut down.369 // Long titles are cut down.
387 module.setup(this.configuration);370 module.setup(this.configuration);
388 module._show_add_overlay(this.configuration);371 module._show_add_overlay(this.configuration);
389 overlay = Y.one('#accordion-overlay');
390 // This is the title we would expect if there were no shortening.372 // This is the title we would expect if there were no shortening.
391 var header = Y.one(content_box_id).one('h2').get('text');373 var header = Y.one(content_box_id).one('h2').get('text');
392 // The actual title is a prefix of the unabridged title.374 // The actual title is a prefix of the unabridged title.
393375
=== modified file 'lib/lp/registry/javascript/tests/test_team_mailinglists.js'
--- lib/lp/registry/javascript/tests/test_team_mailinglists.js 2013-03-20 03:41:40 +0000
+++ lib/lp/registry/javascript/tests/test_team_mailinglists.js 2017-07-21 16:50:14 +0000
@@ -2,10 +2,8 @@
2 * GNU Affero General Public License version 3 (see the file LICENSE). */2 * GNU Affero General Public License version 3 (see the file LICENSE). */
33
4YUI.add('lp.registry.team.mailinglists.test', function (Y) {4YUI.add('lp.registry.team.mailinglists.test', function (Y) {
5 // Local aliases.5 // Local alias.
6 var Assert = Y.Assert,6 var Assert = Y.Assert;
7 ArrayAssert = Y.ArrayAssert;
8 var team_mailinglists = Y.lp.registry.team.mailinglists;
97
10 var tests = Y.namespace('lp.registry.team.mailinglists.test');8 var tests = Y.namespace('lp.registry.team.mailinglists.test');
11 tests.suite = new Y.Test.Suite('lp.registry.team.mailinglists Tests');9 tests.suite = new Y.Test.Suite('lp.registry.team.mailinglists Tests');
1210
=== modified file 'lib/lp/registry/javascript/timeline.js'
--- lib/lp/registry/javascript/timeline.js 2012-05-12 02:36:41 +0000
+++ lib/lp/registry/javascript/timeline.js 2017-07-21 16:50:14 +0000
@@ -576,7 +576,6 @@
576 var series_line = this.project_line.series_lines[0];576 var series_line = this.project_line.series_lines[0];
577 var landmark = series_line.series.landmarks[0];577 var landmark = series_line.series.landmarks[0];
578 if (landmark) {578 if (landmark) {
579 var landmark_label = series_line.labels[landmark.name];
580 var date_label_width = 0;579 var date_label_width = 0;
581 if (series_line.series_date_label !== null) {580 if (series_line.series_date_label !== null) {
582 date_label_width =581 date_label_width =
@@ -648,7 +647,6 @@
648 // Resizing the canvas requires destroying the old canvas and647 // Resizing the canvas requires destroying the old canvas and
649 // creating a new one due to rendering issues in WebKit.648 // creating a new one due to rendering issues in WebKit.
650 this.calculate_landmark_spacing();649 this.calculate_landmark_spacing();
651 var contentBox = this.get('contentBox');
652 this.recreate_canvas();650 this.recreate_canvas();
653 var dom_canvas = Y.Node.getDOMNode(this.canvas);651 var dom_canvas = Y.Node.getDOMNode(this.canvas);
654 this.canvas_context = dom_canvas.getContext('2d');652 this.canvas_context = dom_canvas.getContext('2d');
655653
=== modified file 'lib/lp/soyuz/javascript/tests/test_archive-packages.html'
--- lib/lp/soyuz/javascript/tests/test_archive-packages.html 2012-10-26 09:54:28 +0000
+++ lib/lp/soyuz/javascript/tests/test_archive-packages.html 2017-07-21 16:50:14 +0000
@@ -59,7 +59,7 @@
59 <a class="remove-notification">Remove notification</a>59 <a class="remove-notification">Remove notification</a>
60 </div>60 </div>
61 </script>61 </script>
62 <script type="text/x-template" id="pending-job-template-no-link">62 <script type="text/x-template">
63 <div class="pending-job" job_id="3">63 <div class="pending-job" job_id="3">
64 </div>64 </div>
65 </script>65 </script>
6666
=== modified file 'lib/lp/soyuz/javascript/tests/test_archive-packages.js'
--- lib/lp/soyuz/javascript/tests/test_archive-packages.js 2012-01-06 10:15:37 +0000
+++ lib/lp/soyuz/javascript/tests/test_archive-packages.js 2017-07-21 16:50:14 +0000
@@ -16,8 +16,6 @@
16 var module = Y.lp.soyuz.archive_packages;16 var module = Y.lp.soyuz.archive_packages;
1717
18 var pending_job = Y.one('#pending-job-template').getContent();18 var pending_job = Y.one('#pending-job-template').getContent();
19 var pending_job_no_link = Y.one(
20 '#pending-job-template-no-link').getContent();
2119
22 var TestPendingCopyJobWidgetNoLink = {20 var TestPendingCopyJobWidgetNoLink = {
23 name: "TestPendingCopyJobWidgetNoLink",21 name: "TestPendingCopyJobWidgetNoLink",
@@ -28,8 +26,8 @@
28 .append(Y.Node.create(pending_job));26 .append(Y.Node.create(pending_job));
29 },27 },
3028
31 test_instanciation: function() {29 test_instantiation: function() {
32 // The widget is instanciated even without a link to delete the30 // The widget is instantiated even without a link to delete the
33 // widget's html.31 // widget's html.
34 var area = Y.one('.pending-job-no-link');32 var area = Y.one('.pending-job-no-link');
35 this.widget = new module.PendingCopyJobWidget(33 this.widget = new module.PendingCopyJobWidget(
3634
=== modified file 'lib/lp/translations/javascript/sourcepackage_sharing_details.js'
--- lib/lp/translations/javascript/sourcepackage_sharing_details.js 2012-09-10 18:44:11 +0000
+++ lib/lp/translations/javascript/sourcepackage_sharing_details.js 2017-07-21 16:50:14 +0000
@@ -217,7 +217,6 @@
217217
218218
219function IOHandler(controller, check, error_handler) {219function IOHandler(controller, check, error_handler) {
220 that = this;
221 this.check = check;220 this.check = check;
222 this.controller = controller;221 this.controller = controller;
223 if (!Y.Lang.isValue(error_handler)){222 if (!Y.Lang.isValue(error_handler)){
@@ -420,7 +419,6 @@
420 select_productseries: function(productseries_summary) {419 select_productseries: function(productseries_summary) {
421 var that = this;420 var that = this;
422 var productseries_check = that.get('tsconfig').get('product_series');421 var productseries_check = that.get('tsconfig').get('product_series');
423 var lp_client = new Y.lp.client.Launchpad();
424 function save_productseries(config) {422 function save_productseries(config) {
425 productseries_check.set('pending', true);423 productseries_check.set('pending', true);
426 that.update_check(productseries_check);424 that.update_check(productseries_check);
@@ -435,7 +433,6 @@
435 remove_productseries: function(productseries_summary) {433 remove_productseries: function(productseries_summary) {
436 var that = this;434 var that = this;
437 var productseries_check = that.get('tsconfig').get('product_series');435 var productseries_check = that.get('tsconfig').get('product_series');
438 var lp_client = new Y.lp.client.Launchpad();
439 function delete_packaging(config) {436 function delete_packaging(config) {
440 productseries_check.set('pending', true);437 productseries_check.set('pending', true);
441 var source_package = that.get('source_package');438 var source_package = that.get('source_package');
@@ -452,7 +449,6 @@
452 },449 },
453 select_branch: function(branch_summary) {450 select_branch: function(branch_summary) {
454 var that = this;451 var that = this;
455 var lp_client = new Y.lp.client.Launchpad();
456 var branch_check = that.get('tsconfig').get('branch');452 var branch_check = that.get('tsconfig').get('branch');
457 var productseries = that.get('productseries');453 var productseries = that.get('productseries');
458454