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

Unified Diff: Tools/GardeningServer/ui/ct-tree-status.html

Issue 403723005: Only show tree status if the tree isn't open. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: move if-statement Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Tools/GardeningServer/ui/ct-tree-status-tests.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/GardeningServer/ui/ct-tree-status.html
diff --git a/Tools/GardeningServer/ui/ct-tree-status.html b/Tools/GardeningServer/ui/ct-tree-status.html
index 0ee4d32e8514e2da067cadbf746501d7e8c67054..f36535faa75d2a905a7e6cf94014056236492c38 100644
--- a/Tools/GardeningServer/ui/ct-tree-status.html
+++ b/Tools/GardeningServer/ui/ct-tree-status.html
@@ -4,32 +4,36 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
-<polymer-element name="ct-tree-status" attributes="project status">
+<polymer-element name="ct-tree-status">
<template>
- <style>
- :host {
- display: block;
- whitespace: nowrap;
- overflow: hidden;
- text-overflow: ellispis;
- }
+ <template if="{{ message }}">
+ <style>
+ :host {
+ display: block;
+ whitespace: nowrap;
+ overflow: hidden;
+ text-overflow: ellispis;
+ }
- :host([status=throttled]) {
- background-color: khaki;
- }
+ :host([status=throttled]) {
+ background-color: khaki;
+ }
- :host([status=closed]) {
- color: white;
- background-color: tomato;
- }
- </style>
- {{project}}: {{message}}
+ :host([status=closed]) {
+ color: white;
+ background-color: tomato;
+ }
+ </style>
+ {{project}}: {{message}}
+ </template>
</template>
<script>
Polymer({
publish: {
+ project: '',
+ message: '',
status: {
- value: 'unknown',
+ value: 'open',
reflect: true,
},
},
@@ -43,18 +47,19 @@ found in the LICENSE file.
updateStatus: function(status) {
if (status.can_commit_freely) {
- this.message = 'Tree is open';
+ this.message = '';
this.status = 'open';
+ return;
+ }
+
+ this.message = status.message + ' by ' + status.username;
+ var responseLowerCase = status.message.toLowerCase();
+ if (responseLowerCase.indexOf('throttled') != -1) {
+ this.status = 'throttled';
+ } else if (responseLowerCase.indexOf("closed") != -1) {
+ this.status = 'closed';
} else {
- this.message = status.message + ' by ' + status.username;
- var responseLowerCase = status.message.toLowerCase();
- if (responseLowerCase.indexOf('throttled') != -1) {
- this.status = 'throttled';
- } else if (responseLowerCase.indexOf("closed") != -1) {
- this.status = 'closed';
- } else {
- this.status = 'unknown';
- }
+ this.status = 'unknown';
}
},
});
« no previous file with comments | « no previous file | Tools/GardeningServer/ui/ct-tree-status-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698