Index: Tools/AutoSheriff/ui/nb-grouped-alert-list.html |
diff --git a/Tools/AutoSheriff/ui/nb-grouped-alert-list.html b/Tools/AutoSheriff/ui/nb-grouped-alert-list.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..063839467eaf085e0672edd3c00f7fc5113f704f |
--- /dev/null |
+++ b/Tools/AutoSheriff/ui/nb-grouped-alert-list.html |
@@ -0,0 +1,74 @@ |
+<polymer-element name='nb-grouped-alert-list' attributes='failures groups'> |
+<template> |
+ <script src='filters.js'></script> |
+ <table> |
+ <tr><th>reason</th><th>blame</th><th>builders</th></tr> |
+ <template repeat="{{ group in groups }}"> |
+ <tr> |
+ <td> |
+ {{ group.failures[0].step_name }} |
+ <template repeat="{{ reason in group.reasons }}"> |
+ <template if="{{ reason }}"> |
+ <!-- FIXME this will be wrong if there are multiple step names! --> |
+ <div> |
+ <a href="{{ reason | flakiness_dashboard_url(group.failures[0].step_name, group.failures[0].master_url) }}"> |
+ {{reason }} |
+ </a> |
+ </div> |
+ </template> |
+ </template> |
+ </td> |
+ <td> |
+ <template if="{{ group.likely_revisions.length < 10}}"> |
+ <template repeat="{{ revision in group.likely_revisions }}"> |
+ <div> |
+ <a href="{{ revision | change_url }}">{{ revision }}</a> |
+ </div> |
+ </template> |
+ </template> |
+ <template if="{{ group.likely_revisions.length >= 10 }}"> |
+ <nb-changelogs passing="{{ group.merged_last_passing }}" failing="{{ group.merged_first_failing }}"></nb-changelogs> |
+ </template> |
+ </td> |
+ <td> |
+ <template repeat="{{ builder_name in group.builder_names }}"> |
+ <span style='border: 1px solid blue'>{{ builder_name }}</span> |
+ </template> |
+ </td> |
+ </tr> |
+ </template> |
+ </table> |
+</template> |
+<script> |
+Polymer('nb-grouped-alert-list', { |
+ change_url: function(value) { |
+ var args = value.split(':'); |
+ return repositories.change_url(args[0], args[1]); |
+ }, |
+ groupsChanged: function(oldValue, newValue) { |
+ // This is kinda hacky to modify newValue. |
+ newValue.forEach(function(group) { |
+ var reasons = {}; |
+ var builder_names = {}; |
+ group.failures = [] |
+ group.failure_keys.forEach(function(failure_key) { |
+ var failure = this.failureForKey(failure_key); |
+ group.failures.push(failure); |
+ if (failure.reason) |
+ reasons[failure.reason] = 1; |
+ builder_names[failure.builder_name] = 1; |
+ }, this); |
+ group.reasons = Object.keys(reasons); |
+ group.builder_names = Object.keys(builder_names); |
+ }, this); |
+ }, |
+ failureForKey: function(key) { |
+ for (var x = 0; x < this.failures.length; x++) { |
+ var failure = this.failures[x]; |
+ if (failure.key == key) |
+ return failure |
+ } |
+ } |
+}); |
+</script> |
+</polymer-element> |