OLD | NEW |
---|---|
1 <!-- | 1 <!-- |
2 Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. | 4 found in the LICENSE file. |
5 --> | 5 --> |
6 | 6 |
7 <link rel="import" href="ct-commit-list.html"> | 7 <link rel="import" href="ct-commit-list.html"> |
8 | 8 |
9 <script> | 9 <script> |
10 function CTFailureGroup(failures, commitList) { | 10 function CTFailureGroup(failures, commitList) { |
11 this.failures = failures; | 11 this.failures = failures; |
12 this.commitList = commitList; | 12 this.commitList = commitList; |
13 this._annotation = CTFailureGroup._mergeAnnotations(failures.map(function(fail ure) { | 13 this._annotation = CTFailureGroup._mergeAnnotations(failures.map(function(fail ure) { |
14 return failure.annotations(); | 14 return failure.annotations(); |
15 }).flatten()); | 15 }).flatten()); |
16 this._computeProperties(); | 16 this._computeProperties(); |
17 this.type = 'sheriff'; | |
17 } | 18 } |
18 | 19 |
20 function CTTrooperFailureGroup(data, type, tree, annotation) { | |
ojan
2014/09/02 02:35:11
Rather than using inheritance for this, in other p
shans
2014/09/04 01:59:42
Done.
| |
21 this.data = data; | |
22 this._annotation = annotation || {}; | |
23 this._computeProperties(); | |
24 this.type = type; | |
25 this.tree = tree; | |
26 } | |
27 | |
28 CTTrooperFailureGroup.prototype = CTFailureGroup.prototype; | |
29 | |
19 CTFailureGroup.prototype.snoozeUntil = function(time) { | 30 CTFailureGroup.prototype.snoozeUntil = function(time) { |
20 return this._annotate({ | 31 return this._annotate({ |
21 snoozeTime: time, | 32 snoozeTime: time, |
22 }); | 33 }); |
23 }; | 34 }; |
24 | 35 |
25 CTFailureGroup.prototype.unsnooze = function() { | 36 CTFailureGroup.prototype.unsnooze = function() { |
26 return this._annotate({ | 37 return this._annotate({ |
27 snoozeTime: undefined, | 38 snoozeTime: undefined, |
28 }); | 39 }); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 }.bind(this)); | 124 }.bind(this)); |
114 }; | 125 }; |
115 | 126 |
116 CTFailureGroup.fetchAnnotations = function() { | 127 CTFailureGroup.fetchAnnotations = function() { |
117 // FIXME: Fetch annotations from frontend. | 128 // FIXME: Fetch annotations from frontend. |
118 var stored = localStorage.CTFailureGroupAnnotations; | 129 var stored = localStorage.CTFailureGroupAnnotations; |
119 var annotations = stored ? JSON.parse(stored) : {}; | 130 var annotations = stored ? JSON.parse(stored) : {}; |
120 return Promise.resolve(annotations); | 131 return Promise.resolve(annotations); |
121 }; | 132 }; |
122 </script> | 133 </script> |
OLD | NEW |