OLD | NEW |
---|---|
(Empty) | |
1 <polymer-element name="nb-alert-list" attributes='failures'> | |
ojan
2014/07/22 02:01:27
Copyright. Here and in all the files below
ojan
2014/07/22 02:01:27
Copyright
| |
2 <template> | |
3 <sortable-table id='table' data='{{failures}}' rowTemplate="rowTemplate" sty le='width: 100%'> | |
4 <template id="rowTemplate"> | |
5 <style> | |
6 .fail_link { background-color: #FCC;} | |
ojan
2014/07/22 02:01:27
Nit: we've been using fail-link and pass-link styl
| |
7 .pass_link { background-color: #CFC;} | |
8 </style> | |
9 <td>{{record.row.master_url | master_name }}</td> | |
ojan
2014/07/22 02:01:27
Inconsistent spacing. FWIW, we've been standardizi
| |
10 <td style='max-width: 150px; overflow: hidden'> | |
11 <a href='{{ record.row | builder_url }}'>{{record.row.builder_name}}</ a> | |
12 </td> | |
13 <td>{{record.row.failing_build_count}}</td> | |
14 <td style='max-width: 300px; overflow: hidden; word-wrap: break-word;'> | |
15 <a href='{{ record.row | stdio_url(record.row.failing_build) }}'>{{rec ord.row.step_name}}</a> | |
16 <br> | |
17 <template if="{{ record.row.reason }}"> | |
18 <a href="{{ record.row.reason | flakiness_dashboard_url(record.row.s tep_name, record.row.master_url) }}"> | |
19 {{record.row.reason }} | |
20 </a> | |
21 </template> | |
22 </td> | |
23 <td> | |
24 <a class='fail_link' href="{{ record.row | build_url(record.row.failin g_build) }}">F</a> | |
25 <template if='{{ record.row.passing_build }}'> | |
26 <a class='pass_link' href="{{ record.row | build_url(record.row.pass ing_build) }}">P</a> | |
27 </template> | |
28 </td> | |
29 <td style='max-width: 200px; overflow: hidden'> | |
30 <nb-changelogs passing="{{ record.row.passing_revisions }}" failing="{ {record.row.failing_revisions}}"></nb-changelogs> | |
31 </td> | |
32 <td>{{ record.row.last_result_time | since_string }}</td> | |
33 <td>{{ record.row.would_close_tree }}</td> | |
34 <td>{{ record.row.tree_name }}</td> | |
35 </template> | |
36 </sortable-table> | |
37 </template> | |
38 <script> | |
39 Polymer('nb-alert-list', { | |
40 ready: function() { | |
41 this.$.table.columns = [ | |
42 { title: 'master', name: 'master_url' }, | |
43 { title: 'builder', name: 'builder_name' }, | |
44 { title: 'times', name: 'failing_build_count' }, | |
45 { title: 'failure', name: 'reason' }, | |
46 { title: 'edges', name: 'failing_build' }, // bad sort criteria. | |
47 { title: 'changelogs', name: 'failing_revisions' }, // also bad. | |
48 { title: 'since', name: 'last_result_time' }, | |
49 { title: 'closer', name: 'would_close_tree' }, | |
50 { title: 'tree', name: 'tree_name' }, | |
51 ]; | |
52 this.$.table.sortColumn = this.getQueryParameter('sortColumn'); | |
53 this.$.table.sortDescending = this.getQueryParameter('sortDescending'); | |
54 }, | |
55 getQueryParameter: function(name) { | |
56 name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
57 var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); | |
58 var results = regex.exec(window.location.search); | |
59 return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
60 }, | |
61 observe: { | |
62 '$.table.sortColumn': 'sortColumnChanged' | |
ojan
2014/07/22 02:01:27
Indentation is off.
| |
63 }, | |
64 sortColumnChanged: function(oldValue, newValue) { | |
ojan
2014/07/22 02:01:27
Delete this code. Can always add it later.
| |
65 // FIXME: Save the sort column in the url. | |
66 console.log(newValue); | |
67 } | |
68 }); | |
69 </script> | |
70 </polymer-element> | |
OLD | NEW |