Merge lp:~michael.nelson/launchpad/561586-move-js-to-lp-app into lp:launchpad

Proposed by Michael Nelson
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 11346
Proposed branch: lp:~michael.nelson/launchpad/561586-move-js-to-lp-app
Merge into: lp:launchpad
Diff against target: 622 lines (+123/-91)
14 files modified
lib/lp/app/templates/base-layout-macros.pt (+10/-0)
lib/lp/soyuz/javascript/archivesubscribers_index.js (+5/-4)
lib/lp/soyuz/javascript/base.js (+5/-8)
lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js (+12/-13)
lib/lp/soyuz/javascript/tests/archivesubscribers_index.js (+13/-8)
lib/lp/soyuz/javascript/tests/lp_dynamic_dom_updater.js (+29/-14)
lib/lp/soyuz/javascript/tests/test_archivesubscribers_index.html (+5/-5)
lib/lp/soyuz/javascript/tests/test_lp_dynamic_dom_updater.html (+5/-5)
lib/lp/soyuz/javascript/update_archive_build_statuses.js (+11/-9)
lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt (+0/-1)
lib/lp/soyuz/templates/archive-packages.pt (+4/-17)
lib/lp/soyuz/templates/archive-subscribers.pt (+2/-7)
lib/lp/soyuz/windmill/tests/test_yuitests.py (+21/-0)
utilities/lp-deps.py (+1/-0)
To merge this branch: bzr merge lp:~michael.nelson/launchpad/561586-move-js-to-lp-app
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+32180@code.launchpad.net

Commit message

Move soyuz js files to lp.soyuz.javascript, fix namespaces and add unit test for soyuz windmill tests.

Description of the change

Overview
========

This branch address bug 561586 for soyuz by moving the soyuz JavaScript files (and their tests) into lib/lp/soyuz/javascript. It also fixes the namespaces (bug 513272) so that all soyuz JS methods are accessed via Y.lp.soyuz...

Details
=======

I followed Deryck's (and Maris') example at:

https://code.edge.launchpad.net/~deryck/launchpad/bugs-js-names-and-path-move/+merge/27646

and also moved the imports from the templates to the base template (in devmode), and added a unittest for the windmill tests.

To test
=======
bin/test -vvm lp.soyuz -t test_yuitests

To demo:
1) view https://launchpad.dev/~cprov/+archive/ppa/+packages and note that:
  a) the 'Package totals' widget is updated correctly (async request)
  b) if you check the JS log for your browser, you'll see the build status updates working correctly.
2) Log in as admin, create a new PPA for yourself, administer it and make it private, then click on 'Manage subscriptions'. You'll then see the 'Add access' link which expands the row for adding a new subscription.

I removed all the lint too.

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
2--- lib/lp/app/templates/base-layout-macros.pt 2010-08-03 11:18:34 +0000
3+++ lib/lp/app/templates/base-layout-macros.pt 2010-08-13 10:12:49 +0000
4@@ -231,6 +231,16 @@
5 tal:attributes="src string:${lp_js}/translations/languages.js"></script>
6 <script type="text/javascript"
7 tal:attributes="src string:${lp_js}/translations/pofile.js"></script>
8+
9+ <script type="text/javascript"
10+ tal:attributes="src string:${lp_js}/soyuz/archivesubscribers_index.js"></script>
11+ <script type="text/javascript"
12+ tal:attributes="src string:${lp_js}/soyuz/base.js"></script>
13+ <script type="text/javascript"
14+ tal:attributes="src string:${lp_js}/soyuz/lp_dynamic_dom_updater.js"></script>
15+ <script type="text/javascript"
16+ tal:attributes="src string:${lp_js}/soyuz/update_archive_build_statuses.js"></script>
17+
18 <script type="text/javascript"
19 tal:attributes="src string:${lp_js}/bugs/filebug_dupefinder.js">
20 </script>
21
22=== renamed directory 'lib/canonical/launchpad/javascript/soyuz' => 'lib/lp/soyuz/javascript'
23=== modified file 'lib/lp/soyuz/javascript/archivesubscribers_index.js'
24--- lib/canonical/launchpad/javascript/soyuz/archivesubscribers_index.js 2009-11-24 09:30:01 +0000
25+++ lib/lp/soyuz/javascript/archivesubscribers_index.js 2010-08-13 10:12:49 +0000
26@@ -3,19 +3,20 @@
27 *
28 * Enhancements for adding ppa subscribers.
29 *
30- * @module ArchiveSubscribersIndex
31+ * @module soyuz
32+ * @submodule archivesubscribers_index
33 * @requires event, node, oop
34 */
35-YUI.add('soyuz.archivesubscribers_index', function(Y) {
36+YUI.add('lp.soyuz.archivesubscribers_index', function(Y) {
37
38-var soyuz = Y.namespace('soyuz');
39+var namespace = Y.namespace('lp.soyuz.archivesubscribers_index');
40
41 /*
42 * Setup the style and click handler for the add subscriber link.
43 *
44 * @method setup_archivesubscribers_index
45 */
46-Y.soyuz.setup_archivesubscribers_index = function() {
47+namespace.setup_archivesubscribers_index = function() {
48 // If there are no errors then we hide the add-subscriber row and
49 // potentially the whole table if there are no subscribers.
50 if (Y.Lang.isNull(Y.one('p.error.message'))) {
51
52=== modified file 'lib/lp/soyuz/javascript/base.js'
53--- lib/canonical/launchpad/javascript/soyuz/base.js 2009-11-23 19:29:02 +0000
54+++ lib/lp/soyuz/javascript/base.js 2010-08-13 10:12:49 +0000
55@@ -4,24 +4,21 @@
56 * Auxiliary functions used in Soyuz pages
57 *
58 * @module soyuz
59- * @submodule soyuz-base
60+ * @submodule base
61 * @namespace soyuz
62 * @requires yahoo, node
63 */
64
65-YUI.add('soyuz-base', function(Y) {
66+YUI.add('lp.soyuz.base', function(Y) {
67
68-/*
69- * Define the 'Y.soyuz' namespace
70- */
71-var soyuz = Y.namespace('soyuz');
72+var namespace = Y.namespace('lp.soyuz.base');
73
74
75 /*
76 * Return a node containing a standard failure message to be used
77 * in XHR-based page updates.
78 */
79-soyuz.makeFailureNode = function (text, handler) {
80+namespace.makeFailureNode = function (text, handler) {
81 var failure_message = Y.Node.create('<p>');
82 failure_message.addClass('update-failure-message');
83
84@@ -44,7 +41,7 @@
85 * Return a node containing a standard in-progress message to be used
86 * in XHR-based page updates.
87 */
88-soyuz.makeInProgressNode = function (text) {
89+namespace.makeInProgressNode = function (text) {
90 var in_progress_message = Y.Node.create('<p>');
91 var message = Y.Node.create('<span>');
92
93
94=== modified file 'lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js'
95--- lib/canonical/launchpad/javascript/soyuz/lp_dynamic_dom_updater.js 2009-11-24 16:11:43 +0000
96+++ lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js 2010-08-13 10:12:49 +0000
97@@ -5,16 +5,16 @@
98 * can be plugged in to a DOM subtree, so that the subtree can update itself
99 * regularly using the Launchpad API.
100 *
101- * @module DynamicDomUpdater
102+ * @module soyuz
103+ * @submodule dynamic_dom_updater
104 * @requires yahoo, node, plugin, LP
105 */
106-YUI.add('soyuz.dynamic_dom_updater', function(Y) {
107+YUI.add('lp.soyuz.dynamic_dom_updater', function(Y) {
108
109-/* Ensure that the Y.lp namespace exists. */
110-var lp = Y.namespace('lp');
111+var namespace = Y.namespace('lp.soyuz.dynamic_dom_updater');
112
113 /**
114- * The DomUpdater class provides the ability to plugin functionality
115+ * The DomUpdater class provides the ability to plugin functionality
116 * to a DOM subtree so that it can update itself when given data in an
117 * expected format.
118 *
119@@ -74,12 +74,12 @@
120 });
121
122 /*
123- * Ensure that the DomUpdater is available within the Y.lp namespace.
124+ * Ensure that the DomUpdater is available within the namespace.
125 */
126- Y.lp.DomUpdater = DomUpdater;
127+ namespace.DomUpdater = DomUpdater;
128
129 /**
130- * The DynamicDomUpdater class provides the ability to plug functionality
131+ * The DynamicDomUpdater class provides the ability to plug functionality
132 * into a DOM subtree so that it can update itself using an LP api method.
133 *
134 * For example:
135@@ -94,7 +94,7 @@
136 * Once configured, the 'table' dom subtree will now update itself
137 * by calling the user defined domUpdateFunction (with a default interval
138 * of 6000ms) with the result of the LPs api call.
139- *
140+ *
141 * @class DynamicDomUpdater
142 * @extends DomUpdater
143 * @constructor
144@@ -326,7 +326,7 @@
145 }
146
147 if (actual_interval_updated) {
148- Y.log("Actual poll interval updated to " +
149+ Y.log("Actual poll interval updated to " +
150 this._actual_interval + "ms.");
151 }
152
153@@ -350,9 +350,8 @@
154 });
155
156 /*
157- * Ensure that the DynamicDomUpdater is available within the Y.lp
158- * namespace.
159+ * Ensure that the DynamicDomUpdater is available within the namespace.
160 */
161- Y.lp.DynamicDomUpdater = DynamicDomUpdater;
162+ namespace.DynamicDomUpdater = DynamicDomUpdater;
163
164 }, "0.1", {"requires":["node", "plugin"]});
165
166=== modified file 'lib/lp/soyuz/javascript/tests/archivesubscribers_index.js'
167--- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2010-07-26 13:42:32 +0000
168+++ lib/lp/soyuz/javascript/tests/archivesubscribers_index.js 2010-08-13 10:12:49 +0000
169@@ -2,11 +2,11 @@
170 GNU Affero General Public License version 3 (see the file LICENSE). */
171
172 YUI({
173- base: '../../../icing/yui/',
174+ base: '../../../../canonical/launchpad/icing/yui/',
175 filter: 'raw',
176 combine: false
177 }).use(
178- 'test', 'console', 'soyuz.archivesubscribers_index', function(Y) {
179+ 'test', 'console', 'lp.soyuz.archivesubscribers_index', function(Y) {
180
181 var Assert = Y.Assert; // For easy access to isTrue(), etc.
182
183@@ -68,7 +68,7 @@
184
185 test_add_row_hidden_after_setup: function() {
186 // The add subscriber row is hidden during setup.
187- Y.soyuz.setup_archivesubscribers_index();
188+ Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
189 Assert.areEqual(
190 'none', this.add_subscriber_row.getStyle('display'),
191 'The add subscriber row should be hidden during setup.');
192@@ -76,7 +76,7 @@
193
194 test_subscribers_section_displayed_after_setup: function() {
195 // The subscribers div normally remains displayed after setup.
196- Y.soyuz.setup_archivesubscribers_index();
197+ Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
198 Assert.areEqual(
199 'block', this.subscribers_div.getStyle('display'),
200 'The subscribers div should remain displayed after setup.');
201@@ -87,7 +87,7 @@
202
203 // Add a paragraph with the no-subscribers id.
204 this.error_div.set('innerHTML', '<p id="no-subscribers">blah</p>');
205- Y.soyuz.setup_archivesubscribers_index();
206+ Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
207 Assert.areEqual(
208 'none', this.subscribers_div.getStyle('display'),
209 'The subscribers div should be hidden when there are ' +
210@@ -100,7 +100,7 @@
211
212 // Add an error paragraph.
213 this.error_div.set('innerHTML', '<p class="error message">Blah</p>');
214- Y.soyuz.setup_archivesubscribers_index();
215+ Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
216 Assert.areEqual(
217 'table-row', this.add_subscriber_row.getStyle('display'),
218 'The add subscriber row should not be hidden if there are ' +
219@@ -110,7 +110,7 @@
220 test_add_access_link_added_after_setup: function() {
221 // The 'Add access' link is created during setup.
222
223- Y.soyuz.setup_archivesubscribers_index();
224+ Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
225 Assert.areEqual(
226 '<a class="js-action sprite add" href="#">Add access</a>',
227 this.add_subscriber_placeholder.get('innerHTML'),
228@@ -119,7 +119,7 @@
229
230 test_click_add_access_displays_add_row: function() {
231 // The add subscriber row is displayed after clicking 'Add access'.
232- Y.soyuz.setup_archivesubscribers_index();
233+ Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
234 var link_node = this.add_subscriber_placeholder.one('a');
235 Assert.areEqual(
236 'Add access', link_node.get('innerHTML'));
237@@ -133,6 +133,11 @@
238 }
239 }));
240
241+Y.Test.Runner.on('complete', function(data) {
242+ status_node = Y.Node.create(
243+ '<p id="complete">Test status: complete</p>');
244+ Y.get('body').appendChild(status_node);
245+});
246 Y.Test.Runner.add(suite);
247
248 var yconsole = new Y.Console({
249
250=== modified file 'lib/lp/soyuz/javascript/tests/lp_dynamic_dom_updater.js'
251--- lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.js 2010-07-26 13:42:32 +0000
252+++ lib/lp/soyuz/javascript/tests/lp_dynamic_dom_updater.js 2010-08-13 10:12:49 +0000
253@@ -2,10 +2,10 @@
254 GNU Affero General Public License version 3 (see the file LICENSE). */
255
256 YUI({
257- base: '../../../icing/yui/',
258+ base: '../../../../canonical/launchpad/icing/yui/',
259 filter: 'raw',
260 combine: false
261- }).use('test', 'console', 'soyuz.dynamic_dom_updater', function(Y) {
262+ }).use('test', 'console', 'lp.soyuz.dynamic_dom_updater', function(Y) {
263
264 var Assert = Y.Assert; // For easy access to isTrue(), etc.
265
266@@ -31,14 +31,15 @@
267 this.eg_div.updater,
268 "Sanity check: initially there is no updater attribute.");
269
270- this.eg_div.plug(Y.lp.DomUpdater, this.config);
271+ this.eg_div.plug(
272+ Y.lp.soyuz.dynamic_dom_updater.DomUpdater, this.config);
273
274 Assert.isNotUndefined(
275 this.eg_div.updater,
276 "After plugging, the object has an 'updater' attribute.");
277
278 Assert.isInstanceOf(
279- Y.lp.DomUpdater,
280+ Y.lp.soyuz.dynamic_dom_updater.DomUpdater,
281 this.eg_div.updater,
282 "DomUpdater was not plugged correctly.");
283 },
284@@ -52,7 +53,8 @@
285 "Sanity check that the innerHTML of our example div has not" +
286 "been modified.");
287
288- this.eg_div.plug(Y.lp.DomUpdater, this.config);
289+ this.eg_div.plug(
290+ Y.lp.soyuz.dynamic_dom_updater.DomUpdater, this.config);
291 this.eg_div.updater.update({msg: "Boo. I've changed."});
292 Assert.areEqual(
293 "Boo. I've changed.",
294@@ -97,14 +99,15 @@
295 this.eg_div.updater,
296 "Sanity check: initially there is no updater attribute.");
297
298- this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);
299+ this.eg_div.plug(
300+ Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
301
302 Assert.isNotUndefined(
303 this.eg_div.updater,
304 "After plugging, the object has an 'updater' attribute.");
305
306 Assert.isInstanceOf(
307- Y.lp.DynamicDomUpdater,
308+ Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater,
309 this.eg_div.updater,
310 "DynamicDomUpdater was not plugged correctly.");
311 },
312@@ -113,7 +116,8 @@
313 // Requests to the LP API should only be re-issued if a successful
314 // response was received previously.
315
316- this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);
317+ this.eg_div.plug(
318+ Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
319
320 // Verify that our expectation of only one named_get was met:
321 this.wait(function() {
322@@ -132,7 +136,8 @@
323 callCount: 2
324 });
325
326- this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);
327+ this.eg_div.plug(
328+ Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
329
330 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
331 // its initialization.
332@@ -151,7 +156,8 @@
333 // The actual polling interval is doubled if the elapsed time
334 // for the previous request was greater than the
335 // long_processing_time attribute.
336- this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);
337+ this.eg_div.plug(
338+ Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
339
340 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
341 // its initialization.
342@@ -175,7 +181,8 @@
343 // The actual polling interval remains unchanged if the elapsed time
344 // for the previous request was within the short/long processing
345 // times.
346- this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);
347+ this.eg_div.plug(
348+ Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
349
350 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
351 // its initialization.
352@@ -200,7 +207,8 @@
353 // The actual polling interval is halved if the elapsed time
354 // for the previous request was less than the short_processing_time
355
356- this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);
357+ this.eg_div.plug(
358+ Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
359
360 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
361 // its initialization.
362@@ -220,7 +228,8 @@
363 Assert.areEqual(
364 8,
365 this.eg_div.updater._actual_interval,
366- "Poll interval is halved if request is faster than expected.");
367+ "Poll interval is halved if request is faster than " +
368+ "expected.");
369
370 }, 5);
371 },
372@@ -229,7 +238,8 @@
373 // Even if the processing time is quick, the actual interval
374 // is never smaller than the interval set in the configuration.
375
376- this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);
377+ this.eg_div.plug(
378+ Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
379
380 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
381 // its initialization.
382@@ -259,6 +269,11 @@
383
384 }));
385
386+ Y.Test.Runner.on('complete', function(data) {
387+ status_node = Y.Node.create(
388+ '<p id="complete">Test status: complete</p>');
389+ Y.get('body').appendChild(status_node);
390+ });
391 Y.Test.Runner.add(suite);
392
393 var yconsole = new Y.Console({
394
395=== renamed file 'lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html' => 'lib/lp/soyuz/javascript/tests/test_archivesubscribers_index.html'
396--- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html 2010-07-26 13:42:32 +0000
397+++ lib/lp/soyuz/javascript/tests/test_archivesubscribers_index.html 2010-08-13 10:12:49 +0000
398@@ -4,11 +4,11 @@
399 <title>Launchpad ArchiveSubscriberIndex</title>
400
401 <!-- YUI 3.0 Setup -->
402- <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
403- <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
404- <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
405- <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
406- <link rel="stylesheet" href="../../test.css" />
407+ <script type="text/javascript" src="../../../../canonical/launchpad/icing/yui/yui/yui.js"></script>
408+ <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssreset/reset.css"/>
409+ <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssfonts/fonts.css"/>
410+ <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssbase/base.css"/>
411+ <link rel="stylesheet" href="../../../../canonical/launchpad/test.css" />
412
413 <!-- The module under test -->
414 <script type="text/javascript" src="../archivesubscribers_index.js"></script>
415
416=== renamed file 'lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html' => 'lib/lp/soyuz/javascript/tests/test_lp_dynamic_dom_updater.html'
417--- lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html 2010-07-26 13:42:32 +0000
418+++ lib/lp/soyuz/javascript/tests/test_lp_dynamic_dom_updater.html 2010-08-13 10:12:49 +0000
419@@ -4,11 +4,11 @@
420 <title>Launchpad DynamicDomUpdater</title>
421
422 <!-- YUI 3.0 Setup -->
423- <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>
424- <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>
425- <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>
426- <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>
427- <link rel="stylesheet" href="../../test.css" />
428+ <script type="text/javascript" src="../../../../canonical/launchpad/icing/yui/yui/yui.js"></script>
429+ <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssreset/reset.css"/>
430+ <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssfonts/fonts.css"/>
431+ <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssbase/base.css"/>
432+ <link rel="stylesheet" href="../../../../canonical/launchpad/javascript/test.css" />
433
434 <!-- The module under test -->
435 <script type="text/javascript" src="../lp_dynamic_dom_updater.js"></script>
436
437=== modified file 'lib/lp/soyuz/javascript/update_archive_build_statuses.js'
438--- lib/canonical/launchpad/javascript/soyuz/update_archive_build_statuses.js 2009-11-24 09:30:01 +0000
439+++ lib/lp/soyuz/javascript/update_archive_build_statuses.js 2010-08-13 10:12:49 +0000
440@@ -11,7 +11,7 @@
441 * The second is the Archive/PPA source package table, the configuration of
442 * which is set in source_package_table_dynamic_update_config.
443 */
444-YUI.add('soyuz.update_archive_build_statuses', function(Y){
445+YUI.add('lp.soyuz.update_archive_build_statuses', function(Y){
446
447 /**
448 * Create one Launchpad client to be used by both dynamic tables.
449@@ -86,7 +86,7 @@
450 var portlet = Y.one('div#build-status-summary');
451 build_summary_portlet_dynamic_update_config.uri =
452 LP.client.cache.context.self_link;
453- portlet.plug(Y.lp.DynamicDomUpdater,
454+ portlet.plug(Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater,
455 build_summary_portlet_dynamic_update_config);
456 });
457
458@@ -110,8 +110,8 @@
459 domUpdateFunction: function(table_node, data_object){
460 // For each source id in the data object:
461 Y.each(data_object, function(build_summary, source_id){
462- // Grab the related td element (and fail silently if it doesn't
463- // exist).
464+ // Grab the related td element (and fail silently if it
465+ // doesn't exist).
466 var td_elem = Y.one("#pubstatus" + source_id);
467 if (td_elem === null) {
468 return;
469@@ -221,12 +221,13 @@
470 * @config parameterEvaluatorFunction
471 */
472 parameterEvaluatorFunction: function(table_node){
473- // Grab all the td's with the class 'build_status' and an additional
474- // class of either 'NEEDSBUILD' or 'BUILDING':
475+ // Grab all the td's with the class 'build_status' and an
476+ // additional class of either 'NEEDSBUILD' or 'BUILDING':
477 var td_list = table_node.all('td.build_status');
478 var tds_needsbuild = td_list.filter(".NEEDSBUILD");
479 var tds_building = td_list.filter(".BUILDING");
480- var tds_fullybuilt_pending = td_list.filter(".FULLYBUILT_PENDING");
481+ var tds_fullybuilt_pending = td_list.filter(
482+ ".FULLYBUILT_PENDING");
483
484 if (tds_needsbuild.size() === 0 &&
485 tds_building.size() === 0 &&
486@@ -275,8 +276,9 @@
487 if (table !== null) {
488 source_package_table_dynamic_update_config.uri =
489 LP.client.cache.context.self_link;
490- table.plug(Y.lp.DynamicDomUpdater,
491+ table.plug(Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater,
492 source_package_table_dynamic_update_config);
493 }
494 });
495-}, "0.1", {"requires":["node", "lazr.anim", "anim", "soyuz.dynamic_dom_updater"]});
496+}, "0.1", {"requires":[
497+ "node", "lazr.anim", "anim", "lp.soyuz.dynamic_dom_updater"]});
498
499=== modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt'
500--- lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2010-07-14 14:58:30 +0000
501+++ lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2010-08-13 10:12:49 +0000
502@@ -56,7 +56,6 @@
503 ...
504 http://launchpad.dev/+icing/.../build/app/calendar.js
505 http://launchpad.dev/+icing/.../yui_2.7.0b/build/calendar/assets/skins/sam/calendar.css
506- ...
507
508 Initially there are no subscriptions for a newly privatized PPA (although,
509 this may need to change, to add the owner/team). A heading is displayed
510
511=== modified file 'lib/lp/soyuz/templates/archive-packages.pt'
512--- lib/lp/soyuz/templates/archive-packages.pt 2010-03-24 16:54:56 +0000
513+++ lib/lp/soyuz/templates/archive-packages.pt 2010-08-13 10:12:49 +0000
514@@ -8,23 +8,10 @@
515 >
516 <body>
517 <metal:block fill-slot="head_epilogue">
518- <tal:devmode condition="devmode">
519- <tal:archive_js define="lp_js string:${icingroot}/build">
520- <script type="text/javascript"
521- tal:attributes="src string:${lp_js}/soyuz/base.js">
522- </script>
523- <script type="text/javascript"
524- tal:attributes="src string:${lp_js}/soyuz/lp_dynamic_dom_updater.js">
525- </script>
526- <script type="text/javascript"
527- tal:attributes="src string:${lp_js}/soyuz/update_archive_build_statuses.js">
528- </script>
529- </tal:archive_js>
530- </tal:devmode>
531 <script type="text/javascript" id="repository-size-update"
532 tal:condition="view/archive_url">
533-LPS.use('io-base', 'lazr.anim', 'node', 'soyuz-base',
534- 'soyuz.update_archive_build_statuses', function(Y) {
535+LPS.use('io-base', 'lazr.anim', 'node', 'lp.soyuz.base',
536+ 'lp.soyuz.update_archive_build_statuses', function(Y) {
537
538
539 /*
540@@ -45,7 +32,7 @@
541 dispatchUpdate();
542 };
543
544- var failure_message = Y.soyuz.makeFailureNode(
545+ var failure_message = Y.lp.soyuz.base.makeFailureNode(
546 'Failed to fetch repository size ...', retry_handler);
547
548 args.container.set('innerHTML', '');
549@@ -62,7 +49,7 @@
550 * Communicate an update is in progress and fire the XHR.
551 */
552 function dispatchUpdate () {
553- in_progress_message = Y.soyuz.makeInProgressNode(
554+ in_progress_message = Y.lp.soyuz.base.makeInProgressNode(
555 'Fetching repository size ...')
556
557 var container = Y.one('#package-counters');
558
559=== modified file 'lib/lp/soyuz/templates/archive-subscribers.pt'
560--- lib/lp/soyuz/templates/archive-subscribers.pt 2009-12-03 18:33:22 +0000
561+++ lib/lp/soyuz/templates/archive-subscribers.pt 2010-08-13 10:12:49 +0000
562@@ -10,11 +10,6 @@
563 <metal:block fill-slot="head_epilogue">
564 <metal:yui-dependencies
565 use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" />
566-
567- <tal:devmode condition="devmode">
568- <script type="text/javascript"
569- tal:attributes="src string:${lp_js}/soyuz/archivesubscribers_index.js"></script>
570- </tal:devmode>
571 </metal:block>
572
573 <div metal:fill-slot="main">
574@@ -98,8 +93,8 @@
575 </form>
576 </div><!-- class="portlet" -->
577 <script type="text/javascript" id="setup-archivesubscribers-index">
578- LPS.use('soyuz.archivesubscribers_index', function(Y) {
579- Y.soyuz.setup_archivesubscribers_index();
580+ LPS.use('lp.soyuz.archivesubscribers_index', function(Y) {
581+ Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
582 });
583 </script>
584 </div>
585
586=== added file 'lib/lp/soyuz/windmill/tests/test_yuitests.py'
587--- lib/lp/soyuz/windmill/tests/test_yuitests.py 1970-01-01 00:00:00 +0000
588+++ lib/lp/soyuz/windmill/tests/test_yuitests.py 2010-08-13 10:12:49 +0000
589@@ -0,0 +1,21 @@
590+# Copyright 2010 Canonical Ltd. This software is licensed under the
591+# GNU Affero General Public License version 3 (see the file LICENSE).
592+
593+"""Run YUI.test tests."""
594+
595+__metaclass__ = type
596+__all__ = []
597+
598+from lp.testing import build_yui_unittest_suite, YUIUnitTestCase
599+from lp.soyuz.windmill.testing import SoyuzWindmillLayer
600+
601+
602+class SoyuzYUIUnitTestCase(YUIUnitTestCase):
603+
604+ layer = SoyuzWindmillLayer
605+ suite_name = 'SoyuzYUIUnitTests'
606+
607+
608+def test_suite():
609+ app_testing_path = 'lp/soyuz/javascript/tests'
610+ return build_yui_unittest_suite(app_testing_path, SoyuzYUIUnitTestCase)
611
612=== modified file 'utilities/lp-deps.py'
613--- utilities/lp-deps.py 2010-07-16 16:14:39 +0000
614+++ utilities/lp-deps.py 2010-08-13 10:12:49 +0000
615@@ -25,6 +25,7 @@
616 (os.path.join('lib', 'lp', 'code', 'javascript'), 'code'),
617 (os.path.join('lib', 'lp', 'registry', 'javascript'), 'registry'),
618 (os.path.join('lib', 'lp', 'translations', 'javascript'), 'translations'),
619+ (os.path.join('lib', 'lp', 'soyuz', 'javascript'), 'soyuz'),
620 ]
621 ICING_ROOT = os.path.join(TOP, 'lib', 'canonical', 'launchpad', 'icing')
622 ICING_BUILD = os.path.join(ICING_ROOT, 'build')