Merge lp:~linaro-infrastructure/linaro-android-frontend/rearrange-tabs-changes into lp:linaro-android-frontend
- rearrange-tabs-changes
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Milo Casagrande |
Approved revision: | 305 |
Merged at revision: | 295 |
Proposed branch: | lp:~linaro-infrastructure/linaro-android-frontend/rearrange-tabs-changes |
Merge into: | lp:linaro-android-frontend |
Diff against target: |
905 lines (+669/-109) 4 files modified
android_build/frontend/views.py (+6/-0) android_build/templates/index.html (+315/-59) group-fixture.json (+72/-0) static/index.js (+276/-50) |
To merge this branch: | bzr merge lp:~linaro-infrastructure/linaro-android-frontend/rearrange-tabs-changes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Milo Casagrande (community) | Approve | ||
Review via email: mp+141326@code.launchpad.net |
Commit message
Description of the change
This branch rearranges tabs and adds new according to the BP https:/
It uses the same approach and codebase as current http://
New groups were created in LP based on discussion with Vishal. To be able to view appropriate builds user needs to be a member of corresponding group.
All existing builds are accessible under "Engineer Builds" tab (Daily+Release tabs) but in future will contain new engineering builds. "Archive Bulids" tab contains also all builds and in future will contain "old" builds.
Georgy Redkozubov (gesha) wrote : | # |
Milo, thanks for review, answers are below.
> Hello Georgy!
>
> All in all changes look good.
>
> A couple of things though:
> - As said on IRC, with Chrome (23...), I cannot see the tabs, I just see plain
> search entry boxes, cannot understand if it is not loading the CSS or a
> problem with the JavaScript. I correctly see everything with Firefox. Might
> also be related to bug 1085007.
Yes, this is the same issue. Generally speaking, requests from a HTTPS site should always hit other HTTPS sites (otherwise we'll see insecure content warnings, or requests get blocked as we've discovered). So that's the problem.
> - The second strange behavior I see is with Firefox: if I scroll all the way
> down on the page (https:/
> try to open one of the link at the bottom of the (like the last one), the page
> scrolls all the way to the top of the table. It happens if I click or right
> click on a link in that position: more or less after half the length of the
> table. Firefox version is 17.0.1.
This issue is because there are none of these builds on our development instance :) if you create new user build and click on it from the index page you'll get the correct page :)
Milo Casagrande (milo) wrote : | # |
We should find a solution though for bug 1085007, but these changes are independent from that.
Preview Diff
1 | === modified file 'android_build/frontend/views.py' |
2 | --- android_build/frontend/views.py 2012-04-12 16:03:16 +0000 |
3 | +++ android_build/frontend/views.py 2012-12-27 10:45:26 +0000 |
4 | @@ -8,6 +8,7 @@ |
5 | login_required |
6 | ) |
7 | from django.contrib.auth.models import Group |
8 | +import simplejson as json |
9 | |
10 | |
11 | config_template = '''\ |
12 | @@ -53,8 +54,13 @@ |
13 | data = {} |
14 | if request.user.is_authenticated(): |
15 | data['userName'] = repr(str(request.user.username)) |
16 | + gl = [] |
17 | + for g in request.user.groups.all(): |
18 | + gl.append(g.name) |
19 | + data['userGroups'] = repr(str(' '.join(gl))) |
20 | else: |
21 | data['userName'] = 'null' |
22 | + data['userGroups'] = 'null' |
23 | data['jenkinsURL'] = repr(settings.JENKINS_URL_FOR_APP) |
24 | data['loginURL'] = repr(settings.LOGIN_URL) |
25 | l = [] |
26 | |
27 | === modified file 'android_build/templates/index.html' |
28 | --- android_build/templates/index.html 2012-12-27 07:51:44 +0000 |
29 | +++ android_build/templates/index.html 2012-12-27 10:45:26 +0000 |
30 | @@ -239,64 +239,320 @@ |
31 | |
32 | {% block content %} |
33 | <a id="new-link" href="new">New Build…</a> |
34 | -<div id="build-tabs"> |
35 | - <ul> |
36 | - <li><a id="official-tab" href="#official-builds">Official Builds</a></li> |
37 | - <li><a id="mine-tab" href="#my-builds">My Builds</a></li> |
38 | - <li><a id="all-tab" href="#all-builds">All Builds</a></li> |
39 | - <li><a id="restricted-tab" href="#restricted-builds">Restricted Builds</a></li> |
40 | - </ul> |
41 | - <div> |
42 | - <div id="official-builds"> |
43 | - Search: <input class="search" /> |
44 | - Status: <select> |
45 | - <option value="Any" selected="selected">Any</option> |
46 | - <option value="OK">Success</option> |
47 | - <option value="FAILED">Failure</option> |
48 | - <option value="ABORTED">Aborted</option> |
49 | - <option value="RUNNING">Building</option> |
50 | - <option value="">Never built</option> |
51 | - </select> |
52 | - <div class="build-table" id="official-build-table"></div> |
53 | - </div> |
54 | - <div id="my-builds"> |
55 | - Search: <input class="search" /> |
56 | - Outcome: <select> |
57 | - <option value="Any" selected="selected">Any</option> |
58 | - <option value="OK">Success</option> |
59 | - <option value="FAILED">Failure</option> |
60 | - <option value="ABORTED">Aborted</option> |
61 | - <option value="RUNNING">Building</option> |
62 | - <option value="">Never built</option> |
63 | - </select> |
64 | - <div class="build-table" id="my-build-table"></div> |
65 | - </div> |
66 | - <div id="all-builds"> |
67 | - Search: <input class="search" /> |
68 | - Outcome: <select> |
69 | - <option value="Any" selected="selected">Any</option> |
70 | - <option value="OK">Success</option> |
71 | - <option value="FAILED">Failure</option> |
72 | - <option value="ABORTED">Aborted</option> |
73 | - <option value="RUNNING">Building</option> |
74 | - <option value="">Never built</option> |
75 | - </select> |
76 | - <div class="build-table" id="all-build-table"></div> |
77 | - </div> |
78 | - |
79 | - <div id="restricted-builds"> |
80 | - Search: <input class="search" /> |
81 | - Outcome: <select> |
82 | - <option value="Any" selected="selected">Any</option> |
83 | - <option value="OK">Success</option> |
84 | - <option value="FAILED">Failure</option> |
85 | - <option value="ABORTED">Aborted</option> |
86 | - <option value="RUNNING">Building</option> |
87 | - <option value="">Never built</option> |
88 | - </select> |
89 | - <div class="build-table" id="restricted-build-table"></div> |
90 | - </div> |
91 | - |
92 | - </div> |
93 | +<div id="team-tabs"> |
94 | + <ul> |
95 | + <li><a id="engineer-tab" href="#engineer-tab">Engineer Builds</a></li> |
96 | + <li><a id="member-tab" href="#member-tab">Member Builds</a></li> |
97 | + <li><a id="user-tab" href="#user-tab">User Builds</a></li> |
98 | + <li><a id="community-tab" href="#community-tab">Community Builds</a></li> |
99 | + <li><a id="archive-tab" href="#archive-tab">Archive Builds</a></li> |
100 | + </ul> |
101 | + <div> |
102 | + <div id="engineer-tab"> |
103 | + <div id="esubteams"> |
104 | + <ul> |
105 | + <li><a href="#edaily-tab"><em>Daily</em></a></li> |
106 | + <li><a href="#erelease-tab"><em>Release</em></a></li> |
107 | + <li><a href="#erestricted-tab"><em>Restricted</em></a></li> |
108 | + </ul> |
109 | + <div> |
110 | + <div id="edaily-tab"> |
111 | + Search: <input class="search" /> |
112 | + Status: <select> |
113 | + <option value="Any" selected="selected">Any</option> |
114 | + <option value="OK">Success</option> |
115 | + <option value="FAILED">Failure</option> |
116 | + <option value="ABORTED">Aborted</option> |
117 | + <option value="RUNNING">Building</option> |
118 | + <option value="">Never built</option> |
119 | + </select> |
120 | + <div class="build-table" id="engineering-daily-build-table"></div> |
121 | + </div> |
122 | + <div id="erelease-tab"> |
123 | + Search: <input class="search" /> |
124 | + Status: <select> |
125 | + <option value="Any" selected="selected">Any</option> |
126 | + <option value="OK">Success</option> |
127 | + <option value="FAILED">Failure</option> |
128 | + <option value="ABORTED">Aborted</option> |
129 | + <option value="RUNNING">Building</option> |
130 | + <option value="">Never built</option> |
131 | + </select> |
132 | + <div class="build-table" id="engineering-release-build-table"></div> |
133 | + </div> |
134 | + <div id="erestricted-tab"> |
135 | + Search: <input class="search" /> |
136 | + Status: <select> |
137 | + <option value="Any" selected="selected">Any</option> |
138 | + <option value="OK">Success</option> |
139 | + <option value="FAILED">Failure</option> |
140 | + <option value="ABORTED">Aborted</option> |
141 | + <option value="RUNNING">Building</option> |
142 | + <option value="">Never built</option> |
143 | + </select> |
144 | + <div class="build-table" id="engineering-restricted-build-table"></div> |
145 | + </div> |
146 | + </div> |
147 | + </div> |
148 | + </div> |
149 | + <div id="member-tab"> |
150 | + <div id="msubteams"> |
151 | + <ul> |
152 | + <li><a id="mti" href=#mti"><em>TI</em></a></li> |
153 | + <li><a id="msamsung" href="#msamsung"><em>Samsung</em></a></li> |
154 | + <li><a id="marm" href="#marm"><em>ARM</em></a></li> |
155 | + <li><a id="mste" href="#mste"><em>ST-E</em></a></li> |
156 | + </ul> |
157 | + <div> |
158 | + <div id="mti"> |
159 | + <div id="mtitabs"> |
160 | + <ul> |
161 | + <li><a href="#mtidaily-tab"><em>Daily</em></a></li> |
162 | + <li><a href="#mtirelease-tab"><em>Release</em></a></li> |
163 | + <li><a href="#mtirestricted-tab"><em>Restricted</em></a></li> |
164 | + </ul> |
165 | + <div> |
166 | + <div id=mtidaily-tab> |
167 | + Search: <input class="search" /> |
168 | + Status: <select> |
169 | + <option value="Any" selected="selected">Any</option> |
170 | + <option value="OK">Success</option> |
171 | + <option value="FAILED">Failure</option> |
172 | + <option value="ABORTED">Aborted</option> |
173 | + <option value="RUNNING">Building</option> |
174 | + <option value="">Never built</option> |
175 | + </select> |
176 | + <div class="build-table" id="member-ti-build-table"></div> |
177 | + </div> |
178 | + <div id=mtirelease-tab> |
179 | + Search: <input class="search" /> |
180 | + Status: <select> |
181 | + <option value="Any" selected="selected">Any</option> |
182 | + <option value="OK">Success</option> |
183 | + <option value="FAILED">Failure</option> |
184 | + <option value="ABORTED">Aborted</option> |
185 | + <option value="RUNNING">Building</option> |
186 | + <option value="">Never built</option> |
187 | + </select> |
188 | + <div class="build-table" id="member-ti-release-build-table"></div> |
189 | + </div> |
190 | + <div id=mtirestricted-tab> |
191 | + Search: <input class="search" /> |
192 | + Status: <select> |
193 | + <option value="Any" selected="selected">Any</option> |
194 | + <option value="OK">Success</option> |
195 | + <option value="FAILED">Failure</option> |
196 | + <option value="ABORTED">Aborted</option> |
197 | + <option value="RUNNING">Building</option> |
198 | + <option value="">Never built</option> |
199 | + </select> |
200 | + <div class="build-table" id="member-ti-restricted-build-table"></div> |
201 | + </div> |
202 | + </div> |
203 | + </div> |
204 | + </div> |
205 | + <div id="msamsung"> |
206 | + <div id="msamsungtabs"> |
207 | + <ul> |
208 | + <li><a href="#msamsungdaily-tab"><em>Daily</em></a></li> |
209 | + <li><a href="#msamsungrelease-tab"><em>Release</em></a></li> |
210 | + <li><a href="#msamsungestricted-tab"><em>Restricted</em></a></li> |
211 | + </ul> |
212 | + <div> |
213 | + <div id=msamsungdaily-tab> |
214 | + Search: <input class="search" /> |
215 | + Status: <select> |
216 | + <option value="Any" selected="selected">Any</option> |
217 | + <option value="OK">Success</option> |
218 | + <option value="FAILED">Failure</option> |
219 | + <option value="ABORTED">Aborted</option> |
220 | + <option value="RUNNING">Building</option> |
221 | + <option value="">Never built</option> |
222 | + </select> |
223 | + <div class="build-table" id="member-samsung-build-table"></div> |
224 | + </div> |
225 | + <div id=msamsungrelease-tab> |
226 | + Search: <input class="search" /> |
227 | + Status: <select> |
228 | + <option value="Any" selected="selected">Any</option> |
229 | + <option value="OK">Success</option> |
230 | + <option value="FAILED">Failure</option> |
231 | + <option value="ABORTED">Aborted</option> |
232 | + <option value="RUNNING">Building</option> |
233 | + <option value="">Never built</option> |
234 | + </select> |
235 | + <div class="build-table" id="member-samsung-release-build-table"></div> |
236 | + </div> |
237 | + <div id=msamsungrestricted-tab> |
238 | + Search: <input class="search" /> |
239 | + Status: <select> |
240 | + <option value="Any" selected="selected">Any</option> |
241 | + <option value="OK">Success</option> |
242 | + <option value="FAILED">Failure</option> |
243 | + <option value="ABORTED">Aborted</option> |
244 | + <option value="RUNNING">Building</option> |
245 | + <option value="">Never built</option> |
246 | + </select> |
247 | + <div class="build-table" id="member-samsung-restricted-build-table"></div> |
248 | + </div> |
249 | + </div> |
250 | + </div> |
251 | + </div> |
252 | + <div id="arm"> |
253 | + <div id="marmtabs"> |
254 | + <ul> |
255 | + <li><a href="#marmdaily-tab"><em>Daily</em></a></li> |
256 | + <li><a href="#marmrelease-tab"><em>Release</em></a></li> |
257 | + <li><a href="#marmrestricted-tab"><em>Restricted</em></a></li> |
258 | + </ul> |
259 | + <div> |
260 | + <div id=marmdaily-tab> |
261 | + Search: <input class="search" /> |
262 | + Status: <select> |
263 | + <option value="Any" selected="selected">Any</option> |
264 | + <option value="OK">Success</option> |
265 | + <option value="FAILED">Failure</option> |
266 | + <option value="ABORTED">Aborted</option> |
267 | + <option value="RUNNING">Building</option> |
268 | + <option value="">Never built</option> |
269 | + </select> |
270 | + <div class="build-table" id="member-arm-build-table"></div> |
271 | + </div> |
272 | + <div id=marmrelease-tab> |
273 | + Search: <input class="search" /> |
274 | + Status: <select> |
275 | + <option value="Any" selected="selected">Any</option> |
276 | + <option value="OK">Success</option> |
277 | + <option value="FAILED">Failure</option> |
278 | + <option value="ABORTED">Aborted</option> |
279 | + <option value="RUNNING">Building</option> |
280 | + <option value="">Never built</option> |
281 | + </select> |
282 | + <div class="build-table" id="member-arm-release-build-table"></div> |
283 | + </div> |
284 | + <div id=marmrestricted-tab> |
285 | + Search: <input class="search" /> |
286 | + Status: <select> |
287 | + <option value="Any" selected="selected">Any</option> |
288 | + <option value="OK">Success</option> |
289 | + <option value="FAILED">Failure</option> |
290 | + <option value="ABORTED">Aborted</option> |
291 | + <option value="RUNNING">Building</option> |
292 | + <option value="">Never built</option> |
293 | + </select> |
294 | + <div class="build-table" id="member-arm-restricted-build-table"></div> |
295 | + </div> |
296 | + </div> |
297 | + </div> |
298 | + </div> |
299 | + <div id="ste"> |
300 | + <div id="mstetabs"> |
301 | + <ul> |
302 | + <li><a href="#mstedaily-tab"><em>Daily</em></a></li> |
303 | + <li><a href="#msterelease-tab"><em>Release</em></a></li> |
304 | + <li><a href="#msterestricted-tab"><em>Restricted</em></a></li> |
305 | + </ul> |
306 | + <div> |
307 | + <div id=mstedaily-tab> |
308 | + Search: <input class="search" /> |
309 | + Status: <select> |
310 | + <option value="Any" selected="selected">Any</option> |
311 | + <option value="OK">Success</option> |
312 | + <option value="FAILED">Failure</option> |
313 | + <option value="ABORTED">Aborted</option> |
314 | + <option value="RUNNING">Building</option> |
315 | + <option value="">Never built</option> |
316 | + </select> |
317 | + <div class="build-table" id="member-ste-build-table"></div> |
318 | + </div> |
319 | + <div id=msterelease-tab> |
320 | + Search: <input class="search" /> |
321 | + Status: <select> |
322 | + <option value="Any" selected="selected">Any</option> |
323 | + <option value="OK">Success</option> |
324 | + <option value="FAILED">Failure</option> |
325 | + <option value="ABORTED">Aborted</option> |
326 | + <option value="RUNNING">Building</option> |
327 | + <option value="">Never built</option> |
328 | + </select> |
329 | + <div class="build-table" id="member-ste-release-build-table"></div> |
330 | + </div> |
331 | + <div id=msterestricted-tab> |
332 | + Search: <input class="search" /> |
333 | + Status: <select> |
334 | + <option value="Any" selected="selected">Any</option> |
335 | + <option value="OK">Success</option> |
336 | + <option value="FAILED">Failure</option> |
337 | + <option value="ABORTED">Aborted</option> |
338 | + <option value="RUNNING">Building</option> |
339 | + <option value="">Never built</option> |
340 | + </select> |
341 | + <div class="build-table" id="member-ste-restricted-build-table"></div> |
342 | + </div> |
343 | + </div> |
344 | + </div> |
345 | + </div> |
346 | + </div> |
347 | + </div> |
348 | + </div> |
349 | + <div id="user-tab"> |
350 | + Search: <input class="search" /> |
351 | + Status: <select> |
352 | + <option value="Any" selected="selected">Any</option> |
353 | + <option value="OK">Success</option> |
354 | + <option value="FAILED">Failure</option> |
355 | + <option value="ABORTED">Aborted</option> |
356 | + <option value="RUNNING">Building</option> |
357 | + <option value="">Never built</option> |
358 | + </select> |
359 | + <div class="build-table" id="user-build-table"></div> |
360 | + </div> |
361 | + <div id="community-tab"> |
362 | + Search: <input class="search" /> |
363 | + Status: <select> |
364 | + <option value="Any" selected="selected">Any</option> |
365 | + <option value="OK">Success</option> |
366 | + <option value="FAILED">Failure</option> |
367 | + <option value="ABORTED">Aborted</option> |
368 | + <option value="RUNNING">Building</option> |
369 | + <option value="">Never built</option> |
370 | + </select> |
371 | + <div class="build-table" id="community-build-table"></div> |
372 | + </div> |
373 | + <div id="archive-tab"> |
374 | + <div id="asubteams"> |
375 | + <ul> |
376 | + <li><a href="#aall-tab"><em>All</em></a></li> |
377 | + <li><a href="#arestricted-tab"><em>Restricted</em></a></li> |
378 | + </ul> |
379 | + <div> |
380 | + <div id="aall-tab"> |
381 | + Search: <input class="search" /> |
382 | + Status: <select> |
383 | + <option value="Any" selected="selected">Any</option> |
384 | + <option value="OK">Success</option> |
385 | + <option value="FAILED">Failure</option> |
386 | + <option value="ABORTED">Aborted</option> |
387 | + <option value="RUNNING">Building</option> |
388 | + <option value="">Never built</option> |
389 | + </select> |
390 | + <div class="build-table" id="archive-all-build-table"></div> |
391 | + </div> |
392 | + <div id="arestricted-tab"> |
393 | + Search: <input class="search" /> |
394 | + Status: <select> |
395 | + <option value="Any" selected="selected">Any</option> |
396 | + <option value="OK">Success</option> |
397 | + <option value="FAILED">Failure</option> |
398 | + <option value="ABORTED">Aborted</option> |
399 | + <option value="RUNNING">Building</option> |
400 | + <option value="">Never built</option> |
401 | + </select> |
402 | + <div class="build-table" id="archive-restricted-build-table"></div> |
403 | + </div> |
404 | + </div> |
405 | + </div> |
406 | + </div> |
407 | + </div> |
408 | </div> |
409 | {% endblock %} |
410 | |
411 | === modified file 'group-fixture.json' |
412 | --- group-fixture.json 2012-04-23 15:05:01 +0000 |
413 | +++ group-fixture.json 2012-12-27 10:45:26 +0000 |
414 | @@ -22,5 +22,77 @@ |
415 | }, |
416 | "pk" : 3, |
417 | "model" : "auth.group" |
418 | + }, |
419 | + { |
420 | + "fields" : { |
421 | + "permissions" : [], |
422 | + "name" : "linaro-android-member-ti" |
423 | + }, |
424 | + "pk" : 4, |
425 | + "model" : "auth.group" |
426 | + }, |
427 | + { |
428 | + "fields" : { |
429 | + "permissions" : [], |
430 | + "name" : "linaro-android-member-ti-restricted" |
431 | + }, |
432 | + "pk" : 5, |
433 | + "model" : "auth.group" |
434 | + }, |
435 | + { |
436 | + "fields" : { |
437 | + "permissions" : [], |
438 | + "name" : "linaro-android-member-samsung" |
439 | + }, |
440 | + "pk" : 6, |
441 | + "model" : "auth.group" |
442 | + }, |
443 | + { |
444 | + "fields" : { |
445 | + "permissions" : [], |
446 | + "name" : "linaro-android-member-samsung-restricted" |
447 | + }, |
448 | + "pk" : 7, |
449 | + "model" : "auth.group" |
450 | + }, |
451 | + { |
452 | + "fields" : { |
453 | + "permissions" : [], |
454 | + "name" : "linaro-android-member-arm" |
455 | + }, |
456 | + "pk" : 8, |
457 | + "model" : "auth.group" |
458 | + }, |
459 | + { |
460 | + "fields" : { |
461 | + "permissions" : [], |
462 | + "name" : "linaro-android-member-arm-restricted" |
463 | + }, |
464 | + "pk" : 9, |
465 | + "model" : "auth.group" |
466 | + }, |
467 | + { |
468 | + "fields" : { |
469 | + "permissions" : [], |
470 | + "name" : "linaro-android-member-ste" |
471 | + }, |
472 | + "pk" : 10, |
473 | + "model" : "auth.group" |
474 | + }, |
475 | + { |
476 | + "fields" : { |
477 | + "permissions" : [], |
478 | + "name" : "linaro-android-member-ste-restricted" |
479 | + }, |
480 | + "pk" : 11, |
481 | + "model" : "auth.group" |
482 | + }, |
483 | + { |
484 | + "fields" : { |
485 | + "permissions" : [], |
486 | + "name" : "linaro-android-community" |
487 | + }, |
488 | + "pk" : 12, |
489 | + "model" : "auth.group" |
490 | } |
491 | ] |
492 | |
493 | === modified file 'static/index.js' |
494 | --- static/index.js 2012-04-23 16:40:33 +0000 |
495 | +++ static/index.js 2012-12-27 10:45:26 +0000 |
496 | @@ -2,62 +2,216 @@ |
497 | 'node', 'tabview', 'datatable', 'history', 'recordset-base', 'recordset-filter', 'io', 'json', 'linaro-trivia', |
498 | function (Y) { |
499 | var history = new Y.HistoryHash(), |
500 | - tabview = new Y.TabView({srcNode: '#build-tabs'}); |
501 | - |
502 | - tabview.render(); |
503 | - |
504 | - tabview.after( |
505 | + esubteam_tabview = new Y.TabView({ srcNode: '#esubteams' }); |
506 | + esubteam_tabview.render(); |
507 | + mti_tabview = new Y.TabView({ srcNode: '#mtitabs' }); |
508 | + mti_tabview.render(); |
509 | + mste_tabview = new Y.TabView({ srcNode: '#mstetabs' }); |
510 | + mste_tabview.render(); |
511 | + msamsung_tabview = new Y.TabView({ srcNode: '#msamsungtabs' }); |
512 | + msamsung_tabview.render(); |
513 | + marm_tabview = new Y.TabView({ srcNode: '#marmtabs' }); |
514 | + marm_tabview.render(); |
515 | + msubteam_tabview = new Y.TabView({ srcNode: '#msubteams' }); |
516 | + msubteam_tabview.render(); |
517 | + asubteam_tabview = new Y.TabView({ srcNode: '#asubteams' }); |
518 | + asubteam_tabview.render(); |
519 | + team_tabview = new Y.TabView({srcNode: '#team-tabs'}); |
520 | + team_tabview.render(); |
521 | + |
522 | + var groupsArray = globalConfig.userGroups ? globalConfig.userGroups.split(' ') : []; |
523 | + |
524 | + team_tabview.after( |
525 | 'selectionChange', |
526 | function (e) { |
527 | var val = e.newVal.get('srcNode').get('id').replace(/-tab/, ''); |
528 | - history.addValue('builds', val); |
529 | + history.addValue('teams', val); |
530 | } |
531 | ); |
532 | |
533 | function selectTabByName (name) { |
534 | var node = Y.one('#' + name + '-tab'); |
535 | if (!node) return; |
536 | - tabview.selectChild(Y.Widget.getByNode(node).get('index')); |
537 | + team_tabview.selectChild(Y.Widget.getByNode(node).get('index')); |
538 | } |
539 | |
540 | function logInAndGoToMyBuilds (self) { |
541 | - window.location.href = globalConfig.loginURL + '?next=' + location.pathname + '%23builds=mine'; |
542 | + window.location.href = globalConfig.loginURL + '?next=' + location.pathname + '%23teams=' + history.get('teams'); |
543 | + } |
544 | + |
545 | + function in_array (array, elem) { |
546 | + for (var i = 0; i < array.length; i++) { |
547 | + if (array[i] === elem) { |
548 | + return true; |
549 | + } |
550 | + } |
551 | + return false; |
552 | } |
553 | |
554 | Y.on( |
555 | 'history:change', |
556 | function (e) { |
557 | if (e.src === Y.HistoryHash.SRC_HASH) { |
558 | - if (e.changed.builds) { |
559 | - if (e.changed.builds.newVal == 'mine' && !globalConfig.userName) { |
560 | + if (e.changed.teams) { |
561 | + if ((e.changed.teams.newVal == 'user' && !globalConfig.userName) || |
562 | + (e.changed.teams.newVal == 'member' && !globalConfig.userName)) { |
563 | // you can get here by, for example, switching away from the my tab in window 1, |
564 | // logging out in window 2, then using the back button in window 1 |
565 | logInAndGoToMyBuilds(); |
566 | } else { |
567 | - selectTabByName(e.changed.builds.newVal); |
568 | + selectTabByName(e.changed.teams.newVal); |
569 | } |
570 | - } else if (e.removed.builds) { |
571 | - tabview.selectChild(0); |
572 | + } else if (e.removed.teams) { |
573 | + team_tabview.selectChild(0); |
574 | } |
575 | } |
576 | }); |
577 | |
578 | - tabview.on( |
579 | + esubteam_tabview.on( |
580 | + 'render', |
581 | + function (e) { |
582 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-restricted')) { |
583 | + var restrictedBuildsTab = esubteam_tabview.item(2); |
584 | + restrictedBuildsTab.on('click', function (e) { e.preventDefault(); }); |
585 | + var restrictedlink = restrictedBuildsTab.get('boundingBox').one('a'); |
586 | + restrictedlink.setStyle('color', 'grey'); |
587 | + restrictedlink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=engineer'); |
588 | + } |
589 | + }); |
590 | + |
591 | + asubteam_tabview.on( |
592 | + 'render', |
593 | + function (e) { |
594 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-restricted')) { |
595 | + var restrictedBuildsTab = asubteam_tabview.item(1); |
596 | + restrictedBuildsTab.on('click', function (e) { e.preventDefault(); }); |
597 | + var restrictedlink = restrictedBuildsTab.get('boundingBox').one('a'); |
598 | + restrictedlink.setStyle('color', 'grey'); |
599 | + restrictedlink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=archive'); |
600 | + } |
601 | + }); |
602 | + |
603 | + mti_tabview.on( |
604 | + 'render', |
605 | + function (e) { |
606 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-member-ti')) { |
607 | + var dailyBuildsTab = mti_tabview.item(0); |
608 | + mti_tabview.item(0).hide(); |
609 | + var releaseBuildsTab = mti_tabview.item(1); |
610 | + dailyBuildsTab.on('click', function (e) { e.preventDefault(); }); |
611 | + releaseBuildsTab.on('click', function (e) { e.preventDefault(); }); |
612 | + var dailylink = dailyBuildsTab.get('boundingBox').one('a'); |
613 | + var releaselink = releaseBuildsTab.get('boundingBox').one('a'); |
614 | + dailylink.setStyle('color', 'grey'); |
615 | + releaselink.setStyle('color', 'grey'); |
616 | + dailylink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=mtidaily'); |
617 | + releaselink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=mtirelease'); |
618 | + } |
619 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-member-ti-restricted')) { |
620 | + var restrictedBuildsTab = mti_tabview.item(2); |
621 | + restrictedBuildsTab.on('click', function (e) { e.preventDefault(); }); |
622 | + var restrictedlink = restrictedBuildsTab.get('boundingBox').one('a'); |
623 | + restrictedlink.setStyle('color', 'grey'); |
624 | + restrictedlink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=mtirestricted'); |
625 | + } |
626 | + }); |
627 | + |
628 | + mste_tabview.on( |
629 | + 'render', |
630 | + function (e) { |
631 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-member-ste')) { |
632 | + var dailyBuildsTab = mste_tabview.item(0); |
633 | + var releaseBuildsTab = mste_tabview.item(1); |
634 | + dailyBuildsTab.on('click', function (e) { e.preventDefault(); }); |
635 | + releaseBuildsTab.on('click', function (e) { e.preventDefault(); }); |
636 | + var dailylink = dailyBuildsTab.get('boundingBox').one('a'); |
637 | + var releaselink = releaseBuildsTab.get('boundingBox').one('a'); |
638 | + dailylink.setStyle('color', 'grey'); |
639 | + releaselink.setStyle('color', 'grey'); |
640 | + dailylink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=mstedaily'); |
641 | + releaselink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=msterelease'); |
642 | + } |
643 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-member-ste-restricted')) { |
644 | + var restrictedBuildsTab = mste_tabview.item(2); |
645 | + restrictedBuildsTab.on('click', function (e) { e.preventDefault(); }); |
646 | + var restrictedlink = restrictedBuildsTab.get('boundingBox').one('a'); |
647 | + restrictedlink.setStyle('color', 'grey'); |
648 | + restrictedlink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=msterestricted'); |
649 | + } |
650 | + }); |
651 | + |
652 | + msamsung_tabview.on( |
653 | + 'render', |
654 | + function (e) { |
655 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-member-samsung')) { |
656 | + var dailyBuildsTab = msamsung_tabview.item(0); |
657 | + var releaseBuildsTab = msamsung_tabview.item(1); |
658 | + dailyBuildsTab.on('click', function (e) { e.preventDefault(); }); |
659 | + releaseBuildsTab.on('click', function (e) { e.preventDefault(); }); |
660 | + var dailylink = dailyBuildsTab.get('boundingBox').one('a'); |
661 | + var releaselink = releaseBuildsTab.get('boundingBox').one('a'); |
662 | + dailylink.setStyle('color', 'grey'); |
663 | + releaselink.setStyle('color', 'grey'); |
664 | + dailylink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=msamsungdaily'); |
665 | + releaselink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=msamsungrelease'); |
666 | + } |
667 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-member-samsung-restricted')) { |
668 | + var restrictedBuildsTab = msamsung_tabview.item(2); |
669 | + restrictedBuildsTab.on('click', function (e) { e.preventDefault(); }); |
670 | + var restrictedlink = restrictedBuildsTab.get('boundingBox').one('a'); |
671 | + restrictedlink.setStyle('color', 'grey'); |
672 | + restrictedlink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=msamsungrestricted'); |
673 | + } |
674 | + }); |
675 | + |
676 | + marm_tabview.on( |
677 | + 'render', |
678 | + function (e) { |
679 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-member-arm')) { |
680 | + var dailyBuildsTab = marm_tabview.item(0); |
681 | + var releaseBuildsTab = marm_tabview.item(1); |
682 | + dailyBuildsTab.on('click', function (e) { e.preventDefault(); }); |
683 | + releaseBuildsTab.on('click', function (e) { e.preventDefault(); }); |
684 | + var dailylink = dailyBuildsTab.get('boundingBox').one('a'); |
685 | + var releaselink = releaseBuildsTab.get('boundingBox').one('a'); |
686 | + dailylink.setStyle('color', 'grey'); |
687 | + releaselink.setStyle('color', 'grey'); |
688 | + dailylink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=marmdaily'); |
689 | + releaselink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=marmrelease'); |
690 | + } |
691 | + if (!globalConfig.userName || !in_array(groupsArray, 'linaro-android-member-arm-restricted')) { |
692 | + var restrictedBuildsTab = marm_tabview.item(2); |
693 | + restrictedBuildsTab.on('click', function (e) { e.preventDefault(); }); |
694 | + var restrictedlink = restrictedBuildsTab.get('boundingBox').one('a'); |
695 | + restrictedlink.setStyle('color', 'grey'); |
696 | + restrictedlink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=marmrestricted'); |
697 | + } |
698 | + }); |
699 | + |
700 | + team_tabview.on( |
701 | 'render', |
702 | function (e) { |
703 | if (!globalConfig.userName) { |
704 | - var myBuildsTab = tabview.item(1); |
705 | - myBuildsTab.on('click', function (e) { e.preventDefault(); }); |
706 | - var link = myBuildsTab.get('boundingBox').one('a'); |
707 | - link.setStyle('color', 'grey'); |
708 | - link.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23builds=mine'); |
709 | + var userBuildsTab = team_tabview.item(2); |
710 | + userBuildsTab.on('click', function (e) { e.preventDefault(); }); |
711 | + var userlink = userBuildsTab.get('boundingBox').one('a'); |
712 | + userlink.setStyle('color', 'grey'); |
713 | + userlink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=user'); |
714 | + } |
715 | + if (!globalConfig.userName || !globalConfig.userGroups.search(/member/)) { |
716 | + var memberBuildsTab = team_tabview.item(1); |
717 | + memberBuildsTab.on('click', function (e) { e.preventDefault(); }); |
718 | + var memberlink = memberBuildsTab.get('boundingBox').one('a'); |
719 | + memberlink.setStyle('color', 'grey'); |
720 | + memberlink.setAttribute('href', globalConfig.loginURL + '?next=' + location.pathname + '%23teams=member'); |
721 | } |
722 | }); |
723 | |
724 | - if (history.get('builds') == 'mine' && !globalConfig.userName) { |
725 | + if ((history.get('teams') == 'user' && !globalConfig.userName) || |
726 | + (history.get('teams') == 'member' && !globalConfig.userName)) { |
727 | logInAndGoToMyBuilds(); |
728 | } else { |
729 | - selectTabByName(history.get('builds') || 'official'); |
730 | + selectTabByName(history.get('teams') || 'engineer'); |
731 | } |
732 | |
733 | var treeExp = 'jobs[name,lastBuild[result,timestamp,duration]]'; |
734 | @@ -106,7 +260,7 @@ |
735 | } |
736 | }); |
737 | |
738 | - Y.extend( |
739 | + Y.extend( |
740 | MyDataTableDataFilter, Y.Plugin.Base, { |
741 | newData: function (records) { |
742 | var recordset = new Y.Recordset({records: records}); |
743 | @@ -145,11 +299,15 @@ |
744 | }); |
745 | |
746 | function formatCell (o) { |
747 | + // REVISIT: The current format is builds/teamname/jobname |
748 | + // ex: ~linaro-android-restricted/vexpress-rtsm-isw-jb-test |
749 | + // This must change to builds/teamname/buildtype/jobname |
750 | + //ex: ~linaro-android-official-builders/~linaro-android-restricted/vexpress-rtsm-isw-jb-test |
751 | return '<a href="builds/' + o.data.name + '/">' + o.value + '</a>'; |
752 | } |
753 | |
754 | + |
755 | function makeDT(id, filter) { |
756 | - |
757 | var columns = [ |
758 | {label:"Status", key: 'status'}, |
759 | {label:"Name", key: 'name'}, |
760 | @@ -166,21 +324,6 @@ |
761 | |
762 | dt.render(id); |
763 | |
764 | - dt.after( |
765 | - 'recordsetChange', |
766 | - function (e) { |
767 | - var rows = e.target.get('contentBox').all('tbody tr'); |
768 | - |
769 | - // there must be better ways to do this... |
770 | - rows.on( |
771 | - 'click', |
772 | - function (e) { |
773 | - var buildName = e.target.ancestor('tr').all('td').item(1).get('text'); |
774 | - location.href = 'builds/'+buildName + '/'; |
775 | - }); |
776 | - } |
777 | - ); |
778 | - |
779 | var tableNode = Y.one(id); |
780 | |
781 | var selectNode = tableNode.ancestor('div').one('select'); |
782 | @@ -210,22 +353,104 @@ |
783 | |
784 | var tables = [ |
785 | makeDT( |
786 | - "#official-build-table", |
787 | - function (item) { return item.getValue('name').search(/^~linaro-android\//) == 0; } |
788 | - ), |
789 | - makeDT( |
790 | - "#my-build-table", |
791 | + "#engineering-daily-build-table", |
792 | + function (item) { |
793 | + return item.getValue('name').search(/^~linaro-android\/(?!.*release).*$/) == 0; |
794 | + }), |
795 | + makeDT( |
796 | + "#engineering-release-build-table", |
797 | + function (item) { |
798 | + return item.getValue('name').search(/^~linaro-android\/.*?(?:release).*$/) == 0; |
799 | + }), |
800 | + makeDT( |
801 | + "#engineering-restricted-build-table", |
802 | + function (item) { |
803 | + return item.getValue('name').search(/^~linaro-android-restricted\//) == 0; |
804 | + }), |
805 | + makeDT( |
806 | + "#member-ti-build-table", |
807 | + function (item) { |
808 | + var group = 'linaro-android-member-ti'; |
809 | + var pattern = new RegExp("^~" + group + "\/(?!.*release).*$"); |
810 | + return (item.getValue('name').search(pattern) == 0 && in_array(groupsArray, group)); |
811 | + }), |
812 | + makeDT( |
813 | + "#member-ti-release-build-table", |
814 | + function (item) { |
815 | + return item.getValue('name').search(/^~linaro-android-member-ti\/.*?(?:release).*$/) == 0; |
816 | + }), |
817 | + makeDT( |
818 | + "#member-ti-restricted-build-table", |
819 | + function (item) { |
820 | + return item.getValue('name').search(/^~linaro-android-member-ti-restricted\//) == 0; |
821 | + }), |
822 | + makeDT( |
823 | + "#member-samsung-build-table", |
824 | + function (item) { |
825 | + var group = 'linaro-android-member-samsung'; |
826 | + var pattern = new RegExp("^~" + group + "\/(?!.*release).*$"); |
827 | + return (item.getValue('name').search(pattern) == 0 && in_array(groupsArray, group)); |
828 | + }), |
829 | + makeDT( |
830 | + "#member-samsung-release-build-table", |
831 | + function (item) { |
832 | + return item.getValue('name').search(/^~linaro-android-member-samsung\/.*?(?:release).*$/) == 0; |
833 | + }), |
834 | + makeDT( |
835 | + "#member-samsung-restricted-build-table", |
836 | + function (item) { |
837 | + return item.getValue('name').search(/^~linaro-android-member-samsung-restricted\//) == 0; |
838 | + }), |
839 | + makeDT( |
840 | + "#member-arm-build-table", |
841 | + function (item) { |
842 | + var group = 'linaro-android-member-arm'; |
843 | + var pattern = new RegExp("^~" + group + "\/(?!.*release).*$"); |
844 | + return (item.getValue('name').search(pattern) == 0 && in_array(groupsArray, group)); |
845 | + }), |
846 | + makeDT( |
847 | + "#member-arm-release-build-table", |
848 | + function (item) { |
849 | + return item.getValue('name').search(/^~linaro-android-member-arm\/.*?(?:release).*$/) == 0; |
850 | + }), |
851 | + makeDT( |
852 | + "#member-arm-restricted-build-table", |
853 | + function (item) { |
854 | + return item.getValue('name').search(/^~linaro-android-member-arm-restricted\//) == 0; |
855 | + }), |
856 | + makeDT( |
857 | + "#member-ste-build-table", |
858 | + function (item) { |
859 | + var group = 'linaro-android-member-ste'; |
860 | + var pattern = new RegExp("^~" + group + "\/(?!.*release).*$"); |
861 | + return (item.getValue('name').search(pattern) == 0 && in_array(groupsArray, group)); |
862 | + }), |
863 | + makeDT( |
864 | + "#member-ste-release-build-table", |
865 | + function (item) { |
866 | + return item.getValue('name').search(/^~linaro-android-member-ste\/.*?(?:release).*$/) == 0; |
867 | + }), |
868 | + makeDT( |
869 | + "#member-ste-restricted-build-table", |
870 | + function (item) { |
871 | + return item.getValue('name').search(/^~linaro-android-member-ste-restricted\//) == 0; |
872 | + }), |
873 | + makeDT( |
874 | + "#user-build-table", |
875 | (userRegexp ? |
876 | function (item) { return item.getValue('name').search(userRegexp) == 0; } : |
877 | function (item) { return false; }) |
878 | ), |
879 | - makeDT("#all-build-table"), |
880 | - makeDT( |
881 | - "#restricted-build-table", |
882 | - function (item) { return item.getValue('name').search(/^~linaro-android-restricted\//) == 0; } |
883 | - ) |
884 | + makeDT("#archive-all-build-table", |
885 | + function (item) { return item.getValue('name').search(/^~linaro-android\//) == 0; }), |
886 | + makeDT("#archive-restricted-build-table", |
887 | + function (item) { return item.getValue('name').search(/^~linaro-android-restricted\//) == 0; }), |
888 | + makeDT("#community-build-table", |
889 | + function (item) { |
890 | + return item.getValue('name').search(/^~linaro-android-community\//) == 0;}) |
891 | ]; |
892 | |
893 | + |
894 | function extractJobsFromResponse(data) { |
895 | var response = Y.JSON.parse(data); |
896 | var results = []; |
897 | @@ -274,5 +499,6 @@ |
898 | } |
899 | } |
900 | ); |
901 | - } |
902 | -); |
903 | + |
904 | +}); |
905 | + |
Hello Georgy!
All in all changes look good.
A couple of things though: /ec2-23- 22-101- 107.compute- 1.amazonaws. com/), and I try to open one of the link at the bottom of the (like the last one), the page scrolls all the way to the top of the table. It happens if I click or right click on a link in that position: more or less after half the length of the table. Firefox version is 17.0.1.
- As said on IRC, with Chrome (23...), I cannot see the tabs, I just see plain search entry boxes, cannot understand if it is not loading the CSS or a problem with the JavaScript. I correctly see everything with Firefox. Might also be related to bug 1085007.
- The second strange behavior I see is with Firefox: if I scroll all the way down on the page (https:/