Merge lp:~rharding/launchpad/gallery-accordian_fix into lp:launchpad

Proposed by Richard Harding
Status: Merged
Approved by: j.c.sackett
Approved revision: no longer in the source branch.
Merged at revision: 14821
Proposed branch: lp:~rharding/launchpad/gallery-accordian_fix
Merge into: lp:launchpad
Prerequisite: lp:~rharding/launchpad/combo_yui_tests5
Diff against target: 183 lines (+15/-19)
11 files modified
buildout-templates/bin/combine-css.in (+2/-6)
buildout-templates/bin/combo-rootdir.in (+0/-2)
lib/lp/app/javascript/tests/test_beta_notification.html (+1/-1)
lib/lp/app/javascript/tests/test_listing_navigator.html (+1/-1)
lib/lp/app/templates/base-layout.pt (+3/-0)
lib/lp/bugs/javascript/tests/test_buglisting.html (+1/-1)
lib/lp/bugs/javascript/tests/test_bugtask_delete.html (+2/-3)
lib/lp/bugs/javascript/tests/test_bugtask_delete.js (+1/-1)
lib/lp/code/javascript/tests/test_branchmergeproposal.nominate.html (+1/-2)
lib/lp/registry/javascript/tests/test_structural_subscription.html (+1/-1)
lib/lp/registry/javascript/tests/test_team_mailinglists.html (+2/-1)
To merge this branch: bzr merge lp:~rharding/launchpad/gallery-accordian_fix
Reviewer Review Type Date Requested Status
j.c.sackett (community) Approve
Review via email: mp+93406@code.launchpad.net

This proposal supersedes a proposal from 2012-02-15.

Commit message

[r=jcsackett][no-qa] Remove lp/contrib by removing css and js into new homes and updating tests.

Description of the change

= Summary =
Ignore the poor branch name. This started out as fixing gallery-accordion for the combo loader so that it can be served via the build/js directory. In the end, the goal was to wipe out contrib and find better homes for all of the code there.

== Proposed Fix ==
We've moved the accordion and mustache code into lib/lp/app. We then moved the google analytics to the icing directory and pull it in with the rest of the GA setup code in the base-layout instead. Finally, we moved the webfonts to the place it was originally symlinked from.

== Implementation Details ==
These changes required us to update tests to pull from the build location vs the contrib directory, but in the end, since things are pulled in via YUI.use(), it doesn't require any changes to the real JS blocks.

== Tests ==
lib/lp/app/javascript/tests/test_listing_navigator.html
lib/lp/bugs/javascript/tests/test_buglisting.html
lib/lp/registry/javascript/tests/test_structural_subscription.html
lib/lp/app/javascript/tests/test_beta_notification.html
lib/lp/code/javascript/tests/test_branchmergeproposal.nominate.html

== Demo and Q/A ==
- The mustache templates when using the bug listings should still work fine
- The Google Analytics code should still load on each page load if you have the combo loader FF or not.
- You should still get the custom fonts css on every page load
- The structural subscriptions view should still be able to load the accordion code if you have the combo loader FF or not enabled.

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

Rick--

This looks good to me. Thanks for cutting through the underbrush of our JS some. :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout-templates/bin/combine-css.in'
2--- buildout-templates/bin/combine-css.in 2011-12-23 18:06:50 +0000
3+++ buildout-templates/bin/combine-css.in 2012-02-16 14:33:22 +0000
4@@ -11,10 +11,6 @@
5 from lp.scripts.utilities.js.jsbuild import ComboFile
6 from lp.scripts.utilities.js.combo import combine_files
7
8-# This constant helps us meet maximum line-length goals.
9-GALLERY_ACCORDION = 'yui3-gallery/gallery-accordion/assets/'
10-
11-
12 root = os.path.abspath('.')
13 root = os.path.normpath(${buildout:directory|path-repr})
14 icing = os.path.join(root, 'lib/canonical/launchpad/icing')
15@@ -42,8 +38,8 @@
16 'build/activator/assets/skins/sam/activator.css',
17 'build/choiceedit/assets/choiceedit-core.css',
18 'build/ordering/assets/ordering-core.css',
19- GALLERY_ACCORDION + 'gallery-accordion-core.css',
20- GALLERY_ACCORDION + 'skins/sam/gallery-accordion-skin.css',
21+ 'build/gallery-accordion/assets/gallery-accordion-core.css',
22+ 'build/gallery-accordion/assets/skins/sam/gallery-accordion-skin.css',
23 'build/sprite.css',
24 # Include our main stylesheets at the end so they
25 # take precedence over the others.
26
27=== modified file 'buildout-templates/bin/combo-rootdir.in'
28--- buildout-templates/bin/combo-rootdir.in 2012-02-15 03:54:32 +0000
29+++ buildout-templates/bin/combo-rootdir.in 2012-02-16 14:33:22 +0000
30@@ -33,8 +33,6 @@
31 find $BUILD_DIR/lp -name 'tests' -type d | xargs rm -rf
32
33 # We have to move some modules around.
34-cp lib/lp/contrib/javascript/lp.mustache.js $BUILD_DIR/lp
35-rm $BUILD_DIR/lp/contrib/mustache.js
36 rm $BUILD_DIR/lp/app/worlddata
37 cp lib/lp/services/worlddata/javascript/languages.js $BUILD_DIR/lp
38 cp lib/lp/app/longpoll/javascript/longpoll.js $BUILD_DIR/lp
39
40=== renamed directory 'lib/lp/contrib/javascript/google-analytics' => 'lib/canonical/launchpad/icing/google-analytics'
41=== renamed file 'lib/lp/contrib/css/ubuntu-webfonts.css' => 'lib/canonical/launchpad/icing/ubuntu-webfonts.css'
42=== removed symlink 'lib/canonical/launchpad/icing/ubuntu-webfonts.css'
43=== target was u'../../../lp/contrib/css/ubuntu-webfonts.css'
44=== renamed directory 'lib/lp/contrib/javascript/yui3-gallery/gallery-accordion' => 'lib/lp/app/javascript/gallery-accordion'
45=== renamed file 'lib/lp/contrib/javascript/lp.mustache.js' => 'lib/lp/app/javascript/mustache.js'
46=== modified file 'lib/lp/app/javascript/tests/test_beta_notification.html'
47--- lib/lp/app/javascript/tests/test_beta_notification.html 2012-02-10 13:51:00 +0000
48+++ lib/lp/app/javascript/tests/test_beta_notification.html 2012-02-16 14:33:22 +0000
49@@ -27,7 +27,7 @@
50
51 <!-- Dependencies -->
52 <script type="text/javascript"
53- src="../../../../../build/js/lp/lp.mustache.js"></script>
54+ src="../../../../../build/js/lp/app/mustache.js"></script>
55
56 <!-- The module under test. -->
57 <script type="text/javascript" src="../beta-notification.js"></script>
58
59=== modified file 'lib/lp/app/javascript/tests/test_listing_navigator.html'
60--- lib/lp/app/javascript/tests/test_listing_navigator.html 2012-02-10 13:51:00 +0000
61+++ lib/lp/app/javascript/tests/test_listing_navigator.html 2012-02-16 14:33:22 +0000
62@@ -43,7 +43,7 @@
63 <script type="text/javascript"
64 src="../../../../../build/js/lp/app/lp.js"></script>
65 <script type="text/javascript"
66- src="../../../../../build/js/lp/lp.mustache.js"></script>
67+ src="../../../../../build/js/lp/app/mustache.js"></script>
68 <script type="text/javascript"
69 src="../../../../../build/js/lp/app/overlay/overlay.js"></script>
70 <script type="text/javascript"
71
72=== modified file 'lib/lp/app/templates/base-layout.pt'
73--- lib/lp/app/templates/base-layout.pt 2012-02-13 18:51:42 +0000
74+++ lib/lp/app/templates/base-layout.pt 2012-02-16 14:33:22 +0000
75@@ -80,6 +80,9 @@
76 _gaq.push(['_setAllowHash', false]);
77 _gaq.push(['_trackPageview']);
78 </script>
79+ <script type="text/javascript"
80+ tal:condition="python: is_lpnet"
81+ tal:attributes="src string:${icingroot}/google-analytics/ga.js"></script>
82 <div class="yui-d0">
83 <div id="locationbar" class="login-logout">
84 <tal:login replace="structure context/@@login_status" />
85
86=== modified file 'lib/lp/bugs/javascript/tests/test_buglisting.html'
87--- lib/lp/bugs/javascript/tests/test_buglisting.html 2012-02-16 14:33:21 +0000
88+++ lib/lp/bugs/javascript/tests/test_buglisting.html 2012-02-16 14:33:22 +0000
89@@ -27,7 +27,7 @@
90
91 <!-- Dependencies -->
92 <script type="text/javascript"
93- src="../../../../../build/js/lp/lp.mustache.js"></script>
94+ src="../../../../../build/js/lp/app/mustache.js"></script>
95 <script type="text/javascript"
96 src="../../../../../build/js/lp/app/client.js"></script>
97 <script type="text/javascript"
98
99=== modified file 'lib/lp/bugs/javascript/tests/test_bugtask_delete.html'
100--- lib/lp/bugs/javascript/tests/test_bugtask_delete.html 2012-02-16 14:33:21 +0000
101+++ lib/lp/bugs/javascript/tests/test_bugtask_delete.html 2012-02-16 14:33:22 +0000
102@@ -30,11 +30,10 @@
103 <script type="text/javascript" src="../../../../../build/js/lp/app/client.js"></script>
104 <script type="text/javascript" src="../../../../../build/js/lp/app/errors.js"></script>
105 <script type="text/javascript" src="../../../../../build/js/lp/app/lp.js"></script>
106-
107+
108 <!-- Other dependencies -->
109 <script type="text/javascript" src="../../../../../build/js/lp/app/testing/mockio.js"></script>
110- <script type="text/javascript"
111- src="../../../contrib/javascript/mustache.j../../build/js/lp/s"><
112+ <script type="text/javascript" src="../../../../../build/js/lp/app/mustache.js"><
113 <script type="text/javascript" src="../../../../../build/js/lp/app/activator/activator.js"></script>
114 <script type="text/javascript" src="../../../../../build/js/lp/app/anim/anim.js"></script>
115 <script type="text/javascript" src="../../../../../build/js/lp/app/confirmationoverlay/confirmationoverlay.js"></script>
116
117=== modified file 'lib/lp/bugs/javascript/tests/test_bugtask_delete.js'
118--- lib/lp/bugs/javascript/tests/test_bugtask_delete.js 2012-01-31 02:45:45 +0000
119+++ lib/lp/bugs/javascript/tests/test_bugtask_delete.js 2012-02-16 14:33:22 +0000
120@@ -1,6 +1,6 @@
121 YUI().use('lp.testing.runner', 'lp.testing.mockio', 'base', 'test', 'console',
122 'node', 'node-event-simulate', 'lp.bugs.bugtask_index',
123- 'lp.app.picker',
124+ 'lp.app.picker', 'lp.mustache',
125 function(Y) {
126
127 var suite = new Y.Test.Suite("Bugtask deletion Tests");
128
129=== modified file 'lib/lp/code/javascript/tests/test_branchmergeproposal.nominate.html'
130--- lib/lp/code/javascript/tests/test_branchmergeproposal.nominate.html 2012-02-16 14:33:21 +0000
131+++ lib/lp/code/javascript/tests/test_branchmergeproposal.nominate.html 2012-02-16 14:33:22 +0000
132@@ -26,7 +26,7 @@
133 <link rel="stylesheet" href="../../../app/javascript/testing/test.css" />
134
135 <!-- Dependencies -->
136- <script type="text/javascript" src="../../../../../build/js/lp/lp.mustache.js"></script>
137+ <script type="text/javascript" src="../../../../../build/js/lp/app/mustache.js"></script>
138 <script type="text/javascript" src="../../../../../build/js/lp/app/client.js"></script>
139 <script type="text/javascript" src="../../../../../build/js/lp/app/lp.js"></script>
140 <script type="text/javascript" src="../../../../../build/js/lp/app/activator/activator.js"></script>
141@@ -72,4 +72,3 @@
142
143 </body>
144 </html>
145-
146
147=== removed directory 'lib/lp/contrib'
148=== removed directory 'lib/lp/contrib/css'
149=== removed directory 'lib/lp/contrib/javascript'
150=== removed symlink 'lib/lp/contrib/javascript/mustache.js'
151=== target was u'../../../../sourcecode/mustache.js/mustache.js'
152=== removed directory 'lib/lp/contrib/javascript/yui3-gallery'
153=== modified file 'lib/lp/registry/javascript/tests/test_structural_subscription.html'
154--- lib/lp/registry/javascript/tests/test_structural_subscription.html 2012-02-16 14:33:21 +0000
155+++ lib/lp/registry/javascript/tests/test_structural_subscription.html 2012-02-16 14:33:22 +0000
156@@ -43,7 +43,7 @@
157 <script type="text/javascript"
158 src="../../../../../build/js/lp/app/inlinehelp/inlinehelp.js"></script>
159 <script type="text/javascript"
160- src="../../../contrib/javascript/yui3-gallery/gallery-accordion/gallery-accordion.js"></script>
161+ src="../../../../../build/js/lp/app//gallery-accordion/gallery-accordion.js"></script>
162
163 <!-- The module under test. -->
164 <script type="text/javascript" src="../structural-subscription.js"></script>
165
166=== modified file 'lib/lp/registry/javascript/tests/test_team_mailinglists.html'
167--- lib/lp/registry/javascript/tests/test_team_mailinglists.html 2012-02-16 14:33:21 +0000
168+++ lib/lp/registry/javascript/tests/test_team_mailinglists.html 2012-02-16 14:33:22 +0000
169@@ -1,4 +1,5 @@
170 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
171+
172 "http://www.w3.org/TR/html4/strict.dtd">
173 <!--
174 Copyright 2012 Canonical Ltd. This software is licensed under the
175@@ -27,7 +28,7 @@
176
177 <!-- Dependencies -->
178 <script type="text/javascript"
179- src="../../../../../build/js/lp/lp.mustache.js"></script>
180+ src="../../../../../build/js/lp/app/mustache.js"></script>
181
182 <!-- The module under test. -->
183 <script type="text/javascript" src="../team_mailinglists.js"></script>