Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1199)

Side by Side Diff: appengine/sheriff_o_matic/model/ct-failure-group.html

Issue 1922983002: sheriff_o_matic: Add error if ajax request fails. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | appengine/sheriff_o_matic/ui/ct-failure-card-buttons.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <link rel="import" href="ct-tree-list.html"> 8 <link rel="import" href="ct-tree-list.html">
9 9
10 <script> 10 <script>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 fullChange[0][kind] = change; 128 fullChange[0][kind] = change;
129 129
130 return net.ajax({ 130 return net.ajax({
131 type: 'POST', 131 type: 'POST',
132 data: JSON.stringify(fullChange), 132 data: JSON.stringify(fullChange),
133 url: '/api/v1/annotations/' + this.key, 133 url: '/api/v1/annotations/' + this.key,
134 }).then(function(data) { 134 }).then(function(data) {
135 var parsed = JSON.parse(data); 135 var parsed = JSON.parse(data);
136 CTFailureGroup._annotations[parsed.key] = parsed; 136 CTFailureGroup._annotations[parsed.key] = parsed;
137 this._computeProperties(); 137 this._computeProperties();
138 }.bind(this), function(reject) {
139 if (this.errorCallback) {
140 this.errorCallback(reject);
141 }
138 }.bind(this)); 142 }.bind(this));
139 }; 143 };
140 144
141 145
142 CTFailureGroup.prototype.fetchAnnotations = function() { 146 CTFailureGroup.prototype.fetchAnnotations = function() {
143 return net.json('/api/v1/annotations/' + this.key).then(function(data) { 147 return net.json('/api/v1/annotations/' + this.key).then(function(data) {
144 CTFailureGroup._annotations[data.key] = data; 148 CTFailureGroup._annotations[data.key] = data;
145 this._computeProperties(); 149 this._computeProperties();
146 }.bind(this)); 150 }.bind(this));
147 }; 151 };
148 152
149 CTFailureGroup.fetchAllAnnotations = function() { 153 CTFailureGroup.fetchAllAnnotations = function() {
150 return net.json('/api/v1/annotations').then(function(data) { 154 return net.json('/api/v1/annotations').then(function(data) {
151 if (CTFailureGroup._annotations == null) { 155 if (CTFailureGroup._annotations == null) {
152 CTFailureGroup._annotations = {}; 156 CTFailureGroup._annotations = {};
153 } 157 }
154 158
155 data.forEach(function(annotation) { 159 data.forEach(function(annotation) {
156 CTFailureGroup._annotations[annotation.key] = annotation; 160 CTFailureGroup._annotations[annotation.key] = annotation;
157 }) 161 })
158 return data; 162 return data;
159 }); 163 });
160 }; 164 };
161 165
162 </script> 166 </script>
OLDNEW
« no previous file with comments | « no previous file | appengine/sheriff_o_matic/ui/ct-failure-card-buttons.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698