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
=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt 2010-08-03 11:18:34 +0000
+++ lib/lp/app/templates/base-layout-macros.pt 2010-08-13 10:12:49 +0000
@@ -231,6 +231,16 @@
231 tal:attributes="src string:${lp_js}/translations/languages.js"></script>231 tal:attributes="src string:${lp_js}/translations/languages.js"></script>
232 <script type="text/javascript"232 <script type="text/javascript"
233 tal:attributes="src string:${lp_js}/translations/pofile.js"></script>233 tal:attributes="src string:${lp_js}/translations/pofile.js"></script>
234
235 <script type="text/javascript"
236 tal:attributes="src string:${lp_js}/soyuz/archivesubscribers_index.js"></script>
237 <script type="text/javascript"
238 tal:attributes="src string:${lp_js}/soyuz/base.js"></script>
239 <script type="text/javascript"
240 tal:attributes="src string:${lp_js}/soyuz/lp_dynamic_dom_updater.js"></script>
241 <script type="text/javascript"
242 tal:attributes="src string:${lp_js}/soyuz/update_archive_build_statuses.js"></script>
243
234 <script type="text/javascript"244 <script type="text/javascript"
235 tal:attributes="src string:${lp_js}/bugs/filebug_dupefinder.js">245 tal:attributes="src string:${lp_js}/bugs/filebug_dupefinder.js">
236 </script>246 </script>
237247
=== renamed directory 'lib/canonical/launchpad/javascript/soyuz' => 'lib/lp/soyuz/javascript'
=== modified file 'lib/lp/soyuz/javascript/archivesubscribers_index.js'
--- lib/canonical/launchpad/javascript/soyuz/archivesubscribers_index.js 2009-11-24 09:30:01 +0000
+++ lib/lp/soyuz/javascript/archivesubscribers_index.js 2010-08-13 10:12:49 +0000
@@ -3,19 +3,20 @@
3 *3 *
4 * Enhancements for adding ppa subscribers.4 * Enhancements for adding ppa subscribers.
5 *5 *
6 * @module ArchiveSubscribersIndex6 * @module soyuz
7 * @submodule archivesubscribers_index
7 * @requires event, node, oop8 * @requires event, node, oop
8 */9 */
9YUI.add('soyuz.archivesubscribers_index', function(Y) {10YUI.add('lp.soyuz.archivesubscribers_index', function(Y) {
1011
11var soyuz = Y.namespace('soyuz');12var namespace = Y.namespace('lp.soyuz.archivesubscribers_index');
1213
13/*14/*
14 * Setup the style and click handler for the add subscriber link.15 * Setup the style and click handler for the add subscriber link.
15 *16 *
16 * @method setup_archivesubscribers_index17 * @method setup_archivesubscribers_index
17 */18 */
18Y.soyuz.setup_archivesubscribers_index = function() {19namespace.setup_archivesubscribers_index = function() {
19 // If there are no errors then we hide the add-subscriber row and20 // If there are no errors then we hide the add-subscriber row and
20 // potentially the whole table if there are no subscribers.21 // potentially the whole table if there are no subscribers.
21 if (Y.Lang.isNull(Y.one('p.error.message'))) {22 if (Y.Lang.isNull(Y.one('p.error.message'))) {
2223
=== modified file 'lib/lp/soyuz/javascript/base.js'
--- lib/canonical/launchpad/javascript/soyuz/base.js 2009-11-23 19:29:02 +0000
+++ lib/lp/soyuz/javascript/base.js 2010-08-13 10:12:49 +0000
@@ -4,24 +4,21 @@
4 * Auxiliary functions used in Soyuz pages4 * Auxiliary functions used in Soyuz pages
5 *5 *
6 * @module soyuz6 * @module soyuz
7 * @submodule soyuz-base7 * @submodule base
8 * @namespace soyuz8 * @namespace soyuz
9 * @requires yahoo, node9 * @requires yahoo, node
10 */10 */
1111
12YUI.add('soyuz-base', function(Y) {12YUI.add('lp.soyuz.base', function(Y) {
1313
14/*14var namespace = Y.namespace('lp.soyuz.base');
15 * Define the 'Y.soyuz' namespace
16 */
17var soyuz = Y.namespace('soyuz');
1815
1916
20/*17/*
21 * Return a node containing a standard failure message to be used18 * Return a node containing a standard failure message to be used
22 * in XHR-based page updates.19 * in XHR-based page updates.
23 */20 */
24soyuz.makeFailureNode = function (text, handler) {21namespace.makeFailureNode = function (text, handler) {
25 var failure_message = Y.Node.create('<p>');22 var failure_message = Y.Node.create('<p>');
26 failure_message.addClass('update-failure-message');23 failure_message.addClass('update-failure-message');
2724
@@ -44,7 +41,7 @@
44 * Return a node containing a standard in-progress message to be used41 * Return a node containing a standard in-progress message to be used
45 * in XHR-based page updates.42 * in XHR-based page updates.
46 */43 */
47soyuz.makeInProgressNode = function (text) {44namespace.makeInProgressNode = function (text) {
48 var in_progress_message = Y.Node.create('<p>');45 var in_progress_message = Y.Node.create('<p>');
49 var message = Y.Node.create('<span>');46 var message = Y.Node.create('<span>');
5047
5148
=== modified file 'lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js'
--- lib/canonical/launchpad/javascript/soyuz/lp_dynamic_dom_updater.js 2009-11-24 16:11:43 +0000
+++ lib/lp/soyuz/javascript/lp_dynamic_dom_updater.js 2010-08-13 10:12:49 +0000
@@ -5,16 +5,16 @@
5 * can be plugged in to a DOM subtree, so that the subtree can update itself5 * can be plugged in to a DOM subtree, so that the subtree can update itself
6 * regularly using the Launchpad API.6 * regularly using the Launchpad API.
7 *7 *
8 * @module DynamicDomUpdater8 * @module soyuz
9 * @submodule dynamic_dom_updater
9 * @requires yahoo, node, plugin, LP10 * @requires yahoo, node, plugin, LP
10 */11 */
11YUI.add('soyuz.dynamic_dom_updater', function(Y) {12YUI.add('lp.soyuz.dynamic_dom_updater', function(Y) {
1213
13/* Ensure that the Y.lp namespace exists. */14var namespace = Y.namespace('lp.soyuz.dynamic_dom_updater');
14var lp = Y.namespace('lp');
1515
16 /**16 /**
17 * The DomUpdater class provides the ability to plugin functionality 17 * The DomUpdater class provides the ability to plugin functionality
18 * to a DOM subtree so that it can update itself when given data in an18 * to a DOM subtree so that it can update itself when given data in an
19 * expected format.19 * expected format.
20 *20 *
@@ -74,12 +74,12 @@
74 });74 });
7575
76 /*76 /*
77 * Ensure that the DomUpdater is available within the Y.lp namespace.77 * Ensure that the DomUpdater is available within the namespace.
78 */78 */
79 Y.lp.DomUpdater = DomUpdater;79 namespace.DomUpdater = DomUpdater;
8080
81 /**81 /**
82 * The DynamicDomUpdater class provides the ability to plug functionality 82 * The DynamicDomUpdater class provides the ability to plug functionality
83 * into a DOM subtree so that it can update itself using an LP api method.83 * into a DOM subtree so that it can update itself using an LP api method.
84 *84 *
85 * For example:85 * For example:
@@ -94,7 +94,7 @@
94 * Once configured, the 'table' dom subtree will now update itself94 * Once configured, the 'table' dom subtree will now update itself
95 * by calling the user defined domUpdateFunction (with a default interval95 * by calling the user defined domUpdateFunction (with a default interval
96 * of 6000ms) with the result of the LPs api call.96 * of 6000ms) with the result of the LPs api call.
97 * 97 *
98 * @class DynamicDomUpdater98 * @class DynamicDomUpdater
99 * @extends DomUpdater99 * @extends DomUpdater
100 * @constructor100 * @constructor
@@ -326,7 +326,7 @@
326 }326 }
327327
328 if (actual_interval_updated) {328 if (actual_interval_updated) {
329 Y.log("Actual poll interval updated to " + 329 Y.log("Actual poll interval updated to " +
330 this._actual_interval + "ms.");330 this._actual_interval + "ms.");
331 }331 }
332332
@@ -350,9 +350,8 @@
350 });350 });
351351
352 /*352 /*
353 * Ensure that the DynamicDomUpdater is available within the Y.lp353 * Ensure that the DynamicDomUpdater is available within the namespace.
354 * namespace.
355 */354 */
356 Y.lp.DynamicDomUpdater = DynamicDomUpdater;355 namespace.DynamicDomUpdater = DynamicDomUpdater;
357356
358}, "0.1", {"requires":["node", "plugin"]});357}, "0.1", {"requires":["node", "plugin"]});
359358
=== modified file 'lib/lp/soyuz/javascript/tests/archivesubscribers_index.js'
--- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.js 2010-07-26 13:42:32 +0000
+++ lib/lp/soyuz/javascript/tests/archivesubscribers_index.js 2010-08-13 10:12:49 +0000
@@ -2,11 +2,11 @@
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({4YUI({
5 base: '../../../icing/yui/',5 base: '../../../../canonical/launchpad/icing/yui/',
6 filter: 'raw',6 filter: 'raw',
7 combine: false7 combine: false
8 }).use(8 }).use(
9 'test', 'console', 'soyuz.archivesubscribers_index', function(Y) {9 'test', 'console', 'lp.soyuz.archivesubscribers_index', function(Y) {
1010
11var Assert = Y.Assert; // For easy access to isTrue(), etc.11var Assert = Y.Assert; // For easy access to isTrue(), etc.
1212
@@ -68,7 +68,7 @@
6868
69 test_add_row_hidden_after_setup: function() {69 test_add_row_hidden_after_setup: function() {
70 // The add subscriber row is hidden during setup.70 // The add subscriber row is hidden during setup.
71 Y.soyuz.setup_archivesubscribers_index();71 Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
72 Assert.areEqual(72 Assert.areEqual(
73 'none', this.add_subscriber_row.getStyle('display'),73 'none', this.add_subscriber_row.getStyle('display'),
74 'The add subscriber row should be hidden during setup.');74 'The add subscriber row should be hidden during setup.');
@@ -76,7 +76,7 @@
7676
77 test_subscribers_section_displayed_after_setup: function() {77 test_subscribers_section_displayed_after_setup: function() {
78 // The subscribers div normally remains displayed after setup.78 // The subscribers div normally remains displayed after setup.
79 Y.soyuz.setup_archivesubscribers_index();79 Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
80 Assert.areEqual(80 Assert.areEqual(
81 'block', this.subscribers_div.getStyle('display'),81 'block', this.subscribers_div.getStyle('display'),
82 'The subscribers div should remain displayed after setup.');82 'The subscribers div should remain displayed after setup.');
@@ -87,7 +87,7 @@
8787
88 // Add a paragraph with the no-subscribers id.88 // Add a paragraph with the no-subscribers id.
89 this.error_div.set('innerHTML', '<p id="no-subscribers">blah</p>');89 this.error_div.set('innerHTML', '<p id="no-subscribers">blah</p>');
90 Y.soyuz.setup_archivesubscribers_index();90 Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
91 Assert.areEqual(91 Assert.areEqual(
92 'none', this.subscribers_div.getStyle('display'),92 'none', this.subscribers_div.getStyle('display'),
93 'The subscribers div should be hidden when there are ' +93 'The subscribers div should be hidden when there are ' +
@@ -100,7 +100,7 @@
100100
101 // Add an error paragraph.101 // Add an error paragraph.
102 this.error_div.set('innerHTML', '<p class="error message">Blah</p>');102 this.error_div.set('innerHTML', '<p class="error message">Blah</p>');
103 Y.soyuz.setup_archivesubscribers_index();103 Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
104 Assert.areEqual(104 Assert.areEqual(
105 'table-row', this.add_subscriber_row.getStyle('display'),105 'table-row', this.add_subscriber_row.getStyle('display'),
106 'The add subscriber row should not be hidden if there are ' +106 'The add subscriber row should not be hidden if there are ' +
@@ -110,7 +110,7 @@
110 test_add_access_link_added_after_setup: function() {110 test_add_access_link_added_after_setup: function() {
111 // The 'Add access' link is created during setup.111 // The 'Add access' link is created during setup.
112112
113 Y.soyuz.setup_archivesubscribers_index();113 Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
114 Assert.areEqual(114 Assert.areEqual(
115 '<a class="js-action sprite add" href="#">Add access</a>',115 '<a class="js-action sprite add" href="#">Add access</a>',
116 this.add_subscriber_placeholder.get('innerHTML'),116 this.add_subscriber_placeholder.get('innerHTML'),
@@ -119,7 +119,7 @@
119119
120 test_click_add_access_displays_add_row: function() {120 test_click_add_access_displays_add_row: function() {
121 // The add subscriber row is displayed after clicking 'Add access'.121 // The add subscriber row is displayed after clicking 'Add access'.
122 Y.soyuz.setup_archivesubscribers_index();122 Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
123 var link_node = this.add_subscriber_placeholder.one('a');123 var link_node = this.add_subscriber_placeholder.one('a');
124 Assert.areEqual(124 Assert.areEqual(
125 'Add access', link_node.get('innerHTML'));125 'Add access', link_node.get('innerHTML'));
@@ -133,6 +133,11 @@
133 }133 }
134}));134}));
135135
136Y.Test.Runner.on('complete', function(data) {
137 status_node = Y.Node.create(
138 '<p id="complete">Test status: complete</p>');
139 Y.get('body').appendChild(status_node);
140});
136Y.Test.Runner.add(suite);141Y.Test.Runner.add(suite);
137142
138var yconsole = new Y.Console({143var yconsole = new Y.Console({
139144
=== modified file 'lib/lp/soyuz/javascript/tests/lp_dynamic_dom_updater.js'
--- lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.js 2010-07-26 13:42:32 +0000
+++ lib/lp/soyuz/javascript/tests/lp_dynamic_dom_updater.js 2010-08-13 10:12:49 +0000
@@ -2,10 +2,10 @@
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({4YUI({
5 base: '../../../icing/yui/',5 base: '../../../../canonical/launchpad/icing/yui/',
6 filter: 'raw',6 filter: 'raw',
7 combine: false7 combine: false
8 }).use('test', 'console', 'soyuz.dynamic_dom_updater', function(Y) {8 }).use('test', 'console', 'lp.soyuz.dynamic_dom_updater', function(Y) {
99
10var Assert = Y.Assert; // For easy access to isTrue(), etc.10var Assert = Y.Assert; // For easy access to isTrue(), etc.
1111
@@ -31,14 +31,15 @@
31 this.eg_div.updater,31 this.eg_div.updater,
32 "Sanity check: initially there is no updater attribute.");32 "Sanity check: initially there is no updater attribute.");
3333
34 this.eg_div.plug(Y.lp.DomUpdater, this.config);34 this.eg_div.plug(
35 Y.lp.soyuz.dynamic_dom_updater.DomUpdater, this.config);
3536
36 Assert.isNotUndefined(37 Assert.isNotUndefined(
37 this.eg_div.updater,38 this.eg_div.updater,
38 "After plugging, the object has an 'updater' attribute.");39 "After plugging, the object has an 'updater' attribute.");
3940
40 Assert.isInstanceOf(41 Assert.isInstanceOf(
41 Y.lp.DomUpdater,42 Y.lp.soyuz.dynamic_dom_updater.DomUpdater,
42 this.eg_div.updater,43 this.eg_div.updater,
43 "DomUpdater was not plugged correctly.");44 "DomUpdater was not plugged correctly.");
44 },45 },
@@ -52,7 +53,8 @@
52 "Sanity check that the innerHTML of our example div has not" +53 "Sanity check that the innerHTML of our example div has not" +
53 "been modified.");54 "been modified.");
5455
55 this.eg_div.plug(Y.lp.DomUpdater, this.config);56 this.eg_div.plug(
57 Y.lp.soyuz.dynamic_dom_updater.DomUpdater, this.config);
56 this.eg_div.updater.update({msg: "Boo. I've changed."});58 this.eg_div.updater.update({msg: "Boo. I've changed."});
57 Assert.areEqual(59 Assert.areEqual(
58 "Boo. I've changed.",60 "Boo. I've changed.",
@@ -97,14 +99,15 @@
97 this.eg_div.updater,99 this.eg_div.updater,
98 "Sanity check: initially there is no updater attribute.");100 "Sanity check: initially there is no updater attribute.");
99101
100 this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);102 this.eg_div.plug(
103 Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
101104
102 Assert.isNotUndefined(105 Assert.isNotUndefined(
103 this.eg_div.updater,106 this.eg_div.updater,
104 "After plugging, the object has an 'updater' attribute.");107 "After plugging, the object has an 'updater' attribute.");
105108
106 Assert.isInstanceOf(109 Assert.isInstanceOf(
107 Y.lp.DynamicDomUpdater,110 Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater,
108 this.eg_div.updater,111 this.eg_div.updater,
109 "DynamicDomUpdater was not plugged correctly.");112 "DynamicDomUpdater was not plugged correctly.");
110 },113 },
@@ -113,7 +116,8 @@
113 // Requests to the LP API should only be re-issued if a successful116 // Requests to the LP API should only be re-issued if a successful
114 // response was received previously.117 // response was received previously.
115118
116 this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);119 this.eg_div.plug(
120 Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
117121
118 // Verify that our expectation of only one named_get was met:122 // Verify that our expectation of only one named_get was met:
119 this.wait(function() {123 this.wait(function() {
@@ -132,7 +136,8 @@
132 callCount: 2136 callCount: 2
133 });137 });
134138
135 this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);139 this.eg_div.plug(
140 Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
136141
137 // Wait 5ms just to ensure that the DynamicDomUpdater finishes142 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
138 // its initialization.143 // its initialization.
@@ -151,7 +156,8 @@
151 // The actual polling interval is doubled if the elapsed time156 // The actual polling interval is doubled if the elapsed time
152 // for the previous request was greater than the157 // for the previous request was greater than the
153 // long_processing_time attribute.158 // long_processing_time attribute.
154 this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);159 this.eg_div.plug(
160 Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
155161
156 // Wait 5ms just to ensure that the DynamicDomUpdater finishes162 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
157 // its initialization.163 // its initialization.
@@ -175,7 +181,8 @@
175 // The actual polling interval remains unchanged if the elapsed time181 // The actual polling interval remains unchanged if the elapsed time
176 // for the previous request was within the short/long processing182 // for the previous request was within the short/long processing
177 // times.183 // times.
178 this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);184 this.eg_div.plug(
185 Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
179186
180 // Wait 5ms just to ensure that the DynamicDomUpdater finishes187 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
181 // its initialization.188 // its initialization.
@@ -200,7 +207,8 @@
200 // The actual polling interval is halved if the elapsed time207 // The actual polling interval is halved if the elapsed time
201 // for the previous request was less than the short_processing_time208 // for the previous request was less than the short_processing_time
202209
203 this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);210 this.eg_div.plug(
211 Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
204212
205 // Wait 5ms just to ensure that the DynamicDomUpdater finishes213 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
206 // its initialization.214 // its initialization.
@@ -220,7 +228,8 @@
220 Assert.areEqual(228 Assert.areEqual(
221 8,229 8,
222 this.eg_div.updater._actual_interval,230 this.eg_div.updater._actual_interval,
223 "Poll interval is halved if request is faster than expected.");231 "Poll interval is halved if request is faster than " +
232 "expected.");
224233
225 }, 5);234 }, 5);
226 },235 },
@@ -229,7 +238,8 @@
229 // Even if the processing time is quick, the actual interval238 // Even if the processing time is quick, the actual interval
230 // is never smaller than the interval set in the configuration.239 // is never smaller than the interval set in the configuration.
231240
232 this.eg_div.plug(Y.lp.DynamicDomUpdater, this.config);241 this.eg_div.plug(
242 Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater, this.config);
233243
234 // Wait 5ms just to ensure that the DynamicDomUpdater finishes244 // Wait 5ms just to ensure that the DynamicDomUpdater finishes
235 // its initialization.245 // its initialization.
@@ -259,6 +269,11 @@
259269
260}));270}));
261271
272 Y.Test.Runner.on('complete', function(data) {
273 status_node = Y.Node.create(
274 '<p id="complete">Test status: complete</p>');
275 Y.get('body').appendChild(status_node);
276 });
262 Y.Test.Runner.add(suite);277 Y.Test.Runner.add(suite);
263278
264 var yconsole = new Y.Console({279 var yconsole = new Y.Console({
265280
=== renamed file 'lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html' => 'lib/lp/soyuz/javascript/tests/test_archivesubscribers_index.html'
--- lib/canonical/launchpad/javascript/soyuz/tests/archivesubscribers_index.html 2010-07-26 13:42:32 +0000
+++ lib/lp/soyuz/javascript/tests/test_archivesubscribers_index.html 2010-08-13 10:12:49 +0000
@@ -4,11 +4,11 @@
4 <title>Launchpad ArchiveSubscriberIndex</title>4 <title>Launchpad ArchiveSubscriberIndex</title>
55
6 <!-- YUI 3.0 Setup -->6 <!-- YUI 3.0 Setup -->
7 <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>7 <script type="text/javascript" src="../../../../canonical/launchpad/icing/yui/yui/yui.js"></script>
8 <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>8 <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssreset/reset.css"/>
9 <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>9 <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssfonts/fonts.css"/>
10 <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>10 <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssbase/base.css"/>
11 <link rel="stylesheet" href="../../test.css" />11 <link rel="stylesheet" href="../../../../canonical/launchpad/test.css" />
1212
13 <!-- The module under test -->13 <!-- The module under test -->
14 <script type="text/javascript" src="../archivesubscribers_index.js"></script>14 <script type="text/javascript" src="../archivesubscribers_index.js"></script>
1515
=== renamed file 'lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html' => 'lib/lp/soyuz/javascript/tests/test_lp_dynamic_dom_updater.html'
--- lib/canonical/launchpad/javascript/soyuz/tests/lp_dynamic_dom_updater.html 2010-07-26 13:42:32 +0000
+++ lib/lp/soyuz/javascript/tests/test_lp_dynamic_dom_updater.html 2010-08-13 10:12:49 +0000
@@ -4,11 +4,11 @@
4 <title>Launchpad DynamicDomUpdater</title>4 <title>Launchpad DynamicDomUpdater</title>
55
6 <!-- YUI 3.0 Setup -->6 <!-- YUI 3.0 Setup -->
7 <script type="text/javascript" src="../../../icing/yui/yui/yui.js"></script>7 <script type="text/javascript" src="../../../../canonical/launchpad/icing/yui/yui/yui.js"></script>
8 <link rel="stylesheet" href="../../../icing/yui/cssreset/reset.css"/>8 <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssreset/reset.css"/>
9 <link rel="stylesheet" href="../../../icing/yui/cssfonts/fonts.css"/>9 <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssfonts/fonts.css"/>
10 <link rel="stylesheet" href="../../../icing/yui/cssbase/base.css"/>10 <link rel="stylesheet" href="../../../../canonical/launchpad/icing/yui/cssbase/base.css"/>
11 <link rel="stylesheet" href="../../test.css" />11 <link rel="stylesheet" href="../../../../canonical/launchpad/javascript/test.css" />
1212
13 <!-- The module under test -->13 <!-- The module under test -->
14 <script type="text/javascript" src="../lp_dynamic_dom_updater.js"></script>14 <script type="text/javascript" src="../lp_dynamic_dom_updater.js"></script>
1515
=== modified file 'lib/lp/soyuz/javascript/update_archive_build_statuses.js'
--- lib/canonical/launchpad/javascript/soyuz/update_archive_build_statuses.js 2009-11-24 09:30:01 +0000
+++ lib/lp/soyuz/javascript/update_archive_build_statuses.js 2010-08-13 10:12:49 +0000
@@ -11,7 +11,7 @@
11 * The second is the Archive/PPA source package table, the configuration of11 * The second is the Archive/PPA source package table, the configuration of
12 * which is set in source_package_table_dynamic_update_config.12 * which is set in source_package_table_dynamic_update_config.
13 */13 */
14YUI.add('soyuz.update_archive_build_statuses', function(Y){14YUI.add('lp.soyuz.update_archive_build_statuses', function(Y){
1515
16 /**16 /**
17 * Create one Launchpad client to be used by both dynamic tables.17 * Create one Launchpad client to be used by both dynamic tables.
@@ -86,7 +86,7 @@
86 var portlet = Y.one('div#build-status-summary');86 var portlet = Y.one('div#build-status-summary');
87 build_summary_portlet_dynamic_update_config.uri =87 build_summary_portlet_dynamic_update_config.uri =
88 LP.client.cache.context.self_link;88 LP.client.cache.context.self_link;
89 portlet.plug(Y.lp.DynamicDomUpdater,89 portlet.plug(Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater,
90 build_summary_portlet_dynamic_update_config);90 build_summary_portlet_dynamic_update_config);
91 });91 });
9292
@@ -110,8 +110,8 @@
110 domUpdateFunction: function(table_node, data_object){110 domUpdateFunction: function(table_node, data_object){
111 // For each source id in the data object:111 // For each source id in the data object:
112 Y.each(data_object, function(build_summary, source_id){112 Y.each(data_object, function(build_summary, source_id){
113 // Grab the related td element (and fail silently if it doesn't113 // Grab the related td element (and fail silently if it
114 // exist).114 // doesn't exist).
115 var td_elem = Y.one("#pubstatus" + source_id);115 var td_elem = Y.one("#pubstatus" + source_id);
116 if (td_elem === null) {116 if (td_elem === null) {
117 return;117 return;
@@ -221,12 +221,13 @@
221 * @config parameterEvaluatorFunction221 * @config parameterEvaluatorFunction
222 */222 */
223 parameterEvaluatorFunction: function(table_node){223 parameterEvaluatorFunction: function(table_node){
224 // Grab all the td's with the class 'build_status' and an additional224 // Grab all the td's with the class 'build_status' and an
225 // class of either 'NEEDSBUILD' or 'BUILDING':225 // additional class of either 'NEEDSBUILD' or 'BUILDING':
226 var td_list = table_node.all('td.build_status');226 var td_list = table_node.all('td.build_status');
227 var tds_needsbuild = td_list.filter(".NEEDSBUILD");227 var tds_needsbuild = td_list.filter(".NEEDSBUILD");
228 var tds_building = td_list.filter(".BUILDING");228 var tds_building = td_list.filter(".BUILDING");
229 var tds_fullybuilt_pending = td_list.filter(".FULLYBUILT_PENDING");229 var tds_fullybuilt_pending = td_list.filter(
230 ".FULLYBUILT_PENDING");
230231
231 if (tds_needsbuild.size() === 0 &&232 if (tds_needsbuild.size() === 0 &&
232 tds_building.size() === 0 &&233 tds_building.size() === 0 &&
@@ -275,8 +276,9 @@
275 if (table !== null) {276 if (table !== null) {
276 source_package_table_dynamic_update_config.uri =277 source_package_table_dynamic_update_config.uri =
277 LP.client.cache.context.self_link;278 LP.client.cache.context.self_link;
278 table.plug(Y.lp.DynamicDomUpdater,279 table.plug(Y.lp.soyuz.dynamic_dom_updater.DynamicDomUpdater,
279 source_package_table_dynamic_update_config);280 source_package_table_dynamic_update_config);
280 }281 }
281 });282 });
282}, "0.1", {"requires":["node", "lazr.anim", "anim", "soyuz.dynamic_dom_updater"]});283}, "0.1", {"requires":[
284 "node", "lazr.anim", "anim", "lp.soyuz.dynamic_dom_updater"]});
283285
=== modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt'
--- lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2010-07-14 14:58:30 +0000
+++ lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2010-08-13 10:12:49 +0000
@@ -56,7 +56,6 @@
56 ...56 ...
57 http://launchpad.dev/+icing/.../build/app/calendar.js57 http://launchpad.dev/+icing/.../build/app/calendar.js
58 http://launchpad.dev/+icing/.../yui_2.7.0b/build/calendar/assets/skins/sam/calendar.css58 http://launchpad.dev/+icing/.../yui_2.7.0b/build/calendar/assets/skins/sam/calendar.css
59 ...
6059
61Initially there are no subscriptions for a newly privatized PPA (although,60Initially there are no subscriptions for a newly privatized PPA (although,
62this may need to change, to add the owner/team). A heading is displayed61this may need to change, to add the owner/team). A heading is displayed
6362
=== modified file 'lib/lp/soyuz/templates/archive-packages.pt'
--- lib/lp/soyuz/templates/archive-packages.pt 2010-03-24 16:54:56 +0000
+++ lib/lp/soyuz/templates/archive-packages.pt 2010-08-13 10:12:49 +0000
@@ -8,23 +8,10 @@
8 >8 >
9<body>9<body>
10 <metal:block fill-slot="head_epilogue">10 <metal:block fill-slot="head_epilogue">
11 <tal:devmode condition="devmode">
12 <tal:archive_js define="lp_js string:${icingroot}/build">
13 <script type="text/javascript"
14 tal:attributes="src string:${lp_js}/soyuz/base.js">
15 </script>
16 <script type="text/javascript"
17 tal:attributes="src string:${lp_js}/soyuz/lp_dynamic_dom_updater.js">
18 </script>
19 <script type="text/javascript"
20 tal:attributes="src string:${lp_js}/soyuz/update_archive_build_statuses.js">
21 </script>
22 </tal:archive_js>
23 </tal:devmode>
24 <script type="text/javascript" id="repository-size-update"11 <script type="text/javascript" id="repository-size-update"
25 tal:condition="view/archive_url">12 tal:condition="view/archive_url">
26LPS.use('io-base', 'lazr.anim', 'node', 'soyuz-base',13LPS.use('io-base', 'lazr.anim', 'node', 'lp.soyuz.base',
27 'soyuz.update_archive_build_statuses', function(Y) {14 'lp.soyuz.update_archive_build_statuses', function(Y) {
2815
2916
30/*17/*
@@ -45,7 +32,7 @@
45 dispatchUpdate();32 dispatchUpdate();
46 };33 };
4734
48 var failure_message = Y.soyuz.makeFailureNode(35 var failure_message = Y.lp.soyuz.base.makeFailureNode(
49 'Failed to fetch repository size ...', retry_handler);36 'Failed to fetch repository size ...', retry_handler);
5037
51 args.container.set('innerHTML', '');38 args.container.set('innerHTML', '');
@@ -62,7 +49,7 @@
62 * Communicate an update is in progress and fire the XHR.49 * Communicate an update is in progress and fire the XHR.
63 */50 */
64function dispatchUpdate () {51function dispatchUpdate () {
65 in_progress_message = Y.soyuz.makeInProgressNode(52 in_progress_message = Y.lp.soyuz.base.makeInProgressNode(
66 'Fetching repository size ...')53 'Fetching repository size ...')
6754
68 var container = Y.one('#package-counters');55 var container = Y.one('#package-counters');
6956
=== modified file 'lib/lp/soyuz/templates/archive-subscribers.pt'
--- lib/lp/soyuz/templates/archive-subscribers.pt 2009-12-03 18:33:22 +0000
+++ lib/lp/soyuz/templates/archive-subscribers.pt 2010-08-13 10:12:49 +0000
@@ -10,11 +10,6 @@
10 <metal:block fill-slot="head_epilogue">10 <metal:block fill-slot="head_epilogue">
11 <metal:yui-dependencies11 <metal:yui-dependencies
12 use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" />12 use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" />
13
14 <tal:devmode condition="devmode">
15 <script type="text/javascript"
16 tal:attributes="src string:${lp_js}/soyuz/archivesubscribers_index.js"></script>
17 </tal:devmode>
18 </metal:block>13 </metal:block>
1914
20 <div metal:fill-slot="main">15 <div metal:fill-slot="main">
@@ -98,8 +93,8 @@
98 </form>93 </form>
99 </div><!-- class="portlet" -->94 </div><!-- class="portlet" -->
100 <script type="text/javascript" id="setup-archivesubscribers-index">95 <script type="text/javascript" id="setup-archivesubscribers-index">
101 LPS.use('soyuz.archivesubscribers_index', function(Y) {96 LPS.use('lp.soyuz.archivesubscribers_index', function(Y) {
102 Y.soyuz.setup_archivesubscribers_index();97 Y.lp.soyuz.archivesubscribers_index.setup_archivesubscribers_index();
103 });98 });
104 </script>99 </script>
105 </div>100 </div>
106101
=== added file 'lib/lp/soyuz/windmill/tests/test_yuitests.py'
--- lib/lp/soyuz/windmill/tests/test_yuitests.py 1970-01-01 00:00:00 +0000
+++ lib/lp/soyuz/windmill/tests/test_yuitests.py 2010-08-13 10:12:49 +0000
@@ -0,0 +1,21 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4"""Run YUI.test tests."""
5
6__metaclass__ = type
7__all__ = []
8
9from lp.testing import build_yui_unittest_suite, YUIUnitTestCase
10from lp.soyuz.windmill.testing import SoyuzWindmillLayer
11
12
13class SoyuzYUIUnitTestCase(YUIUnitTestCase):
14
15 layer = SoyuzWindmillLayer
16 suite_name = 'SoyuzYUIUnitTests'
17
18
19def test_suite():
20 app_testing_path = 'lp/soyuz/javascript/tests'
21 return build_yui_unittest_suite(app_testing_path, SoyuzYUIUnitTestCase)
022
=== modified file 'utilities/lp-deps.py'
--- utilities/lp-deps.py 2010-07-16 16:14:39 +0000
+++ utilities/lp-deps.py 2010-08-13 10:12:49 +0000
@@ -25,6 +25,7 @@
25 (os.path.join('lib', 'lp', 'code', 'javascript'), 'code'),25 (os.path.join('lib', 'lp', 'code', 'javascript'), 'code'),
26 (os.path.join('lib', 'lp', 'registry', 'javascript'), 'registry'),26 (os.path.join('lib', 'lp', 'registry', 'javascript'), 'registry'),
27 (os.path.join('lib', 'lp', 'translations', 'javascript'), 'translations'),27 (os.path.join('lib', 'lp', 'translations', 'javascript'), 'translations'),
28 (os.path.join('lib', 'lp', 'soyuz', 'javascript'), 'soyuz'),
28 ]29 ]
29ICING_ROOT = os.path.join(TOP, 'lib', 'canonical', 'launchpad', 'icing')30ICING_ROOT = os.path.join(TOP, 'lib', 'canonical', 'launchpad', 'icing')
30ICING_BUILD = os.path.join(ICING_ROOT, 'build')31ICING_BUILD = os.path.join(ICING_ROOT, 'build')