Home | History | Annotate | Download | only in ui
      1 <!--
      2 Copyright 2014 The Chromium Authors. All rights reserved.
      3 Use of this source code is governed by a BSD-style license that can be
      4 found in the LICENSE file.
      5 -->
      6 
      7 <link rel="import" href="../bower_components/paper-button/paper-button.html">
      8 <link rel="import" href="../model/tree-status.html">
      9 <link rel="import" href="ct-failure-stream.html">
     10 <link rel="import" href="ct-last-updated.html">
     11 <link rel="import" href="ct-party-time.html">
     12 <link rel="import" href="ct-tree-status.html">
     13 
     14 <polymer-element name="ct-unexpected-failures" attributes="tree commitLog failures">
     15   <template>
     16     <style>
     17       ct-tree-status {
     18         white-space: nowrap;
     19         overflow: hidden;
     20         text-overflow: ellipsis;
     21         margin: 5px;
     22         padding: 3px;
     23       }
     24 
     25       ct-tree-status[state=open] {
     26         margin: 0;
     27         padding: 0;
     28       }
     29 
     30       .toolbar {
     31         display: flex;
     32         justify-content: space-between;
     33         align-items: baseline;
     34         padding: 0 5px;
     35       }
     36     </style>
     37     <div class="toolbar">
     38       <a href="https://code.google.com/p/chromium/wiki/UsefulURLs">Useful URLs</a>
     39     </div>
     40     <ct-tree-status status="{{ treeStatuses['chromium'] }}" state="{{ treeStatuses['chromium'].status }}"></ct-tree-status>
     41     <ct-tree-status status="{{ treeStatuses['blink'] }}" state="{{ treeStatuses['blink'].status }}"></ct-tree-status>
     42     <template if="{{ failures && failures.failures && (!failures.failures[tree] || !failures.failures[tree].length) }}">
     43       <ct-party-time></ct-party-time>
     44     </template>
     45     <ct-failure-stream title="Probably-hung bots" category="builders" groups="{{ failures && failures.failures[tree] }}" commitLog="{{ commitLog }}"></ct-failure-stream>
     46     <ct-failure-stream title="Reliable failures" category="default" groups="{{ failures && failures.failures[tree] }}" commitLog="{{ commitLog }}"></ct-failure-stream>
     47     <ct-failure-stream title="Failures that have only happened once (on one bot)" category="failedOnce" groups="{{ failures && failures.failures[tree] }}" commitLog="{{ commitLog }}"></ct-failure-stream>
     48     <ct-failure-stream title="Snoozed failures" category="snoozed" groups="{{ failures && failures.failures[tree] }}" commitLog="{{ commitLog }}"></ct-failure-stream>
     49   </template>
     50   <script>
     51   (function() {
     52     Polymer({
     53       tree: '',
     54 
     55       created: function() {
     56         this.treeStatuses = {};
     57         var projects = ['chromium', 'blink'];
     58         for (var i = 0; i < projects.length; i++) {
     59           this.treeStatuses[projects[i]] = new TreeStatus(projects[i]);
     60         }
     61       },
     62 
     63       attached: function() {
     64         this.update();
     65       },
     66 
     67       update: function() {
     68         // FIXME: These shouldn't update if there's already an update in progress.
     69         Object.keys(this.treeStatuses, function(tree, status) {
     70           status.update();
     71         });
     72       },
     73     });
     74   })();
     75   </script>
     76 </polymer-element>
     77