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

Side by Side Diff: Tools/GardeningServer/model/ct-failure-group.html

Issue 459723002: Sheriff-o-matic: Fix inverted condition when persisting annotations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 <script> 7 <script>
8 function CTFailureGroup(key, failures, annotation) { 8 function CTFailureGroup(key, failures, annotation) {
9 this.key = key; 9 this.key = key;
10 this.failures = failures; 10 this.failures = failures;
(...skipping 24 matching lines...) Expand all
35 35
36 Object.keys(newAnnotation, function(key, value) { 36 Object.keys(newAnnotation, function(key, value) {
37 if (value === 'undefined') { 37 if (value === 'undefined') {
38 delete annotation[key]; 38 delete annotation[key];
39 } else { 39 } else {
40 annotation[key] = value; 40 annotation[key] = value;
41 } 41 }
42 }); 42 });
43 43
44 if (Object.size(annotation) == 0) { 44 if (Object.size(annotation) == 0) {
45 delete annotations[this.key];
46 } else {
45 annotations[this.key] = annotation; 47 annotations[this.key] = annotation;
46 } else {
47 delete annotations[this.key];
48 } 48 }
49 49
50 localStorage.CTFailureGroupAnnotations = JSON.stringify(annotations); 50 localStorage.CTFailureGroupAnnotations = JSON.stringify(annotations);
51 51
52 this.annotation = annotation; 52 this.annotation = annotation;
53 this._computeProperties(); 53 this._computeProperties();
54 }.bind(this)); 54 }.bind(this));
55 }; 55 };
56 56
57 CTFailureGroup.fetchAnnotations = function() { 57 CTFailureGroup.fetchAnnotations = function() {
58 // FIXME: Fetch annotations from frontend. 58 // FIXME: Fetch annotations from frontend.
59 var stored = localStorage.CTFailureGroupAnnotations; 59 var stored = localStorage.CTFailureGroupAnnotations;
60 var annotations = stored ? JSON.parse(stored) : {}; 60 var annotations = stored ? JSON.parse(stored) : {};
61 return Promise.resolve(annotations); 61 return Promise.resolve(annotations);
62 }; 62 };
63 </script> 63 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698